From b701005f3bd4259273a9f966c9fe6bad1513cd65 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Tue, 30 May 2023 15:05:38 -0400 Subject: [PATCH] fix(pins): prepare content of pin messages so stickers work (#3523) --- VERSION | 2 +- protocol/messenger_pin_messages.go | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index b0a27b192..45866eec4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.153.0 +0.153.1 diff --git a/protocol/messenger_pin_messages.go b/protocol/messenger_pin_messages.go index 7b840bca1..71fff1a9b 100644 --- a/protocol/messenger_pin_messages.go +++ b/protocol/messenger_pin_messages.go @@ -122,7 +122,20 @@ func (m *Messenger) sendPinMessage(ctx context.Context, message *common.PinMessa } func (m *Messenger) PinnedMessageByChatID(chatID, cursor string, limit int) ([]*common.PinnedMessage, string, error) { - return m.persistence.PinnedMessageByChatID(chatID, cursor, limit) + pinnedMsgs, cursor, err := m.persistence.PinnedMessageByChatID(chatID, cursor, limit) + + if err != nil { + return nil, "", err + } + + if m.httpServer != nil { + for idx := range pinnedMsgs { + msg := pinnedMsgs[idx].Message + m.prepareMessage(msg, m.httpServer) + pinnedMsgs[idx].Message = msg + } + } + return pinnedMsgs, cursor, nil } func (m *Messenger) SavePinMessages(messages []*common.PinMessage) error {