mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-19 21:58:25 +00:00
Add FIXME
This commit is contained in:
parent
7d9eafe8fb
commit
6ed3a4c372
@ -2042,6 +2042,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
setStatusBarColor(getResources().getColor(R.color.action_bar_background));
|
||||
}
|
||||
|
||||
// FIXME: This name is confusing because we also have updateInputPanel and setInputPanelEnabled
|
||||
private void updateInputUI(Recipient recipient, boolean isSecureText, boolean isDefaultSms) {
|
||||
if (recipient.isGroupRecipient() && !isActiveGroup()) {
|
||||
unblockButton.setVisibility(View.GONE);
|
||||
|
@ -140,18 +140,18 @@ public class GroupMessageProcessor {
|
||||
String ourHexEncodedPublicKey = getMasterHexEncodedPublicKey(context, TextSecurePreferences.getLocalNumber(context));
|
||||
|
||||
if (group.getGroupType() == SignalServiceGroup.GroupType.SIGNAL) {
|
||||
// Only update group if admin sent the message
|
||||
// Only update group if the group admin sent the message
|
||||
String hexEncodedPublicKey = getMasterHexEncodedPublicKey(context, content.getSender());
|
||||
if (!groupRecord.getAdmins().contains(Address.fromSerialized(hexEncodedPublicKey))) {
|
||||
Log.d("Loki - Group Message", "Received a group update message from a non-admin user for " + id +". Ignoring.");
|
||||
return null;
|
||||
}
|
||||
|
||||
// We should only process update message if we were in the group
|
||||
// We should only process update messages if we're in the group
|
||||
Address ourAddress = Address.fromSerialized(ourHexEncodedPublicKey);
|
||||
if (!groupRecord.getMembers().contains(ourAddress) &&
|
||||
!group.getMembers().or(Collections.emptyList()).contains(ourHexEncodedPublicKey)) {
|
||||
Log.d("Loki - Group Message", "Received a group update message from a group we are not members in: " + id + " . Ignoring.");
|
||||
Log.d("Loki - Group Message", "Received a group update message from a group we are not a member of: " + id + "; ignoring.");
|
||||
database.setActive(id, false);
|
||||
return null;
|
||||
}
|
||||
@ -181,7 +181,7 @@ public class GroupMessageProcessor {
|
||||
}
|
||||
|
||||
// We add any new or removed members to the group context
|
||||
// This will allow us later to iterate over them to check if they left or were added for UI display
|
||||
// This will allow us later to iterate over them to check if they left or were added for UI purposes
|
||||
for (Address addedMember : addedMembers) {
|
||||
builder.addNewMembers(addedMember.serialize());
|
||||
}
|
||||
|
@ -1898,7 +1898,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
||||
boolean isClosedGroup = conversation.getAddress().isSignalGroup();
|
||||
boolean isGroupMember = true;
|
||||
|
||||
// Only allow messages from members of a group
|
||||
// Only allow messages from group members
|
||||
if (isClosedGroup) {
|
||||
String senderHexEncodedPublicKey = content.getSender();
|
||||
|
||||
@ -1911,9 +1911,9 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Recipient senderMaster = Recipient.from(context, Address.fromSerialized(senderHexEncodedPublicKey), false);
|
||||
Recipient senderMasterAddress = Recipient.from(context, Address.fromSerialized(senderHexEncodedPublicKey), false);
|
||||
|
||||
isGroupMember = groupId.isPresent() && groupDatabase.getGroupMembers(groupId.get(), true).contains(senderMaster);
|
||||
isGroupMember = groupId.isPresent() && groupDatabase.getGroupMembers(groupId.get(), true).contains(senderMasterAddress);
|
||||
}
|
||||
|
||||
return (isContentMessage && !isGroupActive) || (sender.isBlocked() && !isLeaveMessage) || (isContentMessage && !isGroupMember);
|
||||
|
Loading…
x
Reference in New Issue
Block a user