use of org.thoughtcrime.securesms.database.GroupDatabase in project Signal-Android by WhisperSystems.
the class GroupManager method updateGroup.
public static GroupActionResult updateGroup(@NonNull Context context, @NonNull MasterSecret masterSecret, @NonNull byte[] groupId, @NonNull Set<Recipient> members, @Nullable Bitmap avatar, @Nullable String name) throws InvalidNumberException {
final GroupDatabase groupDatabase = DatabaseFactory.getGroupDatabase(context);
final Set<String> memberE164Numbers = getE164Numbers(context, members);
final byte[] avatarBytes = BitmapUtil.toByteArray(avatar);
memberE164Numbers.add(TextSecurePreferences.getLocalNumber(context));
groupDatabase.updateMembers(groupId, new LinkedList<>(memberE164Numbers));
groupDatabase.updateTitle(groupId, name);
groupDatabase.updateAvatar(groupId, avatarBytes);
return sendGroupUpdate(context, masterSecret, groupId, memberE164Numbers, name, avatarBytes);
}
Aggregations