mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-06 13:54:01 +00:00
participant left group
This commit is contained in:
parent
dd4f55e11f
commit
4964542146
@ -152,6 +152,13 @@
|
|||||||
:content (str (or remover-name from) " removed you from group chat")
|
:content (str (or remover-name from) " removed you from group chat")
|
||||||
:content-type text-content-type})))
|
:content-type text-content-type})))
|
||||||
|
|
||||||
|
(defn participant-left-group-msg [chat-id from msg-id]
|
||||||
|
(let [left-name (:name (contacts/contact-by-identity from))]
|
||||||
|
(save-message chat-id {:from "system"
|
||||||
|
:msg-id msg-id
|
||||||
|
:content (str (or left-name from) " left")
|
||||||
|
:content-type text-content-type})))
|
||||||
|
|
||||||
(defn removed-participant-msg [chat-id identity]
|
(defn removed-participant-msg [chat-id identity]
|
||||||
(let [contact-name (:name (contacts/contact-by-identity identity))]
|
(let [contact-name (:name (contacts/contact-by-identity identity))]
|
||||||
(save-message chat-id {:from "system"
|
(save-message chat-id {:from "system"
|
||||||
@ -185,6 +192,12 @@
|
|||||||
(set-chat-active group-id false)
|
(set-chat-active group-id false)
|
||||||
(signal-chat-updated db group-id)))
|
(signal-chat-updated db group-id)))
|
||||||
|
|
||||||
|
(register-handler :participant-left-group
|
||||||
|
(fn [db [action from group-id msg-id]]
|
||||||
|
(log/debug action msg-id from group-id)
|
||||||
|
(participant-left-group-msg group-id from msg-id)
|
||||||
|
(signal-chat-updated db group-id)))
|
||||||
|
|
||||||
(register-handler :participant-invited-to-group
|
(register-handler :participant-invited-to-group
|
||||||
(fn [db [action from group-id identity msg-id]]
|
(fn [db [action from group-id identity msg-id]]
|
||||||
(log/debug action msg-id from group-id identity)
|
(log/debug action msg-id from group-id identity)
|
||||||
|
@ -38,8 +38,6 @@
|
|||||||
(dispatch [:participant-removed-from-group from group-id identity msg-id]))
|
(dispatch [:participant-removed-from-group from group-id identity msg-id]))
|
||||||
:removed-from-group (let [{:keys [group-id from msg-id]} event]
|
:removed-from-group (let [{:keys [group-id from msg-id]} event]
|
||||||
(dispatch [:you-removed-from-group from group-id msg-id]))
|
(dispatch [:you-removed-from-group from group-id msg-id]))
|
||||||
;:participant-left-group (let [{:keys [group-id from]} event]
|
:participant-left-group (let [{:keys [group-id from msg-id]} event]
|
||||||
; (add-to-chat "group-chat" ":" (str (shorten from) " left group chat")))
|
(dispatch [:participant-left-group from group-id msg-id]))
|
||||||
;(add-to-chat "chat" ":" (str "Don't know how to handle " event-type))
|
(log/info "Don't know how to handle" event-type)))})
|
||||||
(log/info "Don't know how to handle" event-type)
|
|
||||||
))})
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user