mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-12 10:43:39 +00:00
Fix crash
This commit is contained in:
parent
e352b2284e
commit
b8454f3db2
@ -131,10 +131,12 @@ public class GroupMessageProcessor {
|
|||||||
String id = GroupUtil.getEncodedId(group);
|
String id = GroupUtil.getEncodedId(group);
|
||||||
|
|
||||||
String userMasterDevice = TextSecurePreferences.getMasterHexEncodedPublicKey(context);
|
String userMasterDevice = TextSecurePreferences.getMasterHexEncodedPublicKey(context);
|
||||||
|
if (userMasterDevice == null) { userMasterDevice = TextSecurePreferences.getLocalNumber(context); }
|
||||||
|
|
||||||
if (group.getGroupType() == SignalServiceGroup.GroupType.SIGNAL) {
|
if (group.getGroupType() == SignalServiceGroup.GroupType.SIGNAL) {
|
||||||
// Loki - Only update the group if the group admin sent the message
|
// Loki - Only update the group if the group admin sent the message
|
||||||
String masterDevice = MultiDeviceProtocol.shared.getMasterDevice(content.getSender());
|
String masterDevice = MultiDeviceProtocol.shared.getMasterDevice(content.getSender());
|
||||||
|
if (masterDevice == null) { masterDevice = content.getSender(); }
|
||||||
if (!groupRecord.getAdmins().contains(Address.fromSerialized(masterDevice))) {
|
if (!groupRecord.getAdmins().contains(Address.fromSerialized(masterDevice))) {
|
||||||
Log.d("Loki", "Received a group update message from a non-admin user for: " + id +"; ignoring.");
|
Log.d("Loki", "Received a group update message from a non-admin user for: " + id +"; ignoring.");
|
||||||
return null;
|
return null;
|
||||||
@ -212,6 +214,7 @@ public class GroupMessageProcessor {
|
|||||||
@NonNull GroupRecord record)
|
@NonNull GroupRecord record)
|
||||||
{
|
{
|
||||||
String masterDevice = MultiDeviceProtocol.shared.getMasterDevice(content.getSender());
|
String masterDevice = MultiDeviceProtocol.shared.getMasterDevice(content.getSender());
|
||||||
|
if (masterDevice == null) { masterDevice = content.getSender(); }
|
||||||
if (record.getMembers().contains(Address.fromSerialized(masterDevice))) {
|
if (record.getMembers().contains(Address.fromSerialized(masterDevice))) {
|
||||||
ApplicationContext.getInstance(context)
|
ApplicationContext.getInstance(context)
|
||||||
.getJobManager()
|
.getJobManager()
|
||||||
@ -234,6 +237,7 @@ public class GroupMessageProcessor {
|
|||||||
builder.setType(GroupContext.Type.QUIT);
|
builder.setType(GroupContext.Type.QUIT);
|
||||||
|
|
||||||
String masterDevice = MultiDeviceProtocol.shared.getMasterDevice(content.getSender());
|
String masterDevice = MultiDeviceProtocol.shared.getMasterDevice(content.getSender());
|
||||||
|
if (masterDevice == null) { masterDevice = content.getSender(); }
|
||||||
if (members.contains(Address.fromExternal(context, masterDevice))) {
|
if (members.contains(Address.fromExternal(context, masterDevice))) {
|
||||||
database.remove(id, Address.fromExternal(context, masterDevice));
|
database.remove(id, Address.fromExternal(context, masterDevice));
|
||||||
if (outgoing) database.setActive(id, false);
|
if (outgoing) database.setActive(id, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user