Group link copy changes.
This commit is contained in:
parent
4040c4240a
commit
abd3d4b546
4 changed files with 54 additions and 54 deletions
|
@ -158,7 +158,7 @@ final class GroupsV2UpdateMessageProducer {
|
|||
|
||||
if (editorIsYou) {
|
||||
if (newMemberIsYou) {
|
||||
updates.add(0, updateDescription(context.getString(R.string.MessageRecord_you_joined_the_group_via_the_sharable_group_link)));
|
||||
updates.add(0, updateDescription(context.getString(R.string.MessageRecord_you_joined_the_group_via_the_group_link)));
|
||||
} else {
|
||||
updates.add(updateDescription(member.getUuid(), added -> context.getString(R.string.MessageRecord_you_added_s, added)));
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ final class GroupsV2UpdateMessageProducer {
|
|||
updates.add(0, updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_added_you, editor)));
|
||||
} else {
|
||||
if (member.getUuid().equals(change.getEditor())) {
|
||||
updates.add(updateDescription(member.getUuid(), newMember -> context.getString(R.string.MessageRecord_s_joined_the_group_via_the_sharable_group_link, newMember)));
|
||||
updates.add(updateDescription(member.getUuid(), newMember -> context.getString(R.string.MessageRecord_s_joined_the_group_via_the_group_link, newMember)));
|
||||
} else {
|
||||
updates.add(updateDescription(change.getEditor(), member.getUuid(), (editor, newMember) -> context.getString(R.string.MessageRecord_s_added_s, editor, newMember)));
|
||||
}
|
||||
|
@ -516,33 +516,33 @@ final class GroupsV2UpdateMessageProducer {
|
|||
case ANY:
|
||||
groupLinkEnabled = true;
|
||||
if (editorIsYou) {
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_turned_on_the_sharable_group_link)));
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_turned_on_the_group_link_with_admin_approval_off)));
|
||||
} else {
|
||||
updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_turned_on_the_sharable_group_link, editor)));
|
||||
updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_turned_on_the_group_link_with_admin_approval_off, editor)));
|
||||
}
|
||||
break;
|
||||
case ADMINISTRATOR:
|
||||
groupLinkEnabled = true;
|
||||
if (editorIsYou) {
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_turned_on_the_sharable_group_link_with_admin_approval)));
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_turned_on_the_group_link_with_admin_approval_on)));
|
||||
} else {
|
||||
updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_turned_on_the_sharable_group_link_with_admin_approval, editor)));
|
||||
updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_turned_on_the_group_link_with_admin_approval_on, editor)));
|
||||
}
|
||||
break;
|
||||
case UNSATISFIABLE:
|
||||
if (editorIsYou) {
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_turned_off_the_sharable_group_link)));
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_turned_off_the_group_link)));
|
||||
} else {
|
||||
updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_turned_off_the_sharable_group_link, editor)));
|
||||
updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_turned_off_the_group_link, editor)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!groupLinkEnabled && change.getNewInviteLinkPassword().size() > 0) {
|
||||
if (editorIsYou) {
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_reset_the_sharable_group_link)));
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_reset_the_group_link)));
|
||||
} else {
|
||||
updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_reset_the_sharable_group_link, editor)));
|
||||
updates.add(updateDescription(change.getEditor(), editor -> context.getString(R.string.MessageRecord_s_reset_the_group_link, editor)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -550,18 +550,18 @@ final class GroupsV2UpdateMessageProducer {
|
|||
private void describeUnknownEditorNewGroupInviteLinkAccess(@NonNull DecryptedGroupChange change, @NonNull List<UpdateDescription> updates) {
|
||||
switch (change.getNewInviteLinkAccess()) {
|
||||
case ANY:
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_the_sharable_group_link_has_been_turned_on)));
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_the_group_link_has_been_turned_on_with_admin_approval_off)));
|
||||
break;
|
||||
case ADMINISTRATOR:
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_the_sharable_group_link_has_been_turned_on_with_admin_approval)));
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_the_group_link_has_been_turned_on_with_admin_approval_on)));
|
||||
break;
|
||||
case UNSATISFIABLE:
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_the_sharable_group_link_has_been_turned_off)));
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_the_group_link_has_been_turned_off)));
|
||||
break;
|
||||
}
|
||||
|
||||
if (change.getNewInviteLinkPassword().size() > 0) {
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_the_sharable_group_link_has_been_reset)));
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_the_group_link_has_been_reset)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -572,7 +572,7 @@ final class GroupsV2UpdateMessageProducer {
|
|||
if (requestingMemberIsYou) {
|
||||
updates.add(updateDescription(context.getString(R.string.MessageRecord_you_sent_a_request_to_join_the_group)));
|
||||
} else {
|
||||
updates.add(updateDescription(member.getUuid(), requesting -> context.getString(R.string.MessageRecord_s_requested_to_join_via_the_sharable_group_link, requesting)));
|
||||
updates.add(updateDescription(member.getUuid(), requesting -> context.getString(R.string.MessageRecord_s_requested_to_join_via_the_group_link, requesting)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -573,7 +573,7 @@
|
|||
android:gravity="center_vertical|start"
|
||||
android:paddingStart="@dimen/group_manage_fragment_row_horizontal_padding"
|
||||
android:paddingEnd="@dimen/group_manage_fragment_row_horizontal_padding"
|
||||
android:text="@string/ManageGroupActivity_sharable_group_link"
|
||||
android:text="@string/ManageGroupActivity_group_link"
|
||||
android:textAlignment="viewStart"
|
||||
android:textAppearance="@style/Signal.Text.Body" />
|
||||
|
||||
|
|
|
@ -531,7 +531,7 @@
|
|||
<!-- RequestingMembersFragment -->
|
||||
<string name="RequestingMembersFragment_pending_member_requests">Pending member requests</string>
|
||||
<string name="RequestingMembersFragment_no_member_requests_to_show">No member requests to show.</string>
|
||||
<string name="RequestingMembersFragment_explanation">People on this list are attempting to join this group via the sharable group link.</string>
|
||||
<string name="RequestingMembersFragment_explanation">People on this list are attempting to join this group via the group link.</string>
|
||||
<string name="RequestingMembersFragment_added_s">Added "%1$s"</string>
|
||||
<string name="RequestingMembersFragment_denied_s">Denied "%1$s"</string>
|
||||
|
||||
|
@ -577,7 +577,7 @@
|
|||
<string name="ManageGroupActivity_edit_group_info">Edit group info</string>
|
||||
<string name="ManageGroupActivity_choose_who_can_edit_the_group_name_avatar_and_disappearing_messages">Choose who can edit the group name, avatar, and disappearing messages.</string>
|
||||
<string name="ManageGroupActivity_choose_who_can_add_or_invite_new_members">Choose who can add or invite new members.</string>
|
||||
<string name="ManageGroupActivity_sharable_group_link">Sharable group link</string>
|
||||
<string name="ManageGroupActivity_group_link">Group link</string>
|
||||
<string name="ManageGroupActivity_block_group">Block group</string>
|
||||
<string name="ManageGroupActivity_unblock_group">Unblock group</string>
|
||||
<string name="ManageGroupActivity_leave_group">Leave group</string>
|
||||
|
@ -710,7 +710,7 @@
|
|||
<string name="GroupJoinUpdateRequiredBottomSheetDialogFragment_group_links_coming_soon">Group links coming soon</string>
|
||||
<string name="GroupJoinUpdateRequiredBottomSheetDialogFragment_update_signal_to_use_group_links">Update Signal to use group links</string>
|
||||
<string name="GroupJoinUpdateRequiredBottomSheetDialogFragment_coming_soon">Joining a group via a link is not yet supported by Signal. This feature will be released in an upcoming update.</string>
|
||||
<string name="GroupJoinUpdateRequiredBottomSheetDialogFragment_update_message">The version of Signal you’re using does not support sharable group links. Update to the latest version to join this group via link.</string>
|
||||
<string name="GroupJoinUpdateRequiredBottomSheetDialogFragment_update_message">The version of Signal you’re using does not support group links. Update to the latest version to join this group via link.</string>
|
||||
<string name="GroupJoinUpdateRequiredBottomSheetDialogFragment_update_signal">Update Signal</string>
|
||||
<string name="GroupJoinUpdateRequiredBottomSheetDialogFragment_group_link_is_not_valid">Group link is not valid</string>
|
||||
|
||||
|
@ -983,28 +983,28 @@
|
|||
<string name="MessageRecord_who_can_edit_group_membership_has_been_changed_to_s">Who can edit group membership has been changed to \"%1$s\".</string>
|
||||
|
||||
<!-- GV2 group link invite access level change -->
|
||||
<string name="MessageRecord_you_turned_on_the_sharable_group_link">You turned on the sharable group link.</string>
|
||||
<string name="MessageRecord_you_turned_on_the_sharable_group_link_with_admin_approval">You turned on the sharable group link with admin approval.</string>
|
||||
<string name="MessageRecord_you_turned_off_the_sharable_group_link">You turned off the sharable group link.</string>
|
||||
<string name="MessageRecord_s_turned_on_the_sharable_group_link">%1$s turned on the sharable group link.</string>
|
||||
<string name="MessageRecord_s_turned_on_the_sharable_group_link_with_admin_approval">%1$s turned on the sharable group link with admin approval.</string>
|
||||
<string name="MessageRecord_s_turned_off_the_sharable_group_link">%1$s turned off the sharable group link.</string>
|
||||
<string name="MessageRecord_the_sharable_group_link_has_been_turned_on">The sharable group link has been turned on.</string>
|
||||
<string name="MessageRecord_the_sharable_group_link_has_been_turned_on_with_admin_approval">The sharable group link has been turned on with admin approval.</string>
|
||||
<string name="MessageRecord_the_sharable_group_link_has_been_turned_off">The sharable group link has been turned off.</string>
|
||||
<string name="MessageRecord_you_turned_on_the_group_link_with_admin_approval_off">You turned on the group link with admin approval off.</string>
|
||||
<string name="MessageRecord_you_turned_on_the_group_link_with_admin_approval_on">You turned on the group link with admin approval on.</string>
|
||||
<string name="MessageRecord_you_turned_off_the_group_link">You turned off the group link.</string>
|
||||
<string name="MessageRecord_s_turned_on_the_group_link_with_admin_approval_off">%1$s turned on the group link with admin approval off.</string>
|
||||
<string name="MessageRecord_s_turned_on_the_group_link_with_admin_approval_on">%1$s turned on the group link with admin approval on.</string>
|
||||
<string name="MessageRecord_s_turned_off_the_group_link">%1$s turned off the group link.</string>
|
||||
<string name="MessageRecord_the_group_link_has_been_turned_on_with_admin_approval_off">The group link has been turned on with admin approval off.</string>
|
||||
<string name="MessageRecord_the_group_link_has_been_turned_on_with_admin_approval_on">The group link has been turned on with admin approval on.</string>
|
||||
<string name="MessageRecord_the_group_link_has_been_turned_off">The group link has been turned off.</string>
|
||||
|
||||
<!-- GV2 group link reset -->
|
||||
<string name="MessageRecord_you_reset_the_sharable_group_link">You reset the sharable group link.</string>
|
||||
<string name="MessageRecord_s_reset_the_sharable_group_link">%1$s reset the sharable group link.</string>
|
||||
<string name="MessageRecord_the_sharable_group_link_has_been_reset">The sharable group link has been reset.</string>
|
||||
<string name="MessageRecord_you_reset_the_group_link">You reset the group link.</string>
|
||||
<string name="MessageRecord_s_reset_the_group_link">%1$s reset the group link.</string>
|
||||
<string name="MessageRecord_the_group_link_has_been_reset">The group link has been reset.</string>
|
||||
|
||||
<!-- GV2 group link joins -->
|
||||
<string name="MessageRecord_you_joined_the_group_via_the_sharable_group_link">You joined the group via the sharable group link.</string>
|
||||
<string name="MessageRecord_s_joined_the_group_via_the_sharable_group_link">%1$s joined the group via the sharable group link.</string>
|
||||
<string name="MessageRecord_you_joined_the_group_via_the_group_link">You joined the group via the group link.</string>
|
||||
<string name="MessageRecord_s_joined_the_group_via_the_group_link">%1$s joined the group via the group link.</string>
|
||||
|
||||
<!-- GV2 group link requests -->
|
||||
<string name="MessageRecord_you_sent_a_request_to_join_the_group">You sent a request to join the group.</string>
|
||||
<string name="MessageRecord_s_requested_to_join_via_the_sharable_group_link">%1$s requested to join via the sharable group link.</string>
|
||||
<string name="MessageRecord_s_requested_to_join_via_the_group_link">%1$s requested to join via the group link.</string>
|
||||
|
||||
<!-- GV2 group link approvals -->
|
||||
<string name="MessageRecord_s_approved_your_request_to_join_the_group">%1$s approved your request to join the group.</string>
|
||||
|
|
|
@ -143,7 +143,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.addMember(you)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("You joined the group via the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("You joined the group via the group link.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -152,7 +152,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.addMember(bob)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("Bob joined the group via the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("Bob joined the group via the group link.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -209,7 +209,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.addMember(you)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(Arrays.asList("You joined the group via the sharable group link.", "You added Alice.")));
|
||||
assertThat(describeChange(change), is(Arrays.asList("You joined the group via the group link.", "You added Alice.")));
|
||||
}
|
||||
|
||||
// Member removals
|
||||
|
@ -846,7 +846,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.ANY)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("You turned on the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("You turned on the group link with admin approval off.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -855,7 +855,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.ADMINISTRATOR)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("You turned on the sharable group link with admin approval.")));
|
||||
assertThat(describeChange(change), is(singletonList("You turned on the group link with admin approval on.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -864,7 +864,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.UNSATISFIABLE)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("You turned off the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("You turned off the group link.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -873,7 +873,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.ANY)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("Alice turned on the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("Alice turned on the group link with admin approval off.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -882,7 +882,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.ADMINISTRATOR)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("Bob turned on the sharable group link with admin approval.")));
|
||||
assertThat(describeChange(change), is(singletonList("Bob turned on the group link with admin approval on.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -891,7 +891,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.UNSATISFIABLE)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("Alice turned off the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("Alice turned off the group link.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -900,7 +900,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.ANY)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("The sharable group link has been turned on.")));
|
||||
assertThat(describeChange(change), is(singletonList("The group link has been turned on with admin approval off.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -909,7 +909,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.ADMINISTRATOR)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("The sharable group link has been turned on with admin approval.")));
|
||||
assertThat(describeChange(change), is(singletonList("The group link has been turned on with admin approval on.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -918,7 +918,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.inviteLinkAccess(AccessControl.AccessRequired.UNSATISFIABLE)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("The sharable group link has been turned off.")));
|
||||
assertThat(describeChange(change), is(singletonList("The group link has been turned off.")));
|
||||
}
|
||||
|
||||
// Group link reset
|
||||
|
@ -929,7 +929,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.resetGroupLink()
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("You reset the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("You reset the group link.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -938,7 +938,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.resetGroupLink()
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("Alice reset the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("Alice reset the group link.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -947,7 +947,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.resetGroupLink()
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("The sharable group link has been reset.")));
|
||||
assertThat(describeChange(change), is(singletonList("The group link has been reset.")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -961,7 +961,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.resetGroupLink()
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("Alice turned on the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("Alice turned on the group link with admin approval off.")));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -975,7 +975,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.resetGroupLink()
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("You turned on the sharable group link with admin approval.")));
|
||||
assertThat(describeChange(change), is(singletonList("You turned on the group link with admin approval on.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -985,7 +985,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.resetGroupLink()
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(Arrays.asList("You turned off the sharable group link.", "You reset the sharable group link.")));
|
||||
assertThat(describeChange(change), is(Arrays.asList("You turned off the group link.", "You reset the group link.")));
|
||||
}
|
||||
|
||||
// Group link request
|
||||
|
@ -1005,7 +1005,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.requestJoin()
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("Bob requested to join via the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("Bob requested to join via the group link.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -1014,7 +1014,7 @@ public final class GroupsV2UpdateMessageProducerTest {
|
|||
.requestJoin(alice)
|
||||
.build();
|
||||
|
||||
assertThat(describeChange(change), is(singletonList("Alice requested to join via the sharable group link.")));
|
||||
assertThat(describeChange(change), is(singletonList("Alice requested to join via the group link.")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Reference in a new issue