summaryrefslogtreecommitdiffstats
path: root/bridge/irc/irc.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-10-23 14:11:21 +0200
committerWim <wim@42.be>2016-10-23 18:19:11 +0200
commit4380c48b4be7c2137a81225bfdf42a2ac37927de (patch)
treec8d40fcab549e366113ac274b79b3a681aabecbf /bridge/irc/irc.go
parentdb0e4ba8c5d290160411e7be889609bb41bef174 (diff)
downloadmatterbridge-msglm-4380c48b4be7c2137a81225bfdf42a2ac37927de.tar.gz
matterbridge-msglm-4380c48b4be7c2137a81225bfdf42a2ac37927de.tar.bz2
matterbridge-msglm-4380c48b4be7c2137a81225bfdf42a2ac37927de.zip
Add irc names callback only on command. Fixes #51
Diffstat (limited to 'bridge/irc/irc.go')
-rw-r--r--bridge/irc/irc.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/bridge/irc/irc.go b/bridge/irc/irc.go
index 833fd569..9c391500 100644
--- a/bridge/irc/irc.go
+++ b/bridge/irc/irc.go
@@ -44,7 +44,9 @@ func New(config config.Protocol, origin string, c chan config.Message) *Birc {
func (b *Birc) Command(msg *config.Message) string {
switch msg.Text {
case "!users":
+ b.i.AddCallback(ircm.RPL_ENDOFNAMES, b.endNames)
b.i.SendRaw("NAMES " + msg.Channel)
+ b.i.ClearCallback(ircm.RPL_ENDOFNAMES)
}
return ""
}
@@ -133,7 +135,6 @@ func (b *Birc) handleNewConnection(event *irc.Event) {
i.AddCallback("PRIVMSG", b.handlePrivMsg)
i.AddCallback("CTCP_ACTION", b.handlePrivMsg)
i.AddCallback(ircm.RPL_TOPICWHOTIME, b.handleTopicWhoTime)
- i.AddCallback(ircm.RPL_ENDOFNAMES, b.endNames)
i.AddCallback(ircm.RPL_NAMREPLY, b.storeNames)
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:], " ")) })