Add getGroupIds() to DBUS

getGroupIds() returns a list of group ids (byte arrays)
This commit is contained in:
nico 2017-09-22 01:17:40 +02:00 committed by AsamK
parent 86f5c9947b
commit bdffcffd7a
2 changed files with 12 additions and 0 deletions

View file

@ -23,6 +23,8 @@ public interface Signal extends DBusInterface {
void setContactName(String number, String name); void setContactName(String number, String name);
List<byte[]> getGroupIds();
String getGroupName(byte[] groupId); String getGroupName(byte[] groupId);
List<String> getGroupMembers(byte[] groupId); List<String> getGroupMembers(byte[] groupId);

View file

@ -818,6 +818,16 @@ class Manager implements Signal {
save(); save();
} }
@Override
public List<byte[]> getGroupIds() {
List<GroupInfo> groups = getGroups();
List<byte[]> ids = new ArrayList<byte[]>(groups.size());
for (GroupInfo group : groups) {
ids.add(group.groupId);
}
return ids;
}
@Override @Override
public String getGroupName(byte[] groupId) { public String getGroupName(byte[] groupId) {
GroupInfo group = getGroup(groupId); GroupInfo group = getGroup(groupId);