Expose Application flag to displayname templates

Fixes #94
This commit is contained in:
Tulir Asokan
2023-06-21 01:38:56 +03:00
parent d39499cdcf
commit 200c4fc9d0
11 changed files with 61 additions and 36 deletions

View File

@@ -625,7 +625,7 @@ func (portal *Portal) handleDiscordMessageCreate(user *User, msg *discordgo.Mess
log.Debug().Msg("Starting handling of Discord message")
puppet := portal.bridge.GetPuppetByID(msg.Author.ID)
puppet.UpdateInfo(user, msg.Author, msg.WebhookID)
puppet.UpdateInfo(user, msg.Author, msg)
intent := puppet.IntentFor(portal)
var discordThreadID string
@@ -990,7 +990,7 @@ func (portal *Portal) handleDiscordTyping(evt *discordgo.TypingStart) {
func (portal *Portal) syncParticipant(source *User, participant *discordgo.User, remove bool) {
puppet := portal.bridge.GetPuppetByID(participant.ID)
puppet.UpdateInfo(source, participant, "")
puppet.UpdateInfo(source, participant, nil)
log := portal.log.With().
Str("participant_id", participant.ID).
Str("ghost_mxid", puppet.MXID.String()).
@@ -1017,7 +1017,7 @@ func (portal *Portal) syncParticipant(source *User, participant *discordgo.User,
func (portal *Portal) syncParticipants(source *User, participants []*discordgo.User) {
for _, participant := range participants {
puppet := portal.bridge.GetPuppetByID(participant.ID)
puppet.UpdateInfo(source, participant, "")
puppet.UpdateInfo(source, participant, nil)
user := portal.bridge.GetUserByID(participant.ID)
if user != nil {
@@ -1847,7 +1847,7 @@ func (portal *Portal) handleMatrixReaction(sender *User, evt *event.Event) {
func (portal *Portal) handleDiscordReaction(user *User, reaction *discordgo.MessageReaction, add bool, thread *Thread, member *discordgo.Member) {
puppet := portal.bridge.GetPuppetByID(reaction.UserID)
if member != nil {
puppet.UpdateInfo(user, member.User, "")
puppet.UpdateInfo(user, member.User, nil)
}
intent := puppet.IntentFor(portal)