Use name in groupInfo only if it's a group update

Signal-Android send an empty name instead of absent, with group quit messages
This commit is contained in:
AsamK 2016-06-19 21:13:24 +02:00
parent 3e2024ff0a
commit 2972dd27c1

View file

@ -745,7 +745,7 @@ public class Main {
SignalServiceGroup groupInfo = message.getGroupInfo().get(); SignalServiceGroup groupInfo = message.getGroupInfo().get();
System.out.println("Group info:"); System.out.println("Group info:");
System.out.println(" Id: " + Base64.encodeBytes(groupInfo.getGroupId())); System.out.println(" Id: " + Base64.encodeBytes(groupInfo.getGroupId()));
if (groupInfo.getName().isPresent()) { if (groupInfo.getType() == SignalServiceGroup.Type.UPDATE && groupInfo.getName().isPresent()) {
System.out.println(" Name: " + groupInfo.getName().get()); System.out.println(" Name: " + groupInfo.getName().get());
} else { } else {
GroupInfo group = m.getGroup(groupInfo.getGroupId()); GroupInfo group = m.getGroup(groupInfo.getGroupId());