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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user