Skip to content

Commit

Permalink
Fix typing indicator glitching out
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Mar 9, 2024
1 parent d0512a6 commit f6f5962
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions internal/gtkcord/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,13 @@ func (s *State) UserMarkup(gID discord.GuildID, u *discord.User, mods ...author.
func (s *State) UserIDMarkup(chID discord.ChannelID, uID discord.UserID, mods ...author.MarkupMod) string {
chs, err := s.Cabinet.Channel(chID)
if err != nil {
return uID.Mention()
return html.EscapeString(uID.Mention())
}

if chs.GuildID.IsValid() {
member, err := s.Cabinet.Member(chs.GuildID, uID)
if err != nil {
return uID.Mention()
return html.EscapeString(uID.Mention())
}

return s.MemberMarkup(chs.GuildID, &discord.GuildUser{
Expand All @@ -357,7 +357,7 @@ func (s *State) UserIDMarkup(chID discord.ChannelID, uID discord.UserID, mods ..
}
}

return uID.Mention()
return html.EscapeString(uID.Mention())
}

var overrideMemberColors = prefs.NewBool(false, prefs.PropMeta{
Expand Down
2 changes: 1 addition & 1 deletion internal/messages/typingindicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func NewTypingIndicator(ctx context.Context, chID discord.ChannelID) *TypingIndi
if ev.ChannelID != chID {
return
}
t.AddTyper(ev.UserID, ev.Timestamp)
t.AddTyperMember(ev.UserID, ev.Timestamp, ev.Member)
},
func(ev *gateway.MessageCreateEvent) {
if ev.ChannelID != chID {
Expand Down

0 comments on commit f6f5962

Please sign in to comment.