Пример #1
0
 private Recipients getSyncMessageDestination(TextSecureMessage message) {
   if (message.getGroupInfo().isPresent()) {
     return RecipientFactory.getRecipientsFromString(
         context, GroupUtil.getEncodedId(message.getGroupInfo().get().getGroupId()), false);
   } else {
     return RecipientFactory.getRecipientsFromString(
         context, message.getSyncContext().get().getDestination(), false);
   }
 }
Пример #2
0
  private Pair<Long, Recipients> handlePushOperation(
      byte[] groupId, String groupName, byte[] avatar, Set<String> e164numbers)
      throws InvalidNumberException {
    String groupRecipientId = GroupUtil.getEncodedId(groupId);
    Recipients groupRecipient =
        RecipientFactory.getRecipientsFromString(this, groupRecipientId, false);

    GroupContext context =
        GroupContext.newBuilder()
            .setId(ByteString.copyFrom(groupId))
            .setType(GroupContext.Type.UPDATE)
            .setName(groupName)
            .addAllMembers(e164numbers)
            .build();

    OutgoingGroupMediaMessage outgoingMessage =
        new OutgoingGroupMediaMessage(this, groupRecipient, context, avatar);
    long threadId = MessageSender.send(this, masterSecret, outgoingMessage, -1, false);

    return new Pair<>(threadId, groupRecipient);
  }