mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
Allow leaving from a secondary device.
This commit is contained in:
parent
a61f9b4eb7
commit
9d0f40a18f
@ -1152,10 +1152,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
if (threadId != -1 && leaveMessage.isPresent()) {
|
||||
MessageSender.send(this, leaveMessage.get(), threadId, false, null);
|
||||
|
||||
// We need to remove the master device from the group
|
||||
String masterHexEncodedPublicKey = TextSecurePreferences.getMasterHexEncodedPublicKey(this);
|
||||
String localNumber = masterHexEncodedPublicKey != null ? masterHexEncodedPublicKey : TextSecurePreferences.getLocalNumber(this);
|
||||
|
||||
GroupDatabase groupDatabase = DatabaseFactory.getGroupDatabase(this);
|
||||
String groupId = groupRecipient.getAddress().toGroupString();
|
||||
groupDatabase.setActive(groupId, false);
|
||||
groupDatabase.remove(groupId, Address.fromSerialized(TextSecurePreferences.getLocalNumber(this)));
|
||||
groupDatabase.remove(groupId, Address.fromSerialized(localNumber));
|
||||
|
||||
initializeEnabledCheck();
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user