-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
207 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/org/thoughtcrime/securesms/push/GroupActionRecord.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.thoughtcrime.securesms.push; | ||
|
||
import org.thoughtcrime.securesms.recipients.Recipient; | ||
|
||
import java.util.Set; | ||
|
||
public class GroupActionRecord { | ||
|
||
private static final int CREATE_GROUP_TYPE = 1; | ||
private static final int ADD_USERS_TYPE = 2; | ||
private static final int LEAVE_GROUP_TYPE = 3; | ||
|
||
private final int type; | ||
private final Set<Recipient> recipients; | ||
private final byte[] groupId; | ||
private final String groupName; | ||
private final byte[] avatar; | ||
|
||
public GroupActionRecord(int type, byte[] groupId, String groupName, | ||
byte[] avatar, Set<Recipient> recipients) | ||
{ | ||
this.type = type; | ||
this.groupId = groupId; | ||
this.groupName = groupName; | ||
this.avatar = avatar; | ||
this.recipients = recipients; | ||
} | ||
|
||
public boolean isCreateAction() { | ||
return type== CREATE_GROUP_TYPE; | ||
} | ||
|
||
public boolean isAddUsersAction() { | ||
return type == ADD_USERS_TYPE; | ||
} | ||
|
||
public boolean isLeaveAction() { | ||
return type == LEAVE_GROUP_TYPE; | ||
} | ||
|
||
|
||
public Set<Recipient> getRecipients() { | ||
return recipients; | ||
} | ||
|
||
public byte[] getGroupId() { | ||
return groupId; | ||
} | ||
|
||
public String getGroupName() { | ||
return groupName; | ||
} | ||
|
||
public byte[] getAvatar() { | ||
return avatar; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters