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-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]
|
||||
(let [contact-name (:name (contacts/contact-by-identity identity))]
|
||||
(save-message chat-id {:from "system"
|
||||
|
@ -185,6 +192,12 @@
|
|||
(set-chat-active group-id false)
|
||||
(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
|
||||
(fn [db [action from group-id identity msg-id]]
|
||||
(log/debug action msg-id from group-id identity)
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
(dispatch [:participant-removed-from-group from group-id identity msg-id]))
|
||||
:removed-from-group (let [{:keys [group-id from msg-id]} event]
|
||||
(dispatch [:you-removed-from-group from group-id msg-id]))
|
||||
;:participant-left-group (let [{:keys [group-id from]} event]
|
||||
; (add-to-chat "group-chat" ":" (str (shorten from) " left group chat")))
|
||||
;(add-to-chat "chat" ":" (str "Don't know how to handle " event-type))
|
||||
(log/info "Don't know how to handle" event-type)
|
||||
))})
|
||||
:participant-left-group (let [{:keys [group-id from msg-id]} event]
|
||||
(dispatch [:participant-left-group from group-id msg-id]))
|
||||
(log/info "Don't know how to handle" event-type)))})
|
||||
|
|
Loading…
Reference in New Issue