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:
@@ -107,14 +107,14 @@ func (mc *MessageConverter) ToDiscord(
|
||||
|
||||
if msg.ReplyTo != nil {
|
||||
req.Reference = &discordgo.MessageReference{
|
||||
ChannelID: string(msg.ReplyTo.Room.ID),
|
||||
MessageID: string(msg.ReplyTo.ID),
|
||||
ChannelID: discordid.ParsePortalID(msg.ReplyTo.Room.ID),
|
||||
MessageID: discordid.ParseMessageID(msg.ReplyTo.ID),
|
||||
}
|
||||
}
|
||||
|
||||
portal := msg.Portal
|
||||
guildID := msg.Portal.Metadata.(*discordid.PortalMetadata).GuildID
|
||||
channelID := string(portal.ID)
|
||||
channelID := discordid.ParsePortalID(portal.ID)
|
||||
content := msg.Content
|
||||
|
||||
convertMatrix := func() {
|
||||
|
||||
Reference in New Issue
Block a user