5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-25 06:05:39 +00:00

Fix !users command for irc. Closes #78.

This commit is contained in:
Wim 2016-11-14 00:10:55 +01:00
parent 2d1316e32c
commit 02bd136040

View File

@ -55,9 +55,9 @@ func New(cfg config.Protocol, origin string, c chan config.Message) *Birc {
func (b *Birc) Command(msg *config.Message) string { func (b *Birc) Command(msg *config.Message) string {
switch msg.Text { switch msg.Text {
case "!users": case "!users":
b.i.AddCallback(ircm.RPL_NAMREPLY, b.storeNames)
b.i.AddCallback(ircm.RPL_ENDOFNAMES, b.endNames) b.i.AddCallback(ircm.RPL_ENDOFNAMES, b.endNames)
b.i.SendRaw("NAMES " + msg.Channel) b.i.SendRaw("NAMES " + msg.Channel)
b.i.ClearCallback(ircm.RPL_ENDOFNAMES)
} }
return "" return ""
} }
@ -169,7 +169,6 @@ func (b *Birc) handleNewConnection(event *irc.Event) {
i.AddCallback("PRIVMSG", b.handlePrivMsg) i.AddCallback("PRIVMSG", b.handlePrivMsg)
i.AddCallback("CTCP_ACTION", b.handlePrivMsg) i.AddCallback("CTCP_ACTION", b.handlePrivMsg)
i.AddCallback(ircm.RPL_TOPICWHOTIME, b.handleTopicWhoTime) i.AddCallback(ircm.RPL_TOPICWHOTIME, b.handleTopicWhoTime)
i.AddCallback(ircm.RPL_NAMREPLY, b.storeNames)
i.AddCallback(ircm.NOTICE, b.handleNotice) i.AddCallback(ircm.NOTICE, b.handleNotice)
//i.AddCallback(ircm.RPL_MYINFO, func(e *irc.Event) { flog.Infof("%s: %s", e.Code, strings.Join(e.Arguments[1:], " ")) }) //i.AddCallback(ircm.RPL_MYINFO, func(e *irc.Event) { flog.Infof("%s: %s", e.Code, strings.Join(e.Arguments[1:], " ")) })
i.AddCallback("PING", func(e *irc.Event) { i.AddCallback("PING", func(e *irc.Event) {