mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-01 20:10:39 +00:00
allow group updates over dbus
This commit is contained in:
parent
bb5677ad7c
commit
f04c0aed99
2 changed files with 21 additions and 1 deletions
|
@ -21,9 +21,11 @@ public interface Signal extends DBusInterface {
|
|||
|
||||
String getContactName(String number);
|
||||
|
||||
String getGroupName(byte[] groupId);
|
||||
|
||||
void setContactName(String number, String name);
|
||||
|
||||
String getGroupName(byte[] groupId);
|
||||
void updateGroup(byte[] groupId, String name, List<String> members, String avatar) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException;
|
||||
|
||||
class MessageReceived extends DBusSignal {
|
||||
private long timestamp;
|
||||
|
|
|
@ -805,6 +805,24 @@ class Manager implements Signal {
|
|||
save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateGroup(byte[] groupId, String name, List<String> members, String avatar) throws IOException, EncapsulatedExceptions, GroupNotFoundException, AttachmentInvalidException {
|
||||
String optName = null;
|
||||
Collection<String> optMembers = null;
|
||||
String optAvatar = null;
|
||||
if(!name.isEmpty()) {
|
||||
optName = name;
|
||||
}
|
||||
if(members.size() > 0) {
|
||||
optMembers = members;
|
||||
}
|
||||
if(!avatar.isEmpty()) {
|
||||
optAvatar = avatar;
|
||||
}
|
||||
System.err.println("sendUpdateGroupMessage(" + Base64.encodeBytes(groupId) + ", " + optName + ", " + optMembers + ", " + optAvatar + ");");
|
||||
sendUpdateGroupMessage(groupId, optName, optMembers, null);
|
||||
}
|
||||
|
||||
private void requestSyncGroups() throws IOException {
|
||||
SignalServiceProtos.SyncMessage.Request r = SignalServiceProtos.SyncMessage.Request.newBuilder().setType(SignalServiceProtos.SyncMessage.Request.Type.GROUPS).build();
|
||||
SignalServiceSyncMessage message = SignalServiceSyncMessage.forRequest(new RequestMessage(r));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue