mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-21 18:48:35 +00:00
Refactor group messaging protocol.
// FREEBIE
This commit is contained in:
@@ -3,7 +3,6 @@ package org.thoughtcrime.securesms.sms;
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.thoughtcrime.securesms.util.GroupUtil;
|
||||
import org.whispersystems.textsecure.push.PushMessageProtos;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -28,20 +27,14 @@ public class IncomingGroupMessage extends IncomingTextMessage {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isAdd() {
|
||||
return
|
||||
groupContext.getType().getNumber() == GroupContext.Type.ADD_VALUE ||
|
||||
groupContext.getType().getNumber() == GroupContext.Type.CREATE_VALUE;
|
||||
public boolean isUpdate() {
|
||||
return groupContext.getType().getNumber() == GroupContext.Type.UPDATE_VALUE;
|
||||
}
|
||||
|
||||
public boolean isQuit() {
|
||||
return groupContext.getType().getNumber() == GroupContext.Type.QUIT_VALUE;
|
||||
}
|
||||
|
||||
public boolean isModify() {
|
||||
return groupContext.getType().getNumber() == GroupContext.Type.MODIFY_VALUE;
|
||||
}
|
||||
|
||||
public static IncomingGroupMessage createForQuit(String groupId, String user) throws IOException {
|
||||
IncomingTextMessage base = new IncomingTextMessage(user, groupId);
|
||||
GroupContext context = GroupContext.newBuilder()
|
||||
|
Reference in New Issue
Block a user