2014-02-19 21:06:54 -08:00
|
|
|
package org.thoughtcrime.securesms.sms;
|
|
|
|
|
2015-05-29 16:23:47 -07:00
|
|
|
import static org.whispersystems.textsecure.internal.push.TextSecureProtos.GroupContext;
|
2014-02-19 21:06:54 -08:00
|
|
|
|
|
|
|
public class IncomingGroupMessage extends IncomingTextMessage {
|
|
|
|
|
|
|
|
private final GroupContext groupContext;
|
|
|
|
|
|
|
|
public IncomingGroupMessage(IncomingTextMessage base, GroupContext groupContext, String body) {
|
|
|
|
super(base, body);
|
|
|
|
this.groupContext = groupContext;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public IncomingGroupMessage withMessageBody(String body) {
|
|
|
|
return new IncomingGroupMessage(this, groupContext, body);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean isGroup() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-02-21 17:51:25 -08:00
|
|
|
public boolean isUpdate() {
|
|
|
|
return groupContext.getType().getNumber() == GroupContext.Type.UPDATE_VALUE;
|
2014-02-19 21:06:54 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isQuit() {
|
|
|
|
return groupContext.getType().getNumber() == GroupContext.Type.QUIT_VALUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|