Dont setup topic as it resets the discovery filter

Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
This commit is contained in:
Andrea Maria Piana 2019-02-07 15:03:14 +01:00 committed by Igor Mandrigin
parent 2ab1dcb54a
commit 14e887160a
No known key found for this signature in database
GPG Key ID: 4A0EDDE26E66BC8B
2 changed files with 31 additions and 28 deletions

View File

@ -522,7 +522,9 @@
:members-joined (:members-joined new-group)
:contacts (:contacts new-group)})
(add-system-messages chat-id previous-chat new-group)
(set-up-topic chat-id previous-chat)
(when config/group-chats-publish-to-topic?
(set-up-topic chat-id previous-chat))
#(when (and message
;; don't allow anything but group messages
(instance? protocol/Message message)

View File

@ -170,6 +170,7 @@
(map (comp :text :content) (sort-by :clock-value (vals (:messages actual-chat))))))))))))
(deftest set-up-topic
(with-redefs [config/group-chats-publish-to-topic? true]
(let [cofx {:now 0 :db {:account/account {:public-key admin}}}]
(testing "a brand new chat"
(let [actual (group-chats/handle-membership-update cofx initial-message "payload" admin)]
@ -196,7 +197,7 @@
:member member-1}]}]}
actual (group-chats/handle-membership-update cofx new-message "payload" admin)]
(testing "it removes the topic"
(is (:shh/remove-filters actual)))))))
(is (:shh/remove-filters actual))))))))
(deftest build-group-test
(testing "only adds"