#2185: After upgrade faucet, send and location messages are shown as plain text, request is shown without a text
This commit is contained in:
parent
74e81f7faf
commit
b6f7cc8629
|
@ -24,26 +24,26 @@
|
||||||
(defn request-command-message-data
|
(defn request-command-message-data
|
||||||
"Requests command message data from jail"
|
"Requests command message data from jail"
|
||||||
[db
|
[db
|
||||||
{{command-name :command
|
{{command-name :command
|
||||||
content-command-name :content-command
|
content-command-name :content-command
|
||||||
:keys [content-command-scope
|
:keys [content-command-scope scope params type bot]} :content
|
||||||
scope
|
:keys [chat-id jail-id group-id] :as message}
|
||||||
params
|
|
||||||
type
|
|
||||||
bot]} :content
|
|
||||||
:keys [chat-id jail-id group-id] :as message}
|
|
||||||
data-type]
|
data-type]
|
||||||
(let [{:keys [chats]
|
(let [{:keys [chats]
|
||||||
:accounts/keys [current-account-id]
|
:accounts/keys [current-account-id]
|
||||||
:contacts/keys [contacts]} db
|
:contacts/keys [contacts]} db
|
||||||
jail-id (or bot jail-id chat-id)
|
jail-id (or bot jail-id chat-id)
|
||||||
jail-id (if (get-in chats [jail-id :group-chat])
|
jail-command-name (or content-command-name command-name)
|
||||||
(get-in chats [jail-id :possible-commands (keyword command-name) :owner-id])
|
;; here we're trying to use the default scope if there is no other scope provided
|
||||||
jail-id)]
|
default-command-scope (-> (get-in contacts [jail-id :commands (keyword jail-command-name)])
|
||||||
|
first
|
||||||
|
:scope)]
|
||||||
(if (get-in contacts [jail-id :commands-loaded?])
|
(if (get-in contacts [jail-id :commands-loaded?])
|
||||||
(let [path [(if (= :response (keyword type)) :responses :commands)
|
(let [path [(if (= :response (keyword type)) :responses :commands)
|
||||||
[(if content-command-name content-command-name command-name)
|
[jail-command-name
|
||||||
(commands-model/scope->bit-mask (or scope content-command-scope))]
|
(commands-model/scope->bit-mask (or scope
|
||||||
|
content-command-scope
|
||||||
|
default-command-scope))]
|
||||||
data-type]
|
data-type]
|
||||||
to (get-in contacts [chat-id :address])
|
to (get-in contacts [chat-id :address])
|
||||||
jail-params {:parameters params
|
jail-params {:parameters params
|
||||||
|
|
|
@ -37,4 +37,5 @@
|
||||||
handler-data/schema])
|
handler-data/schema])
|
||||||
|
|
||||||
(defn migration [old-realm new-realm]
|
(defn migration [old-realm new-realm]
|
||||||
(log/debug "migrating v15 account database: " old-realm new-realm))
|
(log/debug "migrating v15 account database: " old-realm new-realm)
|
||||||
|
(contact/migration old-realm new-realm))
|
Loading…
Reference in New Issue