- private static byte[] getGroupId(final Manager m, final SignalServiceDataMessage message) {
- byte[] groupId;
- if (message.getGroupContext().isPresent()) {
- if (message.getGroupContext().get().getGroupV1().isPresent()) {
- groupId = message.getGroupContext().get().getGroupV1().get().getGroupId();
- } else if (message.getGroupContext().get().getGroupV2().isPresent()) {
- groupId = GroupUtils.getGroupId(message.getGroupContext().get().getGroupV2().get().getMasterKey());
- } else {
- groupId = null;
- }
- } else {
- groupId = null;
- }
- return groupId;
+ private static byte[] getGroupId(final SignalServiceDataMessage message) {
+ return message.getGroupContext().isPresent() ? GroupUtils.getGroupId(message.getGroupContext().get())
+ .serialize() : null;