]> jfr.im git - irc/quakenet/lua-labspace.git/commitdiff
Only allow addchan for existing channels.
authorshroud <redacted>
Fri, 21 Jun 2013 04:16:43 +0000 (06:16 +0200)
committershroud <redacted>
Fri, 21 Jun 2013 04:16:43 +0000 (06:16 +0200)
labspace.lua

index 2f757607cf24e981f0fa45c4d2b5cbb5321e43a3..7c1ce48f85ff15ead738e047877bb6fd1ec1afc0 100644 (file)
@@ -17,7 +17,6 @@
 
 -- TODO
 -- logging
--- addchan: only allow existing chans
 
 -- Ideas:
 -- scientists vote on kills
@@ -673,6 +672,11 @@ function ls_cmd_addchan(numeric, channel)
     return
   end
 
+  if not irc_getchaninfo(channel) then
+    ls_notice(numeric, "The specified channel does not exist.")
+    return
+  end
+
   if ls_is_game_channel(channel) then
     ls_notice(numeric, "The bot is already on that channel.")
     return