always add self when creating DM portals

Clients will leave rooms automatically when they realize that they
aren't actually members of the channel.
This commit is contained in:
Skip R
2025-11-24 13:03:40 -08:00
parent 4e41c2f227
commit f04a8658d9
2 changed files with 19 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ package connector
import (
"github.com/bwmarrin/discordgo"
"maunium.net/go/mautrix/bridgev2"
"maunium.net/go/mautrix/bridgev2/networkid"
)
@@ -28,3 +29,11 @@ func (d *DiscordClient) makePortalKey(ch *discordgo.Channel, userLoginID network
}
return
}
func (d *DiscordClient) makeEventSender(user *discordgo.User) bridgev2.EventSender {
return bridgev2.EventSender{
IsFromMe: user.ID == d.Session.State.User.ID,
SenderLogin: d.UserLogin.ID,
Sender: networkid.UserID(user.ID),
}
}