fix(pins): prepare content of pin messages so stickers work (#3523)

This commit is contained in:
Jonathan Rainville 2023-05-30 15:05:38 -04:00 committed by GitHub
parent b1a6607dbb
commit b701005f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 2 deletions

View File

@ -1 +1 @@
0.153.0 0.153.1

View File

@ -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) { 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 { func (m *Messenger) SavePinMessages(messages []*common.PinMessage) error {