DBus methods

implement expanded updateGroup

allow group commands to use Base64 strings as group identifiers
* setGroupBlocked
* getGroupName
* getGroupMembers
* sendGroupMessage
* sendGroupMessageReaction
* updateGroup

update AvatarStore to make some methods public or static

reuse UpdateGroupCommand code

update DBus documentation
This commit is contained in:
John Freed 2021-08-15 09:41:29 +02:00
parent 908deb43c5
commit 76406367ea
5 changed files with 466 additions and 59 deletions

View file

@ -14,7 +14,7 @@ import java.nio.file.Files;
public class AvatarStore {
private final File avatarsPath;
private static File avatarsPath = null;
public AvatarStore(final File avatarsPath) {
this.avatarsPath = avatarsPath;
@ -49,7 +49,7 @@ public class AvatarStore {
deleteAvatar(getProfileAvatarFile(address));
}
public void deleteGroupAvatar(GroupId groupId) throws IOException {
public static void deleteGroupAvatar(GroupId groupId) throws IOException {
deleteAvatar(getGroupAvatarFile(groupId));
}
@ -67,13 +67,13 @@ public class AvatarStore {
}
}
private void deleteAvatar(final File avatarFile) throws IOException {
private static void deleteAvatar(final File avatarFile) throws IOException {
if (avatarFile.exists()) {
Files.delete(avatarFile.toPath());
}
}
private File getGroupAvatarFile(GroupId groupId) {
private static File getGroupAvatarFile(GroupId groupId) {
return new File(avatarsPath, "group-" + groupId.toBase64().replace("/", "_"));
}