 
 (defn generate-context
   "Generates context for jail call"
-  [{:keys [chats] :accounts/keys [current-account-id]} chat-id to]
+  [{:keys [chats] :accounts/keys [current-account-id]} chat-id to group-id]
   (merge {:platform platform/platform
           :from     current-account-id
           :to       to
           :chat     {:chat-id    chat-id
-                     :group-chat (get-in chats [chat-id :group-chat])}}
+                     :group-chat (or (get-in chats [chat-id :group-chat])
+                                     (not (nil? group-id)))}}
          i18n/delimeters))
 
 ;;;; Coeffects

            [status-im.data-store.messages :as msg-store]
            [status-im.utils.handlers :refer [register-handler-fx]]
            [status-im.components.status :as status]
            [status-im.chat.constants :as const]
            [status-im.commands.utils :as commands-utils]
            [status-im.i18n :as i18n]
            [status-im.utils.platform :as platform]))


                            data-type]
             to            (get-in contacts [chat-id :address])
             jail-params   {:parameters params
                            :context (generate-context db chat-id to group-id)}]
         {:chat-fx/call-jail {:jail-id                 jail-id
                              :path                    path
                              :params                  jail-params
                              :callback-events-creator (fn [jail-response]
                                                         [[::jail-command-data-response
                                                           jail-response message data-type]])}})
