Stop sending seen messages

Currently, these messages are not used and should be properly revisited
later. It only generates extra traffic on discovery topic.
This commit is contained in:
Roman Volosovskyi 2019-01-24 18:35:31 +02:00
parent d3f1b37c12
commit 9daef17f11
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
4 changed files with 16 additions and 13 deletions

View File

@ -209,7 +209,8 @@
updated-statuses)
:data-store/tx [(user-statuses-store/save-statuses-tx updated-statuses)]}
(update-chats-unviewed-messages-count {:chat-id chat-id})
(send-messages-seen chat-id loaded-unviewed-ids)
;;TODO(rasom): uncomment when seen messages will be revisited
#_(send-messages-seen chat-id loaded-unviewed-ids)
(when platform/desktop?
(update-dock-badge-label))))))

View File

@ -198,10 +198,11 @@
current-chat? :seen
:else :received))
(commands-receiving/receive message)
(send-message-seen chat-id message-id (and (not group-chat)
current-chat?
(not (= constants/system from))
(not (:outgoing message)))))))
;;TODO(rasom): uncomment when seen messages will be revisited
#_(send-message-seen chat-id message-id (and (not group-chat)
current-chat?
(not (= constants/system from))
(not (:outgoing message)))))))
(fx/defn update-group-messages [cofx chat->message chat-id]
(fx/merge cofx

View File

@ -245,10 +245,11 @@
(testing "With empty unviewed set, no effects are produced"
(is (= nil (chat/mark-messages-seen {:db test-db} "opened"))))
(testing "For 1-1 chat, we send seen messages confirmation to the recipient as well"
(is (= #{"4" "5" "6"}
(set (get-in (chat/mark-messages-seen {:db test-db} "1-1")
[:shh/post 0 :message :payload :message-ids]))))))
#_(testing "For 1-1 chat, we send seen messages confirmation to the
recipient as well"
(is (= #{"4" "5" "6"}
(set (get-in (chat/mark-messages-seen {:db test-db} "1-1")
[:shh/post 0 :message :payload :message-ids]))))))
(deftest update-dock-badge-label
(testing "When user has unseen private messages"

View File

@ -162,10 +162,10 @@
:clock-value 1
:timestamp 0}
extract-seen (comp :payload :message first :shh/post)]
(testing "it send a seen message when the chat is 1-to-1 and is open"
(is (instance? protocol/MessagesSeen
(extract-seen (message/receive-many cofx [message]))))
(is (= #{"1"} (:message-ids (extract-seen (message/receive-many cofx [message]))))))
#_(testing "it sends a seen message when the chat is 1-to-1 and is open"
(is (instance? protocol/MessagesSeen
(extract-seen (message/receive-many cofx [message]))))
(is (= #{"1"} (:message-ids (extract-seen (message/receive-many cofx [message]))))))
(testing "it does not send any when the chat is a group-chat"
(is (nil? (extract-seen
(message/receive-many