mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Adjust profile key sharing based on sync messages
// FREEBIE
This commit is contained in:
parent
62c738ee58
commit
3e3ae5f865
@ -429,6 +429,18 @@ public class PushDecryptJob extends ContextJob {
|
|||||||
handleUnknownGroupMessage(envelope, message.getMessage().getGroupInfo().get());
|
handleUnknownGroupMessage(envelope, message.getMessage().getGroupInfo().get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.getMessage().getProfileKey().isPresent()) {
|
||||||
|
Recipient recipient = null;
|
||||||
|
|
||||||
|
if (message.getDestination().isPresent()) recipient = Recipient.from(context, Address.fromExternal(context, message.getDestination().get()), false);
|
||||||
|
else if (message.getMessage().getGroupInfo().isPresent()) recipient = Recipient.from(context, Address.fromSerialized(GroupUtil.getEncodedId(message.getMessage().getGroupInfo().get().getGroupId(), false)), false);
|
||||||
|
|
||||||
|
|
||||||
|
if (recipient != null && !recipient.isSystemContact() && !recipient.isProfileSharing()) {
|
||||||
|
DatabaseFactory.getRecipientDatabase(context).setProfileSharing(recipient, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (threadId != null) {
|
if (threadId != null) {
|
||||||
DatabaseFactory.getThreadDatabase(getContext()).setRead(threadId, true);
|
DatabaseFactory.getThreadDatabase(getContext()).setRead(threadId, true);
|
||||||
MessageNotifier.updateNotification(getContext(), masterSecret.getMasterSecret().orNull());
|
MessageNotifier.updateNotification(getContext(), masterSecret.getMasterSecret().orNull());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user