Implement more methods for DbusManagerImpl

This commit is contained in:
AsamK 2021-12-11 19:59:34 +01:00
parent 4f50668fe3
commit d248f249e3
5 changed files with 49 additions and 7 deletions

View file

@ -562,6 +562,7 @@ public class DbusSignalImpl implements Signal {
final var memberIdentifiers = getSingleRecipientIdentifiers(members, m.getSelfNumber());
if (groupId == null) {
final var results = m.createGroup(name, memberIdentifiers, avatar == null ? null : new File(avatar));
updateGroups();
checkSendMessageResults(results.second().timestamp(), results.second().results());
return results.first().serialize();
} else {
@ -1152,6 +1153,16 @@ public class DbusSignalImpl implements Signal {
}
}
@Override
public void deleteGroup() throws Error.Failure, Error.LastGroupAdmin {
try {
m.deleteGroup(groupId);
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
}
updateGroups();
}
@Override
public void addMembers(final List<String> recipients) throws Error.Failure {
final var memberIdentifiers = getSingleRecipientIdentifiers(recipients, m.getSelfNumber());