Closed Wunderfitz closed 3 years ago
I expect that the message was loaded from the database. It has no flag is_pinned
, because it was received before client update.
Official Telegram clients show as pinned the first message older than currently shown messages (if there is such a message) and use searchChatMessages
with filter searchMessagesFilterPinned
to find it. Messages returned by searchChatMessages
should always have up-to-date is_pinned
flag.
Thanks for the hint how the official clients do it! And yes, I'm using the message database and the ones I found so far are rather old.
However, if you include a dedicated function such as getChatPinnedMessage
maybe it would be a good idea to make sure the returned message is consistent as well... Of course, it's not a showstopper, I've implemented a proper workaround myself... ;)
I pushed a fix, which should update the flag of the message after a getSupergroupFullInfo
call for the channel, or the chat is opened.
Thank you very much - did a cherry-pick onto v1.7 and it worked! OK, the first call still resulted in the wrong is_pinned
information, but afterwards the information was updated properly. I'm closing this issue!
As I'm porting my app to TDLib 1.7, I'm using the new function
getChatPinnedMessage
to get the latest pinned message for a given chat. The function itself is absolutely reliable, but it seems that the message that is returned afterwards, doesn't always contain the correct value for theis_pinned
attribute. I've seen that in several chats, no matter if channels or supergroups - some work properly, some don't. One example is the official COVID-19 information channel by the German Federal Ministry of Health (https://t.me/corona_infokanal_bmg). Below you see the JSON request and response for thegetChatPinnedMessage
function - invoked for this channel. Do you have any explanation foris_pinned
beingfalse
here?Request
Response