From bdffcffd7aa791449bf7fe4af0084882dfd1425d Mon Sep 17 00:00:00 2001 From: nico Date: Fri, 22 Sep 2017 01:17:40 +0200 Subject: [PATCH] Add getGroupIds() to DBUS getGroupIds() returns a list of group ids (byte arrays) --- src/main/java/org/asamk/Signal.java | 2 ++ src/main/java/org/asamk/signal/Manager.java | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/org/asamk/Signal.java b/src/main/java/org/asamk/Signal.java index ab926d3f..88b15926 100644 --- a/src/main/java/org/asamk/Signal.java +++ b/src/main/java/org/asamk/Signal.java @@ -23,6 +23,8 @@ public interface Signal extends DBusInterface { void setContactName(String number, String name); + List getGroupIds(); + String getGroupName(byte[] groupId); List getGroupMembers(byte[] groupId); diff --git a/src/main/java/org/asamk/signal/Manager.java b/src/main/java/org/asamk/signal/Manager.java index 46c2e64c..51acaf1d 100644 --- a/src/main/java/org/asamk/signal/Manager.java +++ b/src/main/java/org/asamk/signal/Manager.java @@ -818,6 +818,16 @@ class Manager implements Signal { save(); } + @Override + public List getGroupIds() { + List groups = getGroups(); + List ids = new ArrayList(groups.size()); + for (GroupInfo group : groups) { + ids.add(group.groupId); + } + return ids; + } + @Override public String getGroupName(byte[] groupId) { GroupInfo group = getGroup(groupId);