connector: support messages sent by a channel

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
Co-authored-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
Sumner Evans
2024-09-03 13:34:13 -06:00
co-authored by Tulir Asokan
parent 8925318ec4
commit 3b6af95976
5 changed files with 78 additions and 10 deletions
+9
View File
@@ -216,6 +216,15 @@ func (t *TelegramClient) GetChatInfo(ctx context.Context, portal *bridgev2.Porta
// TODO save emojiset?
chatInfo.Members.IsFull = false
if !portal.Metadata.(*PortalMetadata).IsSuperGroup {
// Add the channel user
chatInfo.Members.MemberMap[ids.MakeUserID(id)] = bridgev2.ChatMember{
EventSender: bridgev2.EventSender{
SenderLogin: ids.MakeUserLoginID(id),
Sender: ids.MakeUserID(id),
},
}
}
// Just return the current user as a member if we can't view the
// participants or the max initial sync is 0.