mirror of
https://github.com/cwinfo/matterbridge.git
synced 2025-06-27 18:09:26 +00:00
Don't transmit typing events from ourselves (slack/discord) (#1056)
This commit is contained in:
@ -21,6 +21,7 @@ type Bdiscord struct {
|
||||
c *discordgo.Session
|
||||
|
||||
nick string
|
||||
userID string
|
||||
guildID string
|
||||
webhookID string
|
||||
webhookToken string
|
||||
@ -92,6 +93,7 @@ func (b *Bdiscord) Connect() error {
|
||||
}
|
||||
serverName := strings.Replace(b.GetString("Server"), "ID:", "", -1)
|
||||
b.nick = userinfo.Username
|
||||
b.userID = userinfo.ID
|
||||
b.channelsMutex.Lock()
|
||||
for _, guild := range guilds {
|
||||
if guild.Name == serverName || guild.ID == serverName {
|
||||
|
@ -36,6 +36,11 @@ func (b *Bdiscord) messageTyping(s *discordgo.Session, m *discordgo.TypingStart)
|
||||
return
|
||||
}
|
||||
|
||||
// Ignore our own typing messages
|
||||
if m.UserID == b.userID {
|
||||
return
|
||||
}
|
||||
|
||||
rmsg := config.Message{Account: b.Account, Event: config.EventUserTyping}
|
||||
rmsg.Channel = b.getChannelName(m.ChannelID)
|
||||
b.Remote <- rmsg
|
||||
|
Reference in New Issue
Block a user