Td: message_id mismatch

Created on 11 Feb 2018  路  4Comments  路  Source: tdlib/td

{u'message_id': 1205367472128, u'reply_markup': {u'rows': [[{u'text': u'Play Space Orbit', u'type': {u'@type': u'inlineKeyboardButtonTypeCallbackGame'}, u'@type': u'inlineKeyboardButton'}]], u'@type': u'replyMarkupInlineKeyboard'}, u'@type': u'updateMessageEdited', u'edit_date': 1518351439, u'chat_id': -1001075686122}

message_id received from tdjson is 1205367472128
but actual message id from bot api is 1149528 i can also confirm by going to https://t.me/mychannel/1149528

how to convert or get same message ids? am i missing something?

question

Most helpful comment

@levlam thanks for the help.
:)

All 4 comments

TDLib supports messages, which exists only locally, so it can't use server/Bot API message identifier as message_id and allow to sort messages only by message_id in the same time. To get server message_id from TDLib message_id, the latter should be checked to be divisible by 1048576 (2^20) and to be divided by 1048576. So 1205367472128 = 1149528 * 1048576 = (1149528 << 20).

@levlam thanks for the help.
:)

can you tell me why tdlib can't sort message by server message id?
i think its already in right order with +1 increment for new message.
why tdlib needs to multiply server message_id with 2^20 ?

Because there are many messages (e.g., currently sent messages or failed to sent messages) which has no server message id and must be placed between two consecutive server messages. We can't give them id like 123.5.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FJarvan picture FJarvan  路  3Comments

hmartinh picture hmartinh  路  5Comments

nikolayozhogov picture nikolayozhogov  路  5Comments

Invision70 picture Invision70  路  3Comments

L11R picture L11R  路  4Comments