connector/ids: fix MakeMessageID

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-11-21 16:32:40 -07:00
parent 22f44734cf
commit 6b6a6ba275
+3 -2
View File
@@ -55,8 +55,9 @@ func MakeMessageID(rawChatID any, messageID int) networkid.MessageID {
var channelID int64
switch typedChatID := rawChatID.(type) {
case networkid.PortalKey:
if typedChatID.Receiver == "" {
_, channelID, _ = ParsePortalID(typedChatID.ID)
peerType, entityID, _ := ParsePortalID(typedChatID.ID)
if peerType == PeerTypeChannel {
channelID = entityID
}
case *tg.PeerChannel:
channelID = typedChatID.ChannelID