summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHorus32015-03-30 18:23:32 +0200
committerHorus32015-03-30 18:23:32 +0200
commit9a2e1da54913155a6164f9668c46d73e14dd35a8 (patch)
tree6530d3f6042e4314dc124299e6ea23ed1d697709
parenteddbcc31a45f5da8b9a67793dc43bb537e484d6a (diff)
downloadweb2irc-9a2e1da54913155a6164f9668c46d73e14dd35a8.tar.gz
Prevent parting from main channel.
-rw-r--r--handler.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/handler.go b/handler.go
index 4124b08..052c8ef 100644
--- a/handler.go
+++ b/handler.go
@@ -35,8 +35,10 @@ func WebhookHandler(w http.ResponseWriter, r *http.Request) {
log.Println("Sending private message to " + hook.Join + ": " + hook.Message)
con.Privmsg("#"+hook.Join, hook.Message)
- log.Println("Leaving #" + hook.Join)
- con.Part("#" + hook.Join)
+ if fjoin := os.Getenv("WEB2IRC_IRC_JOIN"); fjoin != hook.Join {
+ log.Println("Leaving #" + hook.Join)
+ con.Part("#" + hook.Join)
+ }
if hook.Target != "" {
log.Println("Sending private message to " + hook.Target + ": " + hook.Message)