discordid: remove all ID-related casts

In the same vein as mautrix-whatsapp, -slack and others, do not make
assumptions about how the ID is represented in the connector code. Let
the discordid package be entirely responsible.
This commit is contained in:
Skip R
2026-02-01 21:03:17 -08:00
parent e7554b212f
commit 92352ce603
12 changed files with 134 additions and 76 deletions

View File

@@ -74,7 +74,7 @@ func (d *DiscordChatResync) avatar(ctx context.Context) *bridgev2.Avatar {
}
return &bridgev2.Avatar{
ID: networkid.AvatarID(ch.Icon),
ID: discordid.MakeAvatarID(ch.Icon),
Get: func(ctx context.Context) ([]byte, error) {
url := discordgo.EndpointGroupIcon(ch.ID, ch.Icon)
return simpleDownload(ctx, url, "group dm icon")
@@ -175,5 +175,5 @@ func (d *DiscordChatResync) CheckNeedsBackfill(ctx context.Context, latestBridge
zerolog.Ctx(ctx).Debug().Str("channel_id", d.channel.ID).Msg("Haven't bridged any messages at all, not forward backfilling")
return false, nil
}
return latestBridged.ID < networkid.MessageID(d.channel.LastMessageID), nil
return latestBridged.ID < discordid.MakeMessageID(d.channel.LastMessageID), nil
}