msgconv: port the majority of embed and attachment bridging

We still need to implement direct media support, so for now we encrypt
and reupload to Matrix. Notably remaining is conversion to HTML.
This commit is contained in:
Skip R
2025-11-26 15:07:40 -08:00
parent 17fed9aca5
commit 86e18c1f7d
6 changed files with 514 additions and 27 deletions

View File

@@ -151,11 +151,11 @@ func (d *DiscordClient) LogoutRemote(ctx context.Context) {
func (cl *DiscordClient) BeginSyncingIfUserLoginPresent(ctx context.Context) {
if cl.UserLogin == nil {
cl.connector.bridge.Log.Warn().Msg("Not syncing just yet as we don't have a UserLogin")
cl.connector.Bridge.Log.Warn().Msg("Not syncing just yet as we don't have a UserLogin")
return
}
if cl.hasBegunSyncing {
cl.connector.bridge.Log.Warn().Msg("Not beginning sync more than once")
cl.connector.Bridge.Log.Warn().Msg("Not beginning sync more than once")
return
}
cl.hasBegunSyncing = true
@@ -251,7 +251,7 @@ func (d *DiscordClient) syncChannel(_ context.Context, ch *discordgo.Channel, se
members.TotalMemberCount = len(ch.Recipients)
}
d.connector.bridge.QueueRemoteEvent(d.UserLogin, &DiscordChatResync{
d.connector.Bridge.QueueRemoteEvent(d.UserLogin, &DiscordChatResync{
channel: ch,
portalKey: MakePortalKey(ch, d.UserLogin.ID, true),
info: &bridgev2.ChatInfo{