Make 'push' status a type bit on both incoming and outgoing msgs.

This commit is contained in:
Moxie Marlinspike
2014-02-20 23:00:38 -08:00
parent 2026330f8a
commit ccd1691b22
12 changed files with 55 additions and 49 deletions

View File

@@ -20,11 +20,13 @@ public class IncomingMediaMessage {
private final PduHeaders headers;
private final PduBody body;
private final String groupId;
private final boolean push;
public IncomingMediaMessage(RetrieveConf retreived) {
this.headers = retreived.getPduHeaders();
this.body = retreived.getBody();
this.groupId = null;
this.push = false;
}
public IncomingMediaMessage(MasterSecret masterSecret, String localNumber,
@@ -33,6 +35,7 @@ public class IncomingMediaMessage {
{
this.headers = new PduHeaders();
this.body = new PduBody();
this.push = true;
if (messageContent.hasGroup()) {
this.groupId = GroupUtil.getEncodedId(messageContent.getGroup().getId().toByteArray());
@@ -84,6 +87,10 @@ public class IncomingMediaMessage {
return groupId;
}
public boolean isPushMessage() {
return push;
}
public boolean isGroupMessage() {
return groupId != null ||
!Util.isEmpty(headers.getEncodedStringValues(PduHeaders.CC)) ||