mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Replace switch with if
This commit is contained in:
parent
d4321971e3
commit
1adfd3d6cd
1 changed files with 44 additions and 46 deletions
|
@ -209,8 +209,8 @@ public class GroupHelper {
|
|||
var group = getGroupForUpdating(groupId);
|
||||
final var avatarBytes = readAvatarBytes(avatarFile);
|
||||
|
||||
switch (group) {
|
||||
case GroupInfoV2 gv2 -> {
|
||||
if(group instanceof GroupInfoV2) {
|
||||
GroupInfoV2 gv2 = (GroupInfoV2) group;
|
||||
try {
|
||||
return updateGroupV2(gv2,
|
||||
name,
|
||||
|
@ -248,9 +248,8 @@ public class GroupHelper {
|
|||
expirationTimer,
|
||||
isAnnouncementGroup);
|
||||
}
|
||||
}
|
||||
|
||||
case GroupInfoV1 gv1 -> {
|
||||
} else if (group instanceof GroupInfoV1) {
|
||||
GroupInfoV1 gv1 = (GroupInfoV1) group;
|
||||
final var result = updateGroupV1(gv1, name, members, avatarBytes);
|
||||
if (expirationTimer != null) {
|
||||
setExpirationTimer(gv1, expirationTimer);
|
||||
|
@ -258,7 +257,6 @@ public class GroupHelper {
|
|||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateGroupProfileKey(GroupIdV2 groupId) throws GroupNotFoundException, NotAGroupMemberException, IOException {
|
||||
var group = getGroupForUpdating(groupId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue