List.of(),
Optional.empty(),
Optional.empty(),
+ List.of(),
+ Optional.empty(),
List.of()),
getSingleRecipientIdentifiers(recipients, m.getSelfNumber()).stream()
.map(RecipientIdentifier.class::cast)
targetSentTimestamp,
getSingleRecipientIdentifiers(recipients, m.getSelfNumber()).stream()
.map(RecipientIdentifier.class::cast)
- .collect(Collectors.toSet()));
+ .collect(Collectors.toSet()),
+ false);
checkSendMessageResults(results);
return results.timestamp();
} catch (IOException e) {
List.of(),
Optional.empty(),
Optional.empty(),
+ List.of(),
+ Optional.empty(),
List.of()), Set.of(RecipientIdentifier.NoteToSelf.INSTANCE));
checkSendMessageResults(results);
return results.timestamp();
List.of(),
Optional.empty(),
Optional.empty(),
+ List.of(),
+ Optional.empty(),
List.of()), Set.of(getGroupRecipientIdentifier(groupId)));
checkSendMessageResults(results);
return results.timestamp();
remove,
getSingleRecipientIdentifier(targetAuthor, m.getSelfNumber()),
targetSentTimestamp,
- Set.of(getGroupRecipientIdentifier(groupId)));
+ Set.of(getGroupRecipientIdentifier(groupId)),
+ false);
checkSendMessageResults(results);
return results.timestamp();
} catch (IOException e) {
avatar = nullIfEmpty(avatar);
final var memberIdentifiers = getSingleRecipientIdentifiers(members, m.getSelfNumber());
if (groupId == null) {
- final var results = m.createGroup(name, memberIdentifiers, avatar == null ? null : new File(avatar));
+ final var results = m.createGroup(name, memberIdentifiers, avatar);
updateGroups();
checkGroupSendMessageResults(results.second().timestamp(), results.second().results());
return results.first().serialize();
UpdateGroup.newBuilder()
.withName(name)
.withMembers(memberIdentifiers)
- .withAvatarFile(avatar == null ? null : new File(avatar))
+ .withAvatarFile(avatar)
.build());
if (results != null) {
checkGroupSendMessageResults(results.timestamp(), results.results());
about = nullIfEmpty(about);
aboutEmoji = nullIfEmpty(aboutEmoji);
avatarPath = nullIfEmpty(avatarPath);
- File avatarFile = removeAvatar || avatarPath == null ? null : new File(avatarPath);
+ final var avatarFile = removeAvatar || avatarPath == null ? null : avatarPath;
m.updateProfile(UpdateProfile.newBuilder()
.withGivenName(givenName)
.withFamilyName(familyName)
public void quitGroup() throws Error.Failure {
try {
m.quitGroup(groupId, Set.of());
- } catch (GroupNotFoundException | NotAGroupMemberException e) {
+ } catch (GroupNotFoundException e) {
throw new Error.GroupNotFound(e.getMessage());
+ } catch (NotAGroupMemberException e) {
+ throw new Error.NotAGroupMember(e.getMessage());
} catch (IOException e) {
throw new Error.Failure(e.getMessage());
} catch (LastGroupAdminException e) {
}
private void setGroupAvatar(final String avatar) {
- updateGroup(UpdateGroup.newBuilder().withAvatarFile(new File(avatar)).build());
+ updateGroup(UpdateGroup.newBuilder().withAvatarFile(avatar).build());
}
private void setMessageExpirationTime(final int expirationTime) {