mirror of
https://github.com/status-im/status-react.git
synced 2025-01-10 19:16:59 +00:00
receive group msg
This commit is contained in:
parent
d4561939d3
commit
b7ce3df93d
@ -102,6 +102,12 @@
|
|||||||
(create-chat chat-id [chat-id] false)
|
(create-chat chat-id [chat-id] false)
|
||||||
(signal-chat-updated chat-id))))
|
(signal-chat-updated chat-id))))
|
||||||
|
|
||||||
|
(register-handler :group-received-msg
|
||||||
|
(fn [db [action {chat-id :group-id :as msg}]]
|
||||||
|
(log/debug action "msg" msg)
|
||||||
|
(save-message chat-id msg)
|
||||||
|
(signal-chat-updated db chat-id)))
|
||||||
|
|
||||||
(register-handler :acked-msg
|
(register-handler :acked-msg
|
||||||
(fn [db [_ from msg-id]]
|
(fn [db [_ from msg-id]]
|
||||||
(update-message! {:msg-id msg-id
|
(update-message! {:msg-id msg-id
|
||||||
|
@ -5,7 +5,8 @@
|
|||||||
[syng-im.db :as db]
|
[syng-im.db :as db]
|
||||||
[syng-im.utils.logging :as log]))
|
[syng-im.utils.logging :as log]))
|
||||||
|
|
||||||
(defn save-message [chat-id {:keys [from to msg-id content content-type outgoing] :or {outgoing false} :as msg}]
|
(defn save-message [chat-id {:keys [from to msg-id content content-type outgoing] :or {outgoing false
|
||||||
|
to nil} :as msg}]
|
||||||
(when-not (r/exists? :msgs :msg-id msg-id)
|
(when-not (r/exists? :msgs :msg-id msg-id)
|
||||||
(r/write
|
(r/write
|
||||||
(fn []
|
(fn []
|
||||||
|
@ -23,11 +23,13 @@
|
|||||||
(dispatch [:msg-delivery-failed msg-id]))
|
(dispatch [:msg-delivery-failed msg-id]))
|
||||||
:new-group-chat (let [{:keys [from group-id identities group-name]} event]
|
:new-group-chat (let [{:keys [from group-id identities group-name]} event]
|
||||||
(dispatch [:group-chat-invite-received from group-id identities group-name]))
|
(dispatch [:group-chat-invite-received from group-id identities group-name]))
|
||||||
|
:new-group-msg (let [{from :from
|
||||||
|
group-id :group-id
|
||||||
|
payload :payload} event]
|
||||||
|
(dispatch [:group-received-msg (assoc payload :from from
|
||||||
|
:group-id group-id)]))
|
||||||
;:group-chat-invite-acked (let [{:keys [from group-id]} event]
|
;:group-chat-invite-acked (let [{:keys [from group-id]} event]
|
||||||
; (add-to-chat "group-chat" ":" (str "Received ACK for group chat invitation from " from " for group-id: " group-id)))
|
; (add-to-chat "group-chat" ":" (str "Received ACK for group chat invitation from " from " for group-id: " group-id)))
|
||||||
;:new-group-msg (let [{from :from
|
|
||||||
; {content :content} :payload} event]
|
|
||||||
; (add-to-chat "group-chat" from content))
|
|
||||||
;:group-new-participant (let [{:keys [group-id identity from]} event]
|
;:group-new-participant (let [{:keys [group-id identity from]} event]
|
||||||
; (add-to-chat "group-chat" ":" (str (shorten from) " added " (shorten identity) " to group chat"))
|
; (add-to-chat "group-chat" ":" (str (shorten from) " added " (shorten identity) " to group chat"))
|
||||||
; (add-identity-to-group-list identity))
|
; (add-identity-to-group-list identity))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user