mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 04:25:18 +00:00
Skip friend request handling if we received a group message.
This commit is contained in:
parent
31ad7a40de
commit
d7571d237a
@ -1080,7 +1080,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
|
|
||||||
private void acceptFriendRequestIfNeeded(@NonNull SignalServiceEnvelope envelope, @NonNull SignalServiceContent content) {
|
private void acceptFriendRequestIfNeeded(@NonNull SignalServiceEnvelope envelope, @NonNull SignalServiceContent content) {
|
||||||
// If we get anything other than a friend request, we can assume that we have a session with the other user
|
// If we get anything other than a friend request, we can assume that we have a session with the other user
|
||||||
if (envelope.isFriendRequest()) { return; }
|
if (envelope.isFriendRequest() || isGroupChatMessage(content)) { return; }
|
||||||
becomeFriendsWithContact(content.getSender());
|
becomeFriendsWithContact(content.getSender());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1100,7 +1100,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateFriendRequestStatusIfNeeded(@NonNull SignalServiceEnvelope envelope, @NonNull SignalServiceContent content, @NonNull SignalServiceDataMessage message) {
|
private void updateFriendRequestStatusIfNeeded(@NonNull SignalServiceEnvelope envelope, @NonNull SignalServiceContent content, @NonNull SignalServiceDataMessage message) {
|
||||||
if (!envelope.isFriendRequest()) { return; }
|
if (!envelope.isFriendRequest() || isGroupChatMessage(message)) { return; }
|
||||||
// This handles the case where another user sends us a regular message without authorisation
|
// This handles the case where another user sends us a regular message without authorisation
|
||||||
boolean shouldBecomeFriends = MultiDeviceUtilities.shouldAutomaticallyBecomeFriendsWithDevice(content.getSender(), context);
|
boolean shouldBecomeFriends = MultiDeviceUtilities.shouldAutomaticallyBecomeFriendsWithDevice(content.getSender(), context);
|
||||||
if (shouldBecomeFriends) {
|
if (shouldBecomeFriends) {
|
||||||
@ -1602,6 +1602,14 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isGroupChatMessage(SignalServiceContent content) {
|
||||||
|
return content.getDataMessage().isPresent() && isGroupChatMessage(content.getDataMessage().get());
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isGroupChatMessage(SignalServiceDataMessage message) {
|
||||||
|
return message.isGroupUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
private void resetRecipientToPush(@NonNull Recipient recipient) {
|
private void resetRecipientToPush(@NonNull Recipient recipient) {
|
||||||
if (recipient.isForceSmsSelection()) {
|
if (recipient.isForceSmsSelection()) {
|
||||||
DatabaseFactory.getRecipientDatabase(context).setForceSmsSelection(recipient, false);
|
DatabaseFactory.getRecipientDatabase(context).setForceSmsSelection(recipient, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user