Chore: Release Fixes (#3011)

- Fix super admin crashing
- Fix error on telegram group messages

fixes: #2856
This commit is contained in:
Sojan Jose
2021-09-14 15:54:57 +05:30
committed by GitHub
parent 2c381d726d
commit 946a09928e
4 changed files with 33 additions and 10 deletions

View File

@@ -1,8 +1,14 @@
# Find the various telegram payload samples here: https://core.telegram.org/bots/webhooks#testing-your-bot-with-updates
# https://core.telegram.org/bots/api#available-types
class Telegram::IncomingMessageService
include ::FileTypeHelper
pattr_initialize [:inbox!, :params!]
def perform
# chatwoot doesn't support group conversations at the moment
return unless private_message?
set_contact
update_contact_avatar
set_conversation
@@ -20,6 +26,10 @@ class Telegram::IncomingMessageService
private
def private_message?
params.dig(:message, :chat, :type) == 'private'
end
def account
@account ||= inbox.account
end