gotd: ensure user is member of channels before starting getDifference loop

This commit is contained in:
Tulir Asokan
2025-12-12 15:45:39 +02:00
parent c1d92ce051
commit ba4dd48d5a
8 changed files with 88 additions and 31 deletions
+4
View File
@@ -107,6 +107,10 @@ func (t *TelegramClient) selfLeaveChat(ctx context.Context, portalKey networkid.
return nil
}
func (t *TelegramClient) onNotChannelMember(ctx context.Context, channelID int64) error {
return t.selfLeaveChat(ctx, t.makePortalKeyFromID(ids.PeerTypeChannel, channelID, 0), fmt.Errorf("startup channel member check failed"))
}
func (t *TelegramClient) onUpdateChannel(ctx context.Context, e tg.Entities, update *tg.UpdateChannel) error {
log := zerolog.Ctx(ctx).With().
Str("handler", "on_update_channel").