- ) throws IOException, UntrustedIdentityException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException {
- for (final var recipient : recipients) {
- if (recipient instanceof RecipientIdentifier.Single) {
- signal.sendTyping(((RecipientIdentifier.Single) recipient).getIdentifier(),
- action == TypingAction.STOP);
- } else if (recipient instanceof RecipientIdentifier.Group) {
- throw new UnsupportedOperationException();
- }
- }
+ ) throws IOException, NotAGroupMemberException, GroupNotFoundException, GroupSendingNotAllowedException {
+ return handleMessage(recipients, numbers -> {
+ numbers.forEach(n -> signal.sendTyping(n, action == TypingAction.STOP));
+ return 0L;
+ }, () -> {
+ signal.sendTyping(signal.getSelfNumber(), action == TypingAction.STOP);
+ return 0L;
+ }, groupId -> {
+ throw new UnsupportedOperationException();
+ });