Skip to content

Commit c64fd60

Browse files
committed
fix: Hide the 'Add Member' button for broadcasts
1 parent f816110 commit c64fd60

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/main/java/org/thoughtcrime/securesms/ProfileAdapter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,9 @@ public void changeData(@Nullable int[] memberList, @Nullable DcContact dcContact
314314
itemData.add(new ItemData(ITEM_DIVIDER, null, 0));
315315
if (dcChat != null) {
316316
if (dcChat.canSend() && dcChat.isEncrypted()) {
317-
itemData.add(new ItemData(ITEM_MEMBERS, DcContact.DC_CONTACT_ID_ADD_MEMBER, 0));
317+
if (!isOutBroadcast) {
318+
itemData.add(new ItemData(ITEM_MEMBERS, DcContact.DC_CONTACT_ID_ADD_MEMBER, 0));
319+
}
318320
itemData.add(new ItemData(ITEM_MEMBERS, DcContact.DC_CONTACT_ID_QR_INVITE, 0));
319321
}
320322
}

src/main/java/org/thoughtcrime/securesms/util/SelectedContactsAdapter.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public SelectedContactsAdapter(@NonNull Context context,
5454

5555
public void changeData(Collection<Integer> contactIds) {
5656
contacts.clear();
57-
contacts.add(DC_CONTACT_ID_ADD_MEMBER);
57+
if (!isBroadcast) {
58+
contacts.add(DC_CONTACT_ID_ADD_MEMBER);
59+
}
5860
if (contactIds != null) {
5961
for (int id : contactIds) {
6062
if (id != DC_CONTACT_ID_SELF) {
@@ -75,7 +77,7 @@ public void remove(@NonNull Integer contactId) {
7577
}
7678

7779
public Set<Integer> getContacts() {
78-
final Set<Integer> set = new HashSet<>(contacts.size()-1);
80+
final Set<Integer> set = new HashSet<>(contacts.size());
7981
for (int i = 1; i < contacts.size(); i++) {
8082
set.add(contacts.get(i));
8183
}

0 commit comments

Comments
 (0)