tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

message id of different chats (Channel, private chats etc.) could be match? #2419

Closed JnZn558 closed 1 year ago

JnZn558 commented 1 year ago

I would like to know about the message id of chats. Could these message id of different chats (channel, private chat etc.) be ever matched, or are they unique in all chats? that means, chat A has the id -10000000045 and has the message id -430000000067, chat B has the id 100000048, could chat B have the same id number but with different content?

Because currently I hold these message id in a map, then if it the case that different chat could have same message id number with diffenrent content, then the map that I am using would be overwritten by the last message.

AYMENJD commented 1 year ago

Message ID is unique only for the chat itself, not all chats. Means you can receive the same message ID but for different chat identifiers.

NOTE: Arithmetic operations must not be performed on message identifiers.