Implement announcement groups

This commit is contained in:
AsamK 2021-08-22 09:55:53 +02:00
parent b745f1f902
commit 610e32aa52
5 changed files with 38 additions and 7 deletions

View file

@ -70,6 +70,9 @@ public class UpdateGroupCommand implements DbusCommand, JsonRpcLocalCommand {
subparser.addArgument("--set-permission-edit-details")
.help("Set permission to edit group details")
.choices("every-member", "only-admins");
subparser.addArgument("--set-permission-send-messages")
.help("Set permission to send messages")
.choices("every-member", "only-admins");
subparser.addArgument("-e", "--expiration").type(int.class).help("Set expiration time of messages (seconds)");
}
@ -133,6 +136,7 @@ public class UpdateGroupCommand implements DbusCommand, JsonRpcLocalCommand {
var groupExpiration = ns.getInt("expiration");
var groupAddMemberPermission = getGroupPermission(ns.getString("set-permission-add-member"));
var groupEditDetailsPermission = getGroupPermission(ns.getString("set-permission-edit-details"));
var groupSendMessagesPermission = getGroupPermission(ns.getString("set-permission-send-messages"));
try {
boolean isNewGroup = false;
@ -160,7 +164,10 @@ public class UpdateGroupCommand implements DbusCommand, JsonRpcLocalCommand {
groupAddMemberPermission,
groupEditDetailsPermission,
groupAvatar == null ? null : new File(groupAvatar),
groupExpiration);
groupExpiration,
groupSendMessagesPermission == null
? null
: groupSendMessagesPermission == GroupPermission.ONLY_ADMINS);
Long timestamp = null;
if (results != null) {
timestamp = results.first();

View file

@ -358,6 +358,7 @@ public class DbusSignalImpl implements Signal {
null,
null,
avatar == null ? null : new File(avatar),
null,
null);
if (results != null) {
checkSendMessageResults(results.first(), results.second());