Print message expiration time in listGroups command

This commit is contained in:
AsamK 2021-08-22 16:53:01 +02:00
parent e3752e733a
commit a7c9995655

View file

@ -58,7 +58,7 @@ public class ListGroupsCommand implements JsonRpcLocalCommand {
final var groupInviteLink = group.getGroupInviteLink(); final var groupInviteLink = group.getGroupInviteLink();
writer.println( writer.println(
"Id: {} Name: {} Description: {} Active: {} Blocked: {} Members: {} Pending members: {} Requesting members: {} Admins: {} Link: {}", "Id: {} Name: {} Description: {} Active: {} Blocked: {} Members: {} Pending members: {} Requesting members: {} Admins: {} Message expiration: {} Link: {}",
group.getGroupId().toBase64(), group.getGroupId().toBase64(),
group.getTitle(), group.getTitle(),
group.getDescription(), group.getDescription(),
@ -68,6 +68,7 @@ public class ListGroupsCommand implements JsonRpcLocalCommand {
resolveMembers(m, group.getPendingMembers()), resolveMembers(m, group.getPendingMembers()),
resolveMembers(m, group.getRequestingMembers()), resolveMembers(m, group.getRequestingMembers()),
resolveMembers(m, group.getAdminMembers()), resolveMembers(m, group.getAdminMembers()),
group.getMessageExpirationTime() == 0 ? "disabled" : group.getMessageExpirationTime() + "s",
groupInviteLink == null ? '-' : groupInviteLink.getUrl()); groupInviteLink == null ? '-' : groupInviteLink.getUrl());
} else { } else {
writer.println("Id: {} Name: {} Active: {} Blocked: {}", writer.println("Id: {} Name: {} Active: {} Blocked: {}",
@ -95,6 +96,7 @@ public class ListGroupsCommand implements JsonRpcLocalCommand {
group.getDescription(), group.getDescription(),
group.isMember(m.getSelfRecipientId()), group.isMember(m.getSelfRecipientId()),
group.isBlocked(), group.isBlocked(),
group.getMessageExpirationTime(),
resolveJsonMembers(m, group.getMembers()), resolveJsonMembers(m, group.getMembers()),
resolveJsonMembers(m, group.getPendingMembers()), resolveJsonMembers(m, group.getPendingMembers()),
resolveJsonMembers(m, group.getRequestingMembers()), resolveJsonMembers(m, group.getRequestingMembers()),
@ -119,6 +121,7 @@ public class ListGroupsCommand implements JsonRpcLocalCommand {
public final String description; public final String description;
public final boolean isMember; public final boolean isMember;
public final boolean isBlocked; public final boolean isBlocked;
public final int messageExpirationTime;
public final Set<JsonGroupMember> members; public final Set<JsonGroupMember> members;
public final Set<JsonGroupMember> pendingMembers; public final Set<JsonGroupMember> pendingMembers;
@ -132,6 +135,7 @@ public class ListGroupsCommand implements JsonRpcLocalCommand {
String description, String description,
boolean isMember, boolean isMember,
boolean isBlocked, boolean isBlocked,
final int messageExpirationTime,
Set<JsonGroupMember> members, Set<JsonGroupMember> members,
Set<JsonGroupMember> pendingMembers, Set<JsonGroupMember> pendingMembers,
Set<JsonGroupMember> requestingMembers, Set<JsonGroupMember> requestingMembers,
@ -143,6 +147,7 @@ public class ListGroupsCommand implements JsonRpcLocalCommand {
this.description = description; this.description = description;
this.isMember = isMember; this.isMember = isMember;
this.isBlocked = isBlocked; this.isBlocked = isBlocked;
this.messageExpirationTime = messageExpirationTime;
this.members = members; this.members = members;
this.pendingMembers = pendingMembers; this.pendingMembers = pendingMembers;