mirror of
https://github.com/status-im/status-react.git
synced 2025-01-14 04:55:13 +00:00
participant removed from chat
Former-commit-id: 2da99899ccadb85c3ce237fef3deb1dda2e54093
This commit is contained in:
parent
d0b8b20ca9
commit
16bf960e3c
BIN
images/trash.png
Normal file
BIN
images/trash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
@ -136,6 +136,14 @@
|
||||
:content (str (or inviter-name from) " invited " (or invitee-name identity))
|
||||
:content-type text-content-type})))
|
||||
|
||||
(defn participant-removed-from-group-msg [chat-id identity from msg-id]
|
||||
(let [remover-name (:name (contacts/contact-by-identity from))
|
||||
removed-name (:name (contacts/contact-by-identity identity))]
|
||||
(save-message chat-id {:from "system"
|
||||
:msg-id msg-id
|
||||
:content (str (or remover-name from) " removed " (or removed-name identity))
|
||||
:content-type text-content-type})))
|
||||
|
||||
(defn removed-participant-msg [chat-id identity]
|
||||
(let [contact-name (:name (contacts/contact-by-identity identity))]
|
||||
(save-message chat-id {:from "system"
|
||||
@ -149,6 +157,13 @@
|
||||
(joined-chat-msg group-id from ack-msg-id)
|
||||
(signal-chat-updated db group-id)))
|
||||
|
||||
(register-handler :participant-removed-from-group
|
||||
(fn [db [action from group-id identity msg-id]]
|
||||
(log/debug action msg-id from group-id identity)
|
||||
(chat-remove-participants group-id [identity])
|
||||
(participant-removed-from-group-msg group-id identity from msg-id)
|
||||
(signal-chat-updated db group-id)))
|
||||
|
||||
(register-handler :participant-invited-to-group
|
||||
(fn [db [action from group-id identity msg-id]]
|
||||
(log/debug action msg-id from group-id identity)
|
||||
|
@ -34,9 +34,8 @@
|
||||
(dispatch [:group-chat-invite-acked from group-id ack-msg-id]))
|
||||
:group-new-participant (let [{:keys [group-id identity from msg-id]} event]
|
||||
(dispatch [:participant-invited-to-group from group-id identity msg-id]))
|
||||
;:group-removed-participant (let [{:keys [group-id identity from]} event]
|
||||
; (add-to-chat "group-chat" ":" (str (shorten from) " removed " (shorten identity) " from group chat"))
|
||||
; (remove-identity-from-group-list identity))
|
||||
:group-removed-participant (let [{:keys [group-id identity from msg-id]} event]
|
||||
(dispatch [:participant-removed-from-group from group-id identity msg-id]))
|
||||
;:removed-from-group (let [{:keys [group-id from]} event]
|
||||
; (add-to-chat "group-chat" ":" (str (shorten from) " removed you from group chat")))
|
||||
;:participant-left-group (let [{:keys [group-id from]} event]
|
||||
|
Loading…
x
Reference in New Issue
Block a user