aboutsummaryrefslogtreecommitdiff
path: root/telegram/utils.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/utils.go')
-rw-r--r--telegram/utils.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/telegram/utils.go b/telegram/utils.go
index 6878fc6..dabb8a2 100644
--- a/telegram/utils.go
+++ b/telegram/utils.go
@@ -749,7 +749,7 @@ func (c *Client) ensureDownloadFile(file *client.File) *client.File {
// ProcessIncomingMessage transfers a message to XMPP side and marks it as read on Telegram side
func (c *Client) ProcessIncomingMessage(chatId int64, message *client.Message) {
- var text, oob string
+ var text, oob, auxText string
content := message.Content
if content != nil && content.MessageContentType() == client.TypeMessageChatChangePhoto {
chat, err := c.client.GetChat(&client.GetChatRequest{
@@ -776,6 +776,10 @@ func (c *Client) ProcessIncomingMessage(chatId int64, message *client.Message) {
oob = link
if c.Session.OOBMode && oob != "" {
+ typ := message.Content.MessageContentType()
+ if typ != client.TypeMessageSticker {
+ auxText = text
+ }
text = oob
} else if !c.Session.RawMessages {
var prefix strings.Builder
@@ -803,6 +807,9 @@ func (c *Client) ProcessIncomingMessage(chatId int64, message *client.Message) {
})
// forward message to XMPP
gateway.SendMessageWithOOB(c.jid, strconv.FormatInt(chatId, 10), text, c.xmpp, oob)
+ if auxText != "" {
+ gateway.SendMessage(c.jid, strconv.FormatInt(chatId, 10), auxText, c.xmpp)
+ }
}
// ProcessOutgoingMessage executes commands or sends messages to mapped chats