diff options
Diffstat (limited to 'telegram')
-rw-r--r-- | telegram/utils.go | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/telegram/utils.go b/telegram/utils.go index 4509d1a..819455c 100644 --- a/telegram/utils.go +++ b/telegram/utils.go @@ -1058,13 +1058,19 @@ func (c *Client) ProcessIncomingMessage(chatId int64, message *client.Message) { fileName, link := c.formatFile(file, false) oob = link - if c.Session.OOBMode && oob != "" { - typ := message.Content.MessageContentType() - if typ != client.TypeMessageSticker { - auxText = text + oobSwap := c.Session.OOBMode && oob != "" + + var ignorePrefix bool + if oobSwap { + if text == "" || message.Content.MessageContentType() == client.TypeMessageSticker { + isPM, err := c.IsPM(chatId) + if err == nil { + ignorePrefix = isPM && c.isCarbonsEnabled() + } } - text = oob - } else if !c.Session.RawMessages { + } + + if !c.Session.RawMessages && !ignorePrefix { var newText strings.Builder prefix, prefixReply := c.messageToPrefix(message, previewName, fileName, false) @@ -1080,6 +1086,13 @@ func (c *Client) ProcessIncomingMessage(chatId int64, message *client.Message) { } text = newText.String() } + + if oobSwap { + if !ignorePrefix { + auxText = text + } + text = oob + } } } if !replyObtained { |