Improve handling of membership changes during a GV1->GV2 migration.
This commit is contained in:
parent
d4748efd42
commit
3804a89619
16 changed files with 241 additions and 75 deletions
|
@ -14,6 +14,7 @@ import org.thoughtcrime.securesms.conversation.ConversationMessage;
|
||||||
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
|
import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
|
||||||
import org.thoughtcrime.securesms.groups.GroupId;
|
import org.thoughtcrime.securesms.groups.GroupId;
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.linkpreview.LinkPreview;
|
import org.thoughtcrime.securesms.linkpreview.LinkPreview;
|
||||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
|
@ -59,7 +60,7 @@ public interface BindableConversationItem extends Unbindable {
|
||||||
void onVoiceNotePause(@NonNull Uri uri);
|
void onVoiceNotePause(@NonNull Uri uri);
|
||||||
void onVoiceNotePlay(@NonNull Uri uri, long messageId, double position);
|
void onVoiceNotePlay(@NonNull Uri uri, long messageId, double position);
|
||||||
void onVoiceNoteSeekTo(@NonNull Uri uri, double position);
|
void onVoiceNoteSeekTo(@NonNull Uri uri, double position);
|
||||||
void onGroupMigrationLearnMoreClicked(@NonNull List<RecipientId> pendingRecipients);
|
void onGroupMigrationLearnMoreClicked(@NonNull GroupMigrationMembershipChange membershipChange);
|
||||||
void onJoinGroupCallClicked();
|
void onJoinGroupCallClicked();
|
||||||
|
|
||||||
/** @return true if handled, false if you want to let the normal url handling continue */
|
/** @return true if handled, false if you want to let the normal url handling continue */
|
||||||
|
|
|
@ -89,6 +89,7 @@ import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
|
import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
import org.thoughtcrime.securesms.groups.GroupId;
|
import org.thoughtcrime.securesms.groups.GroupId;
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.groups.ui.migration.GroupsV1MigrationInfoBottomSheetDialogFragment;
|
import org.thoughtcrime.securesms.groups.ui.migration.GroupsV1MigrationInfoBottomSheetDialogFragment;
|
||||||
import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
|
import org.thoughtcrime.securesms.jobs.DirectoryRefreshJob;
|
||||||
import org.thoughtcrime.securesms.jobs.MultiDeviceViewOnceOpenJob;
|
import org.thoughtcrime.securesms.jobs.MultiDeviceViewOnceOpenJob;
|
||||||
|
@ -1416,8 +1417,8 @@ public class ConversationFragment extends LoggingFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGroupMigrationLearnMoreClicked(@NonNull List<RecipientId> pendingRecipients) {
|
public void onGroupMigrationLearnMoreClicked(@NonNull GroupMigrationMembershipChange membershipChange) {
|
||||||
GroupsV1MigrationInfoBottomSheetDialogFragment.showForLearnMore(requireFragmentManager(), pendingRecipients);
|
GroupsV1MigrationInfoBottomSheetDialogFragment.show(requireFragmentManager(), membershipChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -178,7 +178,7 @@ public final class ConversationUpdateItem extends LinearLayout
|
||||||
actionButton.setVisibility(VISIBLE);
|
actionButton.setVisibility(VISIBLE);
|
||||||
actionButton.setOnClickListener(v -> {
|
actionButton.setOnClickListener(v -> {
|
||||||
if (batchSelected.isEmpty() && eventListener != null) {
|
if (batchSelected.isEmpty() && eventListener != null) {
|
||||||
eventListener.onGroupMigrationLearnMoreClicked(conversationMessage.getMessageRecord().getGroupV1MigrationEventInvites());
|
eventListener.onGroupMigrationLearnMoreClicked(conversationMessage.getMessageRecord().getGroupV1MigrationMembershipChanges());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (conversationMessage.getMessageRecord().isGroupCall()) {
|
} else if (conversationMessage.getMessageRecord().isGroupCall()) {
|
||||||
|
|
|
@ -24,11 +24,13 @@ import org.signal.zkgroup.groups.GroupMasterKey;
|
||||||
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper;
|
import org.thoughtcrime.securesms.database.helpers.SQLCipherOpenHelper;
|
||||||
import org.thoughtcrime.securesms.groups.GroupAccessControl;
|
import org.thoughtcrime.securesms.groups.GroupAccessControl;
|
||||||
import org.thoughtcrime.securesms.groups.GroupId;
|
import org.thoughtcrime.securesms.groups.GroupId;
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.logging.Log;
|
import org.thoughtcrime.securesms.logging.Log;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||||
import org.thoughtcrime.securesms.tracing.Trace;
|
import org.thoughtcrime.securesms.tracing.Trace;
|
||||||
import org.thoughtcrime.securesms.util.CursorUtil;
|
import org.thoughtcrime.securesms.util.CursorUtil;
|
||||||
|
import org.thoughtcrime.securesms.util.SetUtil;
|
||||||
import org.thoughtcrime.securesms.util.SqlUtil;
|
import org.thoughtcrime.securesms.util.SqlUtil;
|
||||||
import org.thoughtcrime.securesms.util.Util;
|
import org.thoughtcrime.securesms.util.Util;
|
||||||
import org.whispersystems.libsignal.util.guava.Optional;
|
import org.whispersystems.libsignal.util.guava.Optional;
|
||||||
|
@ -486,11 +488,12 @@ public final class GroupDatabase extends Database {
|
||||||
* Migrates a V1 group to a V2 group.
|
* Migrates a V1 group to a V2 group.
|
||||||
*
|
*
|
||||||
* @param decryptedGroup The state that represents the group on the server. This will be used to
|
* @param decryptedGroup The state that represents the group on the server. This will be used to
|
||||||
* determine if we need to save our old membership list and stuff. It will
|
* determine if we need to save our old membership list and stuff.
|
||||||
* *not* be stored as the definitive group state as-is. In order to ensure
|
|
||||||
* proper diffing, we modify this model to have our V1 membership.
|
|
||||||
*/
|
*/
|
||||||
public @NonNull GroupId.V2 migrateToV2(@NonNull GroupId.V1 groupIdV1, @NonNull DecryptedGroup decryptedGroup) {
|
public @NonNull GroupId.V2 migrateToV2(long threadId,
|
||||||
|
@NonNull GroupId.V1 groupIdV1,
|
||||||
|
@NonNull DecryptedGroup decryptedGroup)
|
||||||
|
{
|
||||||
SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
SQLiteDatabase db = databaseHelper.getWritableDatabase();
|
||||||
GroupId.V2 groupIdV2 = groupIdV1.deriveV2MigrationGroupId();
|
GroupId.V2 groupIdV2 = groupIdV1.deriveV2MigrationGroupId();
|
||||||
GroupMasterKey groupMasterKey = groupIdV1.deriveV2MigrationMasterKey();
|
GroupMasterKey groupMasterKey = groupIdV1.deriveV2MigrationMasterKey();
|
||||||
|
@ -504,10 +507,13 @@ public final class GroupDatabase extends Database {
|
||||||
contentValues.put(V2_MASTER_KEY, groupMasterKey.serialize());
|
contentValues.put(V2_MASTER_KEY, groupMasterKey.serialize());
|
||||||
contentValues.putNull(EXPECTED_V2_ID);
|
contentValues.putNull(EXPECTED_V2_ID);
|
||||||
|
|
||||||
List<RecipientId> newMembers = Stream.of(DecryptedGroupUtil.membersToUuidList(decryptedGroup.getMembersList())).map(u -> RecipientId.from(u, null)).toList();
|
List<RecipientId> newMembers = Stream.of(DecryptedGroupUtil.membersToUuidList(decryptedGroup.getMembersList())).map(u -> RecipientId.from(u, null)).toList();
|
||||||
newMembers.addAll(Stream.of(DecryptedGroupUtil.pendingToUuidList(decryptedGroup.getPendingMembersList())).map(u -> RecipientId.from(u, null)).toList());
|
List<RecipientId> pendingMembers = Stream.of(DecryptedGroupUtil.pendingToUuidList(decryptedGroup.getPendingMembersList())).map(u -> RecipientId.from(u, null)).toList();
|
||||||
|
List<RecipientId> droppedMembers = new ArrayList<>(SetUtil.difference(record.getMembers(), newMembers));
|
||||||
|
|
||||||
if (record.getMembers().size() > newMembers.size() || !newMembers.containsAll(record.getMembers())) {
|
newMembers.addAll(pendingMembers);
|
||||||
|
|
||||||
|
if (droppedMembers.size() > 0) {
|
||||||
contentValues.put(FORMER_V1_MEMBERS, RecipientId.toSerializedList(record.getMembers()));
|
contentValues.put(FORMER_V1_MEMBERS, RecipientId.toSerializedList(record.getMembers()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -519,7 +525,11 @@ public final class GroupDatabase extends Database {
|
||||||
|
|
||||||
DatabaseFactory.getRecipientDatabase(context).updateGroupId(groupIdV1, groupIdV2);
|
DatabaseFactory.getRecipientDatabase(context).updateGroupId(groupIdV1, groupIdV2);
|
||||||
|
|
||||||
update(groupMasterKey, updateToHaveV1Membership(decryptedGroup, record.getMembers()));
|
update(groupMasterKey, decryptedGroup);
|
||||||
|
|
||||||
|
DatabaseFactory.getSmsDatabase(context).insertGroupV1MigrationEvents(record.getRecipientId(),
|
||||||
|
threadId,
|
||||||
|
new GroupMigrationMembershipChange(pendingMembers, droppedMembers));
|
||||||
|
|
||||||
db.setTransactionSuccessful();
|
db.setTransactionSuccessful();
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -529,23 +539,6 @@ public final class GroupDatabase extends Database {
|
||||||
return groupIdV2;
|
return groupIdV2;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DecryptedGroup updateToHaveV1Membership(@NonNull DecryptedGroup serverGroup, @NonNull List<RecipientId> v1Members) {
|
|
||||||
DecryptedGroup.Builder builder = serverGroup.toBuilder();
|
|
||||||
builder.clearMembers();
|
|
||||||
|
|
||||||
for (RecipientId v1MemberId : v1Members) {
|
|
||||||
Recipient v1Member = Recipient.resolved(v1MemberId);
|
|
||||||
if (v1Member.hasUuid()) {
|
|
||||||
builder.addMembers(DecryptedMember.newBuilder()
|
|
||||||
.setUuid(UuidUtil.toByteString(v1Member.getUuid().get()))
|
|
||||||
.setRole(Member.Role.ADMINISTRATOR)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return builder.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update(@NonNull GroupMasterKey groupMasterKey, @NonNull DecryptedGroup decryptedGroup) {
|
public void update(@NonNull GroupMasterKey groupMasterKey, @NonNull DecryptedGroup decryptedGroup) {
|
||||||
update(GroupId.v2(groupMasterKey), decryptedGroup);
|
update(GroupId.v2(groupMasterKey), decryptedGroup);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.ReactionRecord;
|
import org.thoughtcrime.securesms.database.model.ReactionRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.SmsMessageRecord;
|
import org.thoughtcrime.securesms.database.model.SmsMessageRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.ReactionList;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.ReactionList;
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.insights.InsightsConstants;
|
import org.thoughtcrime.securesms.insights.InsightsConstants;
|
||||||
import org.thoughtcrime.securesms.logging.Log;
|
import org.thoughtcrime.securesms.logging.Log;
|
||||||
import org.thoughtcrime.securesms.mms.IncomingMediaMessage;
|
import org.thoughtcrime.securesms.mms.IncomingMediaMessage;
|
||||||
|
@ -148,7 +149,7 @@ public abstract class MessageDatabase extends Database implements MmsSmsColumns
|
||||||
public abstract long insertMessageOutbox(@NonNull OutgoingMediaMessage message, long threadId, boolean forceSms, @Nullable SmsDatabase.InsertListener insertListener) throws MmsException;
|
public abstract long insertMessageOutbox(@NonNull OutgoingMediaMessage message, long threadId, boolean forceSms, @Nullable SmsDatabase.InsertListener insertListener) throws MmsException;
|
||||||
public abstract long insertMessageOutbox(@NonNull OutgoingMediaMessage message, long threadId, boolean forceSms, int defaultReceiptStatus, @Nullable SmsDatabase.InsertListener insertListener) throws MmsException;
|
public abstract long insertMessageOutbox(@NonNull OutgoingMediaMessage message, long threadId, boolean forceSms, int defaultReceiptStatus, @Nullable SmsDatabase.InsertListener insertListener) throws MmsException;
|
||||||
public abstract void insertProfileNameChangeMessages(@NonNull Recipient recipient, @NonNull String newProfileName, @NonNull String previousProfileName);
|
public abstract void insertProfileNameChangeMessages(@NonNull Recipient recipient, @NonNull String newProfileName, @NonNull String previousProfileName);
|
||||||
public abstract void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId, long threadId, List<RecipientId> pendingRecipients);
|
public abstract void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId, long threadId, @NonNull GroupMigrationMembershipChange membershipChange);
|
||||||
|
|
||||||
public abstract boolean deleteMessage(long messageId);
|
public abstract boolean deleteMessage(long messageId);
|
||||||
abstract void deleteThread(long threadId);
|
abstract void deleteThread(long threadId);
|
||||||
|
|
|
@ -54,6 +54,7 @@ import org.thoughtcrime.securesms.database.model.ReactionRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.SmsMessageRecord;
|
import org.thoughtcrime.securesms.database.model.SmsMessageRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.BodyRangeList;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.BodyRangeList;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.jobs.TrimThreadJob;
|
import org.thoughtcrime.securesms.jobs.TrimThreadJob;
|
||||||
import org.thoughtcrime.securesms.linkpreview.LinkPreview;
|
import org.thoughtcrime.securesms.linkpreview.LinkPreview;
|
||||||
import org.thoughtcrime.securesms.logging.Log;
|
import org.thoughtcrime.securesms.logging.Log;
|
||||||
|
@ -494,7 +495,10 @@ public class MmsDatabase extends MessageDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId, long threadId, List<RecipientId> pendingRecipients) {
|
public void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId,
|
||||||
|
long threadId,
|
||||||
|
@NonNull GroupMigrationMembershipChange membershipChange)
|
||||||
|
{
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ import org.thoughtcrime.securesms.database.model.SmsMessageRecord;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.GroupCallUpdateDetails;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.GroupCallUpdateDetails;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.ProfileChangeDetails;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.ProfileChangeDetails;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.jobs.TrimThreadJob;
|
import org.thoughtcrime.securesms.jobs.TrimThreadJob;
|
||||||
import org.thoughtcrime.securesms.logging.Log;
|
import org.thoughtcrime.securesms.logging.Log;
|
||||||
import org.thoughtcrime.securesms.mms.IncomingMediaMessage;
|
import org.thoughtcrime.securesms.mms.IncomingMediaMessage;
|
||||||
|
@ -72,7 +73,6 @@ import java.util.Collections;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
|
@ -862,11 +862,14 @@ public class SmsDatabase extends MessageDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId, long threadId, @NonNull List<RecipientId> pendingRecipients) {
|
public void insertGroupV1MigrationEvents(@NonNull RecipientId recipientId,
|
||||||
|
long threadId,
|
||||||
|
@NonNull GroupMigrationMembershipChange membershipChange)
|
||||||
|
{
|
||||||
insertGroupV1MigrationNotification(recipientId, threadId);
|
insertGroupV1MigrationNotification(recipientId, threadId);
|
||||||
|
|
||||||
if (pendingRecipients.size() > 0) {
|
if (!membershipChange.isEmpty()) {
|
||||||
insertGroupV1MigrationEvent(recipientId, threadId, pendingRecipients);
|
insertGroupV1MigrationMembershipChanges(recipientId, threadId, membershipChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
notifyConversationListeners(threadId);
|
notifyConversationListeners(threadId);
|
||||||
|
@ -874,10 +877,13 @@ public class SmsDatabase extends MessageDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertGroupV1MigrationNotification(@NonNull RecipientId recipientId, long threadId) {
|
private void insertGroupV1MigrationNotification(@NonNull RecipientId recipientId, long threadId) {
|
||||||
insertGroupV1MigrationEvent(recipientId, threadId, Collections.emptyList());
|
insertGroupV1MigrationMembershipChanges(recipientId, threadId, GroupMigrationMembershipChange.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertGroupV1MigrationEvent(@NonNull RecipientId recipientId, long threadId, @NonNull List<RecipientId> pendingRecipients) {
|
private void insertGroupV1MigrationMembershipChanges(@NonNull RecipientId recipientId,
|
||||||
|
long threadId,
|
||||||
|
@NonNull GroupMigrationMembershipChange membershipChange)
|
||||||
|
{
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
values.put(RECIPIENT_ID, recipientId.serialize());
|
values.put(RECIPIENT_ID, recipientId.serialize());
|
||||||
values.put(ADDRESS_DEVICE_ID, 1);
|
values.put(ADDRESS_DEVICE_ID, 1);
|
||||||
|
@ -887,8 +893,8 @@ public class SmsDatabase extends MessageDatabase {
|
||||||
values.put(TYPE, Types.GV1_MIGRATION_TYPE);
|
values.put(TYPE, Types.GV1_MIGRATION_TYPE);
|
||||||
values.put(THREAD_ID, threadId);
|
values.put(THREAD_ID, threadId);
|
||||||
|
|
||||||
if (pendingRecipients.size() > 0) {
|
if (!membershipChange.isEmpty()) {
|
||||||
values.put(BODY, RecipientId.toSerializedList(pendingRecipients));
|
values.put(BODY, membershipChange.serialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
databaseHelper.getWritableDatabase().insert(TABLE_NAME, null, values);
|
databaseHelper.getWritableDatabase().insert(TABLE_NAME, null, values);
|
||||||
|
|
|
@ -39,6 +39,7 @@ import org.thoughtcrime.securesms.database.documents.NetworkFailure;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.DecryptedGroupV2Context;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.DecryptedGroupV2Context;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.GroupCallUpdateDetails;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.GroupCallUpdateDetails;
|
||||||
import org.thoughtcrime.securesms.database.model.databaseprotos.ProfileChangeDetails;
|
import org.thoughtcrime.securesms.database.model.databaseprotos.ProfileChangeDetails;
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.logging.Log;
|
import org.thoughtcrime.securesms.logging.Log;
|
||||||
import org.thoughtcrime.securesms.profiles.ProfileName;
|
import org.thoughtcrime.securesms.profiles.ProfileName;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
|
@ -54,6 +55,7 @@ import org.whispersystems.signalservice.api.groupsv2.DecryptedGroupUtil;
|
||||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
@ -186,12 +188,7 @@ public abstract class MessageRecord extends DisplayRecord {
|
||||||
if (isOutgoing()) return staticUpdateDescription(context.getString(R.string.SmsMessageRecord_secure_session_reset), R.drawable.ic_update_info_16);
|
if (isOutgoing()) return staticUpdateDescription(context.getString(R.string.SmsMessageRecord_secure_session_reset), R.drawable.ic_update_info_16);
|
||||||
else return fromRecipient(getIndividualRecipient(), r-> context.getString(R.string.SmsMessageRecord_secure_session_reset_s, r.getDisplayName(context)), R.drawable.ic_update_info_16);
|
else return fromRecipient(getIndividualRecipient(), r-> context.getString(R.string.SmsMessageRecord_secure_session_reset_s, r.getDisplayName(context)), R.drawable.ic_update_info_16);
|
||||||
} else if (isGroupV1MigrationEvent()) {
|
} else if (isGroupV1MigrationEvent()) {
|
||||||
if (Util.isEmpty(getBody())) {
|
return getGroupMigrationEventDescription(context);
|
||||||
return staticUpdateDescription(context.getString(R.string.MessageRecord_this_group_was_updated_to_a_new_group), R.drawable.ic_update_group_role_16);
|
|
||||||
} else {
|
|
||||||
int count = getGroupV1MigrationEventInvites().size();
|
|
||||||
return staticUpdateDescription(context.getResources().getQuantityString(R.plurals.MessageRecord_members_couldnt_be_added_to_the_new_group_and_have_been_invited, count, count), R.drawable.ic_update_group_add_16);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -288,6 +285,30 @@ public abstract class MessageRecord extends DisplayRecord {
|
||||||
return context.getString(R.string.MessageRecord_changed_their_profile, getIndividualRecipient().getDisplayName(context));
|
return context.getString(R.string.MessageRecord_changed_their_profile, getIndividualRecipient().getDisplayName(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private UpdateDescription getGroupMigrationEventDescription(@NonNull Context context) {
|
||||||
|
if (Util.isEmpty(getBody())) {
|
||||||
|
return staticUpdateDescription(context.getString(R.string.MessageRecord_this_group_was_updated_to_a_new_group), R.drawable.ic_update_group_role_16);
|
||||||
|
} else {
|
||||||
|
GroupMigrationMembershipChange change = getGroupV1MigrationMembershipChanges();
|
||||||
|
List<UpdateDescription> updates = new ArrayList<>(2);
|
||||||
|
|
||||||
|
if (change.getPending().size() == 1 && change.getPending().get(0).equals(Recipient.self().getId())) {
|
||||||
|
updates.add(staticUpdateDescription(context.getString(R.string.MessageRecord_you_couldnt_be_added_to_the_new_group_and_have_been_invited_to_join), R.drawable.ic_update_group_add_16));
|
||||||
|
} else if (change.getPending().size() > 0) {
|
||||||
|
int count = change.getPending().size();
|
||||||
|
updates.add(staticUpdateDescription(context.getResources().getQuantityString(R.plurals.MessageRecord_members_couldnt_be_added_to_the_new_group_and_have_been_invited, count, count), R.drawable.ic_update_group_add_16));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (change.getDropped().size() > 0) {
|
||||||
|
int count = change.getDropped().size();
|
||||||
|
updates.add(staticUpdateDescription(context.getResources().getQuantityString(R.plurals.MessageRecord_members_couldnt_be_added_to_the_new_group_and_have_been_removed, count, count), R.drawable.ic_update_group_remove_16));
|
||||||
|
}
|
||||||
|
|
||||||
|
return UpdateDescription.concatWithNewLines(updates);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static @NonNull UpdateDescription getGroupCallUpdateDescription(@NonNull Context context, @NonNull String body) {
|
public static @NonNull UpdateDescription getGroupCallUpdateDescription(@NonNull Context context, @NonNull String body) {
|
||||||
GroupCallUpdateDetails groupCallUpdateDetails = GroupCallUpdateDetailsUtil.parse(body);
|
GroupCallUpdateDetails groupCallUpdateDetails = GroupCallUpdateDetailsUtil.parse(body);
|
||||||
|
|
||||||
|
@ -380,11 +401,11 @@ public abstract class MessageRecord extends DisplayRecord {
|
||||||
return SmsDatabase.Types.isGroupV1MigrationEvent(type);
|
return SmsDatabase.Types.isGroupV1MigrationEvent(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public @NonNull List<RecipientId> getGroupV1MigrationEventInvites() {
|
public @NonNull GroupMigrationMembershipChange getGroupV1MigrationMembershipChanges() {
|
||||||
if (isGroupV1MigrationEvent()) {
|
if (isGroupV1MigrationEvent()) {
|
||||||
return RecipientId.fromSerializedList(getBody());
|
return GroupMigrationMembershipChange.deserialize(getBody());
|
||||||
} else {
|
} else {
|
||||||
return Collections.emptyList();
|
return GroupMigrationMembershipChange.empty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
package org.thoughtcrime.securesms.groups;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.database.model.MessageRecord;
|
||||||
|
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||||
|
import org.thoughtcrime.securesms.util.StringUtil;
|
||||||
|
import org.thoughtcrime.securesms.util.Util;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Describes a change in membership that results from a GV1->GV2 migration.
|
||||||
|
*/
|
||||||
|
public final class GroupMigrationMembershipChange {
|
||||||
|
private final List<RecipientId> pending;
|
||||||
|
private final List<RecipientId> dropped;
|
||||||
|
|
||||||
|
public GroupMigrationMembershipChange(@NonNull List<RecipientId> pending, @NonNull List<RecipientId> dropped) {
|
||||||
|
this.pending = pending;
|
||||||
|
this.dropped = dropped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GroupMigrationMembershipChange empty() {
|
||||||
|
return new GroupMigrationMembershipChange(Collections.emptyList(), Collections.emptyList());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static @NonNull GroupMigrationMembershipChange deserialize(@Nullable String serialized) {
|
||||||
|
if (Util.isEmpty(serialized)) {
|
||||||
|
return empty();
|
||||||
|
} else {
|
||||||
|
String[] parts = serialized.split("\\|");
|
||||||
|
if (parts.length == 1) {
|
||||||
|
return new GroupMigrationMembershipChange(RecipientId.fromSerializedList(parts[0]), Collections.emptyList());
|
||||||
|
} else if (parts.length == 2) {
|
||||||
|
return new GroupMigrationMembershipChange(RecipientId.fromSerializedList(parts[0]), RecipientId.fromSerializedList(parts[1]));
|
||||||
|
} else {
|
||||||
|
return GroupMigrationMembershipChange.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public @NonNull List<RecipientId> getPending() {
|
||||||
|
return pending;
|
||||||
|
}
|
||||||
|
|
||||||
|
public @NonNull List<RecipientId> getDropped() {
|
||||||
|
return dropped;
|
||||||
|
}
|
||||||
|
|
||||||
|
public @NonNull String serialize() {
|
||||||
|
return RecipientId.toSerializedList(pending) + "|" + RecipientId.toSerializedList(dropped);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty() {
|
||||||
|
return pending.isEmpty() && dropped.isEmpty();
|
||||||
|
}
|
||||||
|
}
|
|
@ -26,6 +26,7 @@ import org.whispersystems.signalservice.api.groupsv2.DecryptedGroupUtil;
|
||||||
|
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.thoughtcrime.securesms.groups.v2.processing.GroupsV2StateProcessor.LATEST;
|
import static org.thoughtcrime.securesms.groups.v2.processing.GroupsV2StateProcessor.LATEST;
|
||||||
|
@ -182,15 +183,8 @@ public final class GroupsV1MigrationUtil {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<RecipientId> pendingRecipients = Stream.of(DecryptedGroupUtil.pendingToUuidList(decryptedGroup.getPendingMembersList()))
|
|
||||||
.map(uuid -> Recipient.externalPush(context, uuid, null, false))
|
|
||||||
.filterNot(Recipient::isSelf)
|
|
||||||
.map(Recipient::getId)
|
|
||||||
.toList();
|
|
||||||
|
|
||||||
Log.i(TAG, "[Local] Migrating group over to the version we were added to: V" + decryptedGroup.getRevision());
|
Log.i(TAG, "[Local] Migrating group over to the version we were added to: V" + decryptedGroup.getRevision());
|
||||||
DatabaseFactory.getGroupDatabase(context).migrateToV2(gv1Id, decryptedGroup);
|
DatabaseFactory.getGroupDatabase(context).migrateToV2(threadId, gv1Id, decryptedGroup);
|
||||||
DatabaseFactory.getSmsDatabase(context).insertGroupV1MigrationEvents(groupRecipient.getId(), threadId, pendingRecipients);
|
|
||||||
|
|
||||||
Log.i(TAG, "[Local] Applying all changes since V" + decryptedGroup.getRevision());
|
Log.i(TAG, "[Local] Applying all changes since V" + decryptedGroup.getRevision());
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -15,13 +15,12 @@ import androidx.lifecycle.ViewModelProviders;
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.groups.ui.GroupMemberListView;
|
import org.thoughtcrime.securesms.groups.ui.GroupMemberListView;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
|
||||||
import org.thoughtcrime.securesms.util.BottomSheetUtil;
|
import org.thoughtcrime.securesms.util.BottomSheetUtil;
|
||||||
import org.thoughtcrime.securesms.util.ThemeUtil;
|
import org.thoughtcrime.securesms.util.ThemeUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,16 +29,19 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public final class GroupsV1MigrationInfoBottomSheetDialogFragment extends BottomSheetDialogFragment {
|
public final class GroupsV1MigrationInfoBottomSheetDialogFragment extends BottomSheetDialogFragment {
|
||||||
|
|
||||||
private static final String KEY_PENDING = "pending";
|
private static final String KEY_MEMBERSHIP_CHANGE = "membership_change";
|
||||||
|
|
||||||
private GroupsV1MigrationInfoViewModel viewModel;
|
private GroupsV1MigrationInfoViewModel viewModel;
|
||||||
private GroupMemberListView pendingList;
|
private GroupMemberListView pendingList;
|
||||||
private TextView pendingTitle;
|
private TextView pendingTitle;
|
||||||
private View pendingContainer;
|
private View pendingContainer;
|
||||||
|
private GroupMemberListView droppedList;
|
||||||
|
private TextView droppedTitle;
|
||||||
|
private View droppedContainer;
|
||||||
|
|
||||||
public static void showForLearnMore(@NonNull FragmentManager manager, @NonNull List<RecipientId> pendingRecipients) {
|
public static void show(@NonNull FragmentManager manager, @NonNull GroupMigrationMembershipChange membershipChange) {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putParcelableArrayList(KEY_PENDING, new ArrayList<>(pendingRecipients));
|
args.putString(KEY_MEMBERSHIP_CHANGE, membershipChange.serialize());
|
||||||
|
|
||||||
GroupsV1MigrationInfoBottomSheetDialogFragment fragment = new GroupsV1MigrationInfoBottomSheetDialogFragment();
|
GroupsV1MigrationInfoBottomSheetDialogFragment fragment = new GroupsV1MigrationInfoBottomSheetDialogFragment();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
|
@ -66,12 +68,16 @@ public final class GroupsV1MigrationInfoBottomSheetDialogFragment extends Bottom
|
||||||
this.pendingContainer = view.findViewById(R.id.gv1_learn_more_pending_container);
|
this.pendingContainer = view.findViewById(R.id.gv1_learn_more_pending_container);
|
||||||
this.pendingTitle = view.findViewById(R.id.gv1_learn_more_pending_title);
|
this.pendingTitle = view.findViewById(R.id.gv1_learn_more_pending_title);
|
||||||
this.pendingList = view.findViewById(R.id.gv1_learn_more_pending_list);
|
this.pendingList = view.findViewById(R.id.gv1_learn_more_pending_list);
|
||||||
|
this.droppedContainer = view.findViewById(R.id.gv1_learn_more_dropped_container);
|
||||||
|
this.droppedTitle = view.findViewById(R.id.gv1_learn_more_dropped_title);
|
||||||
|
this.droppedList = view.findViewById(R.id.gv1_learn_more_dropped_list);
|
||||||
|
|
||||||
//noinspection ConstantConditions
|
//noinspection ConstantConditions
|
||||||
List<RecipientId> pending = getArguments().getParcelableArrayList(KEY_PENDING);
|
GroupMigrationMembershipChange membershipChange = GroupMigrationMembershipChange.deserialize(getArguments().getString(KEY_MEMBERSHIP_CHANGE));
|
||||||
|
|
||||||
this.viewModel = ViewModelProviders.of(this, new GroupsV1MigrationInfoViewModel.Factory(pending)).get(GroupsV1MigrationInfoViewModel.class);
|
this.viewModel = ViewModelProviders.of(this, new GroupsV1MigrationInfoViewModel.Factory(membershipChange)).get(GroupsV1MigrationInfoViewModel.class);
|
||||||
viewModel.getPendingMembers().observe(getViewLifecycleOwner(), this::onPendingMembersChanged);
|
viewModel.getPendingMembers().observe(getViewLifecycleOwner(), this::onPendingMembersChanged);
|
||||||
|
viewModel.getDroppedMembers().observe(getViewLifecycleOwner(), this::onDroppedMembersChanged);
|
||||||
|
|
||||||
view.findViewById(R.id.gv1_learn_more_ok_button).setOnClickListener(v -> dismiss());
|
view.findViewById(R.id.gv1_learn_more_ok_button).setOnClickListener(v -> dismiss());
|
||||||
}
|
}
|
||||||
|
@ -82,7 +88,10 @@ public final class GroupsV1MigrationInfoBottomSheetDialogFragment extends Bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onPendingMembersChanged(@NonNull List<Recipient> pendingMembers) {
|
private void onPendingMembersChanged(@NonNull List<Recipient> pendingMembers) {
|
||||||
if (pendingMembers.size() > 0) {
|
if (pendingMembers.size() == 1 && pendingMembers.get(0).isSelf()) {
|
||||||
|
pendingContainer.setVisibility(View.VISIBLE);
|
||||||
|
pendingTitle.setText(R.string.GroupsV1MigrationLearnMore_you_will_need_to_accept_an_invite_to_join_this_group_again);
|
||||||
|
} else if (pendingMembers.size() > 0) {
|
||||||
pendingContainer.setVisibility(View.VISIBLE);
|
pendingContainer.setVisibility(View.VISIBLE);
|
||||||
pendingTitle.setText(getResources().getQuantityText(R.plurals.GroupsV1MigrationLearnMore_these_members_will_need_to_accept_an_invite, pendingMembers.size()));
|
pendingTitle.setText(getResources().getQuantityText(R.plurals.GroupsV1MigrationLearnMore_these_members_will_need_to_accept_an_invite, pendingMembers.size()));
|
||||||
pendingList.setDisplayOnlyMembers(pendingMembers);
|
pendingList.setDisplayOnlyMembers(pendingMembers);
|
||||||
|
@ -90,4 +99,14 @@ public final class GroupsV1MigrationInfoBottomSheetDialogFragment extends Bottom
|
||||||
pendingContainer.setVisibility(View.GONE);
|
pendingContainer.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onDroppedMembersChanged(@NonNull List<Recipient> droppedMembers) {
|
||||||
|
if (droppedMembers.size() > 0) {
|
||||||
|
droppedContainer.setVisibility(View.VISIBLE);
|
||||||
|
droppedTitle.setText(getResources().getQuantityText(R.plurals.GroupsV1MigrationLearnMore_these_members_were_removed_from_the_group, droppedMembers.size()));
|
||||||
|
droppedList.setDisplayOnlyMembers(droppedMembers);
|
||||||
|
} else {
|
||||||
|
droppedContainer.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import androidx.lifecycle.MutableLiveData;
|
||||||
import androidx.lifecycle.ViewModel;
|
import androidx.lifecycle.ViewModel;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
|
||||||
|
import org.thoughtcrime.securesms.groups.GroupMigrationMembershipChange;
|
||||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||||
import org.thoughtcrime.securesms.util.concurrent.SignalExecutors;
|
import org.thoughtcrime.securesms.util.concurrent.SignalExecutors;
|
||||||
|
@ -15,12 +16,18 @@ import java.util.List;
|
||||||
class GroupsV1MigrationInfoViewModel extends ViewModel {
|
class GroupsV1MigrationInfoViewModel extends ViewModel {
|
||||||
|
|
||||||
private final MutableLiveData<List<Recipient>> pendingMembers;
|
private final MutableLiveData<List<Recipient>> pendingMembers;
|
||||||
|
private final MutableLiveData<List<Recipient>> droppedMembers;
|
||||||
|
|
||||||
private GroupsV1MigrationInfoViewModel(@NonNull List<RecipientId> pendingMembers) {
|
private GroupsV1MigrationInfoViewModel(@NonNull GroupMigrationMembershipChange membershipChange) {
|
||||||
this.pendingMembers = new MutableLiveData<>();
|
this.pendingMembers = new MutableLiveData<>();
|
||||||
|
this.droppedMembers = new MutableLiveData<>();
|
||||||
|
|
||||||
SignalExecutors.BOUNDED.execute(() -> {
|
SignalExecutors.BOUNDED.execute(() -> {
|
||||||
this.pendingMembers.postValue(Recipient.resolvedList(pendingMembers));
|
this.pendingMembers.postValue(Recipient.resolvedList(membershipChange.getPending()));
|
||||||
|
});
|
||||||
|
|
||||||
|
SignalExecutors.BOUNDED.execute(() -> {
|
||||||
|
this.droppedMembers.postValue(Recipient.resolvedList(membershipChange.getDropped()));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,17 +35,21 @@ class GroupsV1MigrationInfoViewModel extends ViewModel {
|
||||||
return pendingMembers;
|
return pendingMembers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull LiveData<List<Recipient>> getDroppedMembers() {
|
||||||
|
return droppedMembers;
|
||||||
|
}
|
||||||
|
|
||||||
static class Factory extends ViewModelProvider.NewInstanceFactory {
|
static class Factory extends ViewModelProvider.NewInstanceFactory {
|
||||||
|
|
||||||
private final List<RecipientId> pendingMembers;
|
private final GroupMigrationMembershipChange membershipChange;
|
||||||
|
|
||||||
Factory(List<RecipientId> pendingMembers) {
|
Factory(@NonNull GroupMigrationMembershipChange membershipChange) {
|
||||||
this.pendingMembers = pendingMembers;
|
this.membershipChange = membershipChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @NonNull<T extends ViewModel> T create(@NonNull Class<T> modelClass) {
|
public @NonNull<T extends ViewModel> T create(@NonNull Class<T> modelClass) {
|
||||||
return modelClass.cast(new GroupsV1MigrationInfoViewModel(pendingMembers));
|
return modelClass.cast(new GroupsV1MigrationInfoViewModel(membershipChange));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,6 +164,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:padding="20dp"
|
||||||
style="@style/Button.Primary"
|
style="@style/Button.Primary"
|
||||||
android:text="@string/GroupsV1MigrationInitiation_upgrade_this_group" />
|
android:text="@string/GroupsV1MigrationInitiation_upgrade_this_group" />
|
||||||
|
|
||||||
|
|
|
@ -118,11 +118,53 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/gv1_learn_more_dropped_container"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="23dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:src="@drawable/paragraph_marker" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="20dp"
|
||||||
|
android:layout_marginEnd="14dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/gv1_learn_more_dropped_title"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:textAppearance="@style/TextAppearance.Signal.Body1"
|
||||||
|
android:textColor="@color/signal_text_primary"
|
||||||
|
tools:text="Plurized string for ineligible members." />
|
||||||
|
|
||||||
|
<org.thoughtcrime.securesms.groups.ui.GroupMemberListView
|
||||||
|
android:id="@+id/gv1_learn_more_dropped_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginStart="-12dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/gv1_learn_more_ok_button"
|
android:id="@+id/gv1_learn_more_ok_button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:padding="20dp"
|
||||||
style="@style/Button.Primary"
|
style="@style/Button.Primary"
|
||||||
android:text="@android:string/ok" />
|
android:text="@android:string/ok" />
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,11 @@
|
||||||
|
|
||||||
<style name="Signal.Widget.Button.Small.Primary" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
<style name="Signal.Widget.Button.Small.Primary" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||||
<item name="android:textAllCaps">false</item>
|
<item name="android:textAllCaps">false</item>
|
||||||
<item name="android:paddingTop">0dp</item>
|
<item name="android:paddingTop">6dp</item>
|
||||||
<item name="android:paddingBottom">0dp</item>
|
<item name="android:paddingBottom">7dp</item>
|
||||||
<item name="android:paddingStart">16dp</item>
|
<item name="android:paddingStart">14dp</item>
|
||||||
<item name="android:paddingEnd">16dp</item>
|
<item name="android:paddingEnd">14dp</item>
|
||||||
|
<item name="android:minHeight">0dp</item>
|
||||||
<item name="android:textSize">13sp</item>
|
<item name="android:textSize">13sp</item>
|
||||||
<item name="android:fontFamily">sans-serif-medium</item>
|
<item name="android:fontFamily">sans-serif-medium</item>
|
||||||
<item name="android:letterSpacing" tools:targetApi="21">0.01</item>
|
<item name="android:letterSpacing" tools:targetApi="21">0.01</item>
|
||||||
|
|
|
@ -564,10 +564,15 @@
|
||||||
<string name="GroupsV1MigrationLearnMore_what_are_new_groups">What are New Groups?</string>
|
<string name="GroupsV1MigrationLearnMore_what_are_new_groups">What are New Groups?</string>
|
||||||
<string name="GroupsV1MigrationLearnMore_new_groups_have_features_like_mentions">New Groups have features like @mentions and group admins, and will support more features in the future.</string>
|
<string name="GroupsV1MigrationLearnMore_new_groups_have_features_like_mentions">New Groups have features like @mentions and group admins, and will support more features in the future.</string>
|
||||||
<string name="GroupsV1MigrationLearnMore_all_message_history_and_media_has_been_kept">All message history and media has been kept from before the upgrade.</string>
|
<string name="GroupsV1MigrationLearnMore_all_message_history_and_media_has_been_kept">All message history and media has been kept from before the upgrade.</string>
|
||||||
|
<string name="GroupsV1MigrationLearnMore_you_will_need_to_accept_an_invite_to_join_this_group_again">You will need to accept an invite to join this group again, and will not receive group messages until you accept.</string>
|
||||||
<plurals name="GroupsV1MigrationLearnMore_these_members_will_need_to_accept_an_invite">
|
<plurals name="GroupsV1MigrationLearnMore_these_members_will_need_to_accept_an_invite">
|
||||||
<item quantity="one">This member will need to accept an invite to join this group again and will not receive group messages until they accept:</item>
|
<item quantity="one">This member will need to accept an invite to join this group again and will not receive group messages until they accept:</item>
|
||||||
<item quantity="other">These members will need to accept an invite to join this group again and will not receive group messages until they accept:</item>
|
<item quantity="other">These members will need to accept an invite to join this group again and will not receive group messages until they accept:</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
|
<plurals name="GroupsV1MigrationLearnMore_these_members_were_removed_from_the_group">
|
||||||
|
<item quantity="one">This member was removed from the group and will not be able to rejoin until they upgrade:</item>
|
||||||
|
<item quantity="other">These members were removed from the group and will not be able to rejoin until they upgrade:</item>
|
||||||
|
</plurals>
|
||||||
|
|
||||||
<!-- GroupsV1MigrationInitiationBottomSheetDialogFragment -->
|
<!-- GroupsV1MigrationInitiationBottomSheetDialogFragment -->
|
||||||
<string name="GroupsV1MigrationInitiation_upgrade_to_new_group">Upgrade to New Group</string>
|
<string name="GroupsV1MigrationInitiation_upgrade_to_new_group">Upgrade to New Group</string>
|
||||||
|
@ -1050,11 +1055,17 @@
|
||||||
<string name="MessageRecord_s_set_disappearing_message_time_to_s">%1$s set the disappearing message timer to %2$s.</string>
|
<string name="MessageRecord_s_set_disappearing_message_time_to_s">%1$s set the disappearing message timer to %2$s.</string>
|
||||||
<string name="MessageRecord_disappearing_message_time_set_to_s">The disappearing message timer has been set to %1$s.</string>
|
<string name="MessageRecord_disappearing_message_time_set_to_s">The disappearing message timer has been set to %1$s.</string>
|
||||||
<string name="MessageRecord_this_group_was_updated_to_a_new_group">This group was updated to a New Group.</string>
|
<string name="MessageRecord_this_group_was_updated_to_a_new_group">This group was updated to a New Group.</string>
|
||||||
|
<string name="MessageRecord_you_couldnt_be_added_to_the_new_group_and_have_been_invited_to_join">You couldn\'t be added to the New Group and have been invited to join.</string>
|
||||||
<plurals name="MessageRecord_members_couldnt_be_added_to_the_new_group_and_have_been_invited">
|
<plurals name="MessageRecord_members_couldnt_be_added_to_the_new_group_and_have_been_invited">
|
||||||
<item quantity="one">%1$s member couldn\'t be added to the New Group and has been invited to join.</item>
|
<item quantity="one">A member couldn\'t be added to the New Group and has been invited to join.</item>
|
||||||
<item quantity="other">%1$s members couldn\'t be added to the New Group and have been invited to join.</item>
|
<item quantity="other">%1$s members couldn\'t be added to the New Group and have been invited to join.</item>
|
||||||
</plurals>
|
</plurals>
|
||||||
|
|
||||||
|
<plurals name="MessageRecord_members_couldnt_be_added_to_the_new_group_and_have_been_removed">
|
||||||
|
<item quantity="one">A member couldn\'t be added to the New Group and has been removed.</item>
|
||||||
|
<item quantity="other">%1$s members couldn\'t be added to the New Group and have been removed.</item>
|
||||||
|
</plurals>
|
||||||
|
|
||||||
<!-- Profile change updates -->
|
<!-- Profile change updates -->
|
||||||
<string name="MessageRecord_changed_their_profile_name_to">%1$s changed their profile name to %2$s.</string>
|
<string name="MessageRecord_changed_their_profile_name_to">%1$s changed their profile name to %2$s.</string>
|
||||||
<string name="MessageRecord_changed_their_profile_name_from_to">%1$s changed their profile name from %2$s to %3$s.</string>
|
<string name="MessageRecord_changed_their_profile_name_from_to">%1$s changed their profile name from %2$s to %3$s.</string>
|
||||||
|
|
Loading…
Add table
Reference in a new issue