mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
received group messages aren't processed as "meta" group stuff, oops.
This commit is contained in:
parent
fb75d90edc
commit
abce678cb4
@ -25,6 +25,7 @@ import android.view.ViewGroup;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.CursorAdapter;
|
||||
|
||||
import org.thoughtcrime.securesms.util.GroupUtil;
|
||||
import org.whispersystems.textsecure.crypto.MasterSecret;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.MmsSmsColumns;
|
||||
@ -32,6 +33,7 @@ import org.thoughtcrime.securesms.database.MmsSmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.SmsDatabase;
|
||||
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||
import org.thoughtcrime.securesms.util.LRUCache;
|
||||
import org.whispersystems.textsecure.push.PushMessageProtos.PushMessageContent.GroupContext;
|
||||
|
||||
import java.lang.ref.SoftReference;
|
||||
import java.util.Collections;
|
||||
@ -121,7 +123,7 @@ public class ConversationAdapter extends CursorAdapter implements AbsListView.Re
|
||||
long id = cursor.getLong(cursor.getColumnIndexOrThrow(MmsSmsColumns.ID));
|
||||
String type = cursor.getString(cursor.getColumnIndexOrThrow(MmsSmsDatabase.TRANSPORT));
|
||||
MessageRecord messageRecord = getMessageRecord(id, cursor, type);
|
||||
if (messageRecord.getGroupAction() > 0) return MESSAGE_TYPE_GROUP_ACTION;
|
||||
if (GroupUtil.isMetaGroupAction(messageRecord.getGroupAction())) return MESSAGE_TYPE_GROUP_ACTION;
|
||||
if (messageRecord.isOutgoing()) return MESSAGE_TYPE_OUTGOING;
|
||||
else return MESSAGE_TYPE_INCOMING;
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ public class ConversationItem extends LinearLayout {
|
||||
|
||||
setBodyText(messageRecord);
|
||||
|
||||
if (messageRecord.getGroupAction() < 1) {
|
||||
if (!GroupUtil.isMetaGroupAction(messageRecord.getGroupAction())) {
|
||||
setStatusIcons(messageRecord);
|
||||
setContactPhoto(messageRecord);
|
||||
setGroupMessageStatus(messageRecord);
|
||||
|
@ -33,6 +33,11 @@ public class GroupUtil {
|
||||
return groupId.startsWith(ENCODED_GROUP_PREFIX);
|
||||
}
|
||||
|
||||
public static boolean isMetaGroupAction(int groupAction) {
|
||||
return groupAction > 0
|
||||
&& groupAction != GroupContext.Type.DELIVER_VALUE;
|
||||
}
|
||||
|
||||
public static String serializeArguments(byte[] id, String name, List<String> members) {
|
||||
return Base64.encodeBytes(GroupContext.newBuilder()
|
||||
.setId(ByteString.copyFrom(id))
|
||||
|
Loading…
Reference in New Issue
Block a user