1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-discord.git synced 2024-11-22 22:22:59 +00:00

Fixed typing events

This commit is contained in:
diamondburned (Forefront) 2020-07-03 11:43:45 -07:00
parent fef47e3574
commit 4ecbbbe114

View file

@ -431,34 +431,8 @@ func (ch *Channel) TypingSubscribe(ti cchat.TypingIndicator) (func(), error) {
if t.ChannelID != ch.id {
return
}
if ch.guildID.Valid() {
g, err := ch.session.Store.Guild(t.GuildID)
if err != nil {
return
}
if t.Member == nil {
t.Member, err = ch.session.Store.Member(t.GuildID, t.UserID)
if err != nil {
return
}
}
ti.AddTyper(NewTyper(NewGuildMember(*t.Member, *g), t))
return
}
c, err := ch.self()
if err != nil {
return
}
for _, user := range c.DMRecipients {
if user.ID == t.UserID {
ti.AddTyper(NewTyper(NewUser(user), t))
return
}
if t, err := NewTyper(ch.session.Store, t); err == nil {
ti.AddTyper(t)
}
}), nil
}