Admin cannot re-add users to the group chat after removing them using the "Manage members" option. #20959 (#21082)

Incorrect text for system message when removing a User from a group chat #21053
This commit is contained in:
flexsurfer 2024-08-29 21:19:17 +02:00 committed by GitHub
parent 8948904a9b
commit b38d2c1836
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 10 deletions

View File

@ -85,11 +85,12 @@
(rf/defn add-members (rf/defn add-members
"Add members to a group chat" "Add members to a group chat"
{:events [:group-chats.ui/add-members-pressed]} {:events [:group-chats.ui/add-members-pressed]}
[{{:group-chat/keys [selected-participants]} :db :as cofx} chat-id] [{{:group-chat/keys [selected-participants]} :db} chat-id]
(when (seq selected-participants)
{:json-rpc/call [{:method "wakuext_addMembersToGroupChat" {:json-rpc/call [{:method "wakuext_addMembersToGroupChat"
:params [nil chat-id selected-participants] :params [nil chat-id selected-participants]
:js-response true :js-response true
:on-success #(re-frame/dispatch [:chat-updated % true])}]}) :on-success #(re-frame/dispatch [:chat-updated % true])}]}))
(rf/defn add-members-from-invitation (rf/defn add-members-from-invitation
"Add members to a group chat" "Add members to a group chat"

View File

@ -58,6 +58,9 @@
{:keys [admins] :as group} (rf/sub [:chats/chat-by-id chat-id]) {:keys [admins] :as group} (rf/sub [:chats/chat-by-id chat-id])
current-pk (rf/sub [:multiaccount/public-key]) current-pk (rf/sub [:multiaccount/public-key])
admin? (get admins current-pk)] admin? (get admins current-pk)]
(rn/use-mount (fn []
(rf/dispatch [:group/clear-added-participants])
(rf/dispatch [:group/clear-removed-members])))
[rn/view {:flex 1 :margin-top 20} [rn/view {:flex 1 :margin-top 20}
[rn/touchable-opacity [rn/touchable-opacity
{:on-press #(rf/dispatch [:navigate-back]) {:on-press #(rf/dispatch [:navigate-back])
@ -174,11 +177,8 @@
:icon :i/add-user :icon :i/add-user
:label (i18n/label (if admin? :t/manage-members :t/add-members)) :label (i18n/label (if admin? :t/manage-members :t/add-members))
:counter-value (count contacts) :counter-value (count contacts)
:on-press (fn [] :on-press #(rf/dispatch [:open-modal :group-add-manage-members
(rf/dispatch [:group/clear-added-participants]) chat-id])}]}]
(rf/dispatch [:group/clear-removed-members])
(rf/dispatch [:open-modal :group-add-manage-members
chat-id]))}]}]
[rn/section-list [rn/section-list
{:key-fn :title {:key-fn :title
:sticky-section-headers-enabled false :sticky-section-headers-enabled false