mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Implement setting expiration timer for groups
This commit is contained in:
parent
03589f858b
commit
7170a68571
4 changed files with 48 additions and 17 deletions
|
@ -54,6 +54,8 @@ public class UpdateGroupCommand implements DbusCommand, LocalCommand {
|
|||
subparser.addArgument("--link")
|
||||
.help("Set group link state, with or without admin approval")
|
||||
.type(Arguments.enumStringType(GroupLinkState.class));
|
||||
|
||||
subparser.addArgument("-e", "--expiration").type(int.class).help("Set expiration time of messages (seconds)");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -87,6 +89,8 @@ public class UpdateGroupCommand implements DbusCommand, LocalCommand {
|
|||
|
||||
var groupLinkState = ns.<GroupLinkState>get("link");
|
||||
|
||||
var groupExpiration = ns.getInt("expiration");
|
||||
|
||||
try {
|
||||
if (groupId == null) {
|
||||
var results = m.createGroup(groupName,
|
||||
|
@ -105,7 +109,8 @@ public class UpdateGroupCommand implements DbusCommand, LocalCommand {
|
|||
groupRemoveAdmins,
|
||||
groupResetLink,
|
||||
groupLinkState != null ? groupLinkState.toLinkState() : null,
|
||||
groupAvatar == null ? null : new File(groupAvatar));
|
||||
groupAvatar == null ? null : new File(groupAvatar),
|
||||
groupExpiration);
|
||||
ErrorUtils.handleTimestampAndSendMessageResults(writer, results.first(), results.second());
|
||||
}
|
||||
} catch (AttachmentInvalidException e) {
|
||||
|
|
|
@ -349,7 +349,8 @@ public class DbusSignalImpl implements Signal {
|
|||
null,
|
||||
false,
|
||||
null,
|
||||
avatar == null ? null : new File(avatar));
|
||||
avatar == null ? null : new File(avatar),
|
||||
null);
|
||||
checkSendMessageResults(results.first(), results.second());
|
||||
return groupId;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue