X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/bbdd6a89102f200f284a01a41ac2809c0759ae50..a643609ed2b1875c5f5de96aaf8e30b4f1e35e96:/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java diff --git a/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java b/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java index 8a2320e0..d39da8a3 100644 --- a/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java +++ b/src/main/java/org/asamk/signal/manager/helper/GroupHelper.java @@ -36,6 +36,7 @@ import org.whispersystems.signalservice.api.groupsv2.NotAbleToApplyGroupV2Change import org.whispersystems.signalservice.api.push.SignalServiceAddress; import org.whispersystems.signalservice.api.util.UuidUtil; +import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -47,7 +48,7 @@ import java.util.stream.Collectors; public class GroupHelper { - final static Logger logger = LoggerFactory.getLogger(GroupHelper.class); + private final static Logger logger = LoggerFactory.getLogger(GroupHelper.class); private final ProfileKeyCredentialProvider profileKeyCredentialProvider; @@ -99,7 +100,7 @@ public class GroupHelper { } public GroupInfoV2 createGroupV2( - String name, Collection members, String avatarFile + String name, Collection members, File avatarFile ) throws IOException { final byte[] avatarBytes = readAvatarBytes(avatarFile); final GroupsV2Operations.NewGroup newGroup = buildNewGroupV2(name, members, avatarBytes); @@ -132,7 +133,7 @@ public class GroupHelper { return g; } - private byte[] readAvatarBytes(final String avatarFile) throws IOException { + private byte[] readAvatarBytes(final File avatarFile) throws IOException { final byte[] avatarBytes; try (InputStream avatar = avatarFile == null ? null : new FileInputStream(avatarFile)) { avatarBytes = avatar == null ? null : IOUtils.readFully(avatar); @@ -194,7 +195,7 @@ public class GroupHelper { } public Pair updateGroupV2( - GroupInfoV2 groupInfoV2, String name, String avatarFile + GroupInfoV2 groupInfoV2, String name, File avatarFile ) throws IOException { final GroupSecretParams groupSecretParams = GroupSecretParams.deriveFromMasterKey(groupInfoV2.getMasterKey()); GroupsV2Operations.GroupOperations groupOperations = groupsV2Operations.forGroup(groupSecretParams);