|
5 | 5 | [goog.object :as object]
|
6 | 6 | [re-frame.core :as re-frame]
|
7 | 7 | [status-im.chat.models.mentions :as mentions]
|
8 |
| - [status-im.chat.models.message :as chat.message] |
9 | 8 | [status-im.chat.models.message-content :as message-content]
|
10 | 9 | [status-im.data-store.messages :as data-store-messages]
|
11 | 10 | [status-im2.constants :as constants]
|
12 | 11 | [status-im2.contexts.chat.composer.link-preview.events :as link-preview]
|
| 12 | + [status-im2.contexts.chat.messages.transport.events :as messages.transport] |
13 | 13 | [taoensso.timbre :as log]
|
14 | 14 | [utils.i18n :as i18n]
|
15 | 15 | [utils.re-frame :as rf]
|
|
205 | 205 | (rf/merge cofx
|
206 | 206 | (clean-input (:current-chat-id db))
|
207 | 207 | (link-preview/reset-unfurled)
|
208 |
| - (chat.message/send-messages messages))))) |
| 208 | + (messages.transport/send-chat-messages messages))))) |
209 | 209 |
|
210 | 210 | (rf/defn send-audio-message
|
211 | 211 | [{:keys [db] :as cofx} audio-path duration current-chat-id]
|
|
214 | 214 | (when-not (string/blank? audio-path)
|
215 | 215 | (rf/merge
|
216 | 216 | {:db (assoc-in db [:chat/inputs current-chat-id :metadata :responding-to-message] nil)}
|
217 |
| - (chat.message/send-message |
218 |
| - (merge |
219 |
| - {:chat-id current-chat-id |
220 |
| - :content-type constants/content-type-audio |
221 |
| - :audio-path audio-path |
222 |
| - :audio-duration-ms duration |
223 |
| - :text (i18n/label :t/update-to-listen-audio {"locale" "en"})} |
224 |
| - (when message-id |
225 |
| - {:response-to message-id}))))))) |
| 217 | + (messages.transport/send-chat-messages |
| 218 | + [(merge |
| 219 | + {:chat-id current-chat-id |
| 220 | + :content-type constants/content-type-audio |
| 221 | + :audio-path audio-path |
| 222 | + :audio-duration-ms duration |
| 223 | + :text (i18n/label :t/update-to-listen-audio {"locale" "en"})} |
| 224 | + (when message-id |
| 225 | + {:response-to message-id}))]))))) |
226 | 226 |
|
227 | 227 | (rf/defn send-sticker-message
|
228 | 228 | [cofx {:keys [hash packID pack]} current-chat-id]
|
229 | 229 | (when-not (or (string/blank? hash) (and (string/blank? packID) (string/blank? pack)))
|
230 |
| - (chat.message/send-message cofx |
231 |
| - {:chat-id current-chat-id |
232 |
| - :content-type constants/content-type-sticker |
233 |
| - :sticker {:hash hash |
234 |
| - :pack (int (if (string/blank? packID) pack packID))} |
235 |
| - :text (i18n/label :t/update-to-see-sticker {"locale" "en"})}))) |
| 230 | + (messages.transport/send-chat-messages |
| 231 | + cofx |
| 232 | + [{:chat-id current-chat-id |
| 233 | + :content-type constants/content-type-sticker |
| 234 | + :sticker {:hash hash |
| 235 | + :pack (int (if (string/blank? packID) pack packID))} |
| 236 | + :text (i18n/label :t/update-to-see-sticker {"locale" "en"})}]))) |
236 | 237 |
|
237 | 238 | (rf/defn send-edited-message
|
238 | 239 | [{:keys [db]
|
|
0 commit comments