1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-discord.git synced 2024-11-27 00:22:55 +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 { if t.ChannelID != ch.id {
return return
} }
if t, err := NewTyper(ch.session.Store, t); err == nil {
if ch.guildID.Valid() { ti.AddTyper(t)
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
}
} }
}), nil }), nil
} }