summaryrefslogtreecommitdiffstats
path: root/bridge/irc/handlers.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-11-22 22:44:15 +0100
committerGitHub <noreply@github.com>2020-11-22 22:44:15 +0100
commit0c19716f44799fe0ab31b933538bad46c8cce5b9 (patch)
tree7b53ceef6307bae8ecae7b11a4812bb69c41f8ff /bridge/irc/handlers.go
parentb24e1bafa180870646bec6b42450d3077b3facd2 (diff)
downloadmatterbridge-msglm-0c19716f44799fe0ab31b933538bad46c8cce5b9.tar.gz
matterbridge-msglm-0c19716f44799fe0ab31b933538bad46c8cce5b9.tar.bz2
matterbridge-msglm-0c19716f44799fe0ab31b933538bad46c8cce5b9.zip
Join on invite (irc). Fixes #1231 (#1306)
Diffstat (limited to 'bridge/irc/handlers.go')
-rw-r--r--bridge/irc/handlers.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/bridge/irc/handlers.go b/bridge/irc/handlers.go
index aaaf42fb..6310f57e 100644
--- a/bridge/irc/handlers.go
+++ b/bridge/irc/handlers.go
@@ -67,6 +67,20 @@ func (b *Birc) handleFiles(msg *config.Message) bool {
return true
}
+func (b *Birc) handleInvite(client *girc.Client, event girc.Event) {
+ if len(event.Params) != 2 {
+ return
+ }
+
+ channel := event.Params[1]
+
+ b.Log.Debugf("got invite for %s", channel)
+
+ if _, ok := b.channels[channel]; ok {
+ b.i.Cmd.Join(channel)
+ }
+}
+
func (b *Birc) handleJoinPart(client *girc.Client, event girc.Event) {
if len(event.Params) == 0 {
b.Log.Debugf("handleJoinPart: empty Params? %#v", event)
@@ -117,6 +131,7 @@ func (b *Birc) handleNewConnection(client *girc.Client, event girc.Event) {
i.Handlers.Add("PART", b.handleJoinPart)
i.Handlers.Add("QUIT", b.handleJoinPart)
i.Handlers.Add("KICK", b.handleJoinPart)
+ i.Handlers.Add("INVITE", b.handleInvite)
}
func (b *Birc) handleNickServ() {