summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorChris Gahan <chris@ill-logic.com>2006-06-01 06:31:46 +0000
committerChris Gahan <chris@ill-logic.com>2006-06-01 06:31:46 +0000
commit3951af2a3551ae1c558242746f462a836d70cd8c (patch)
tree60638c3cf128e3b41f3f66f43aedca5ff7c56d16 /data
parentae8a977eb06d529038155f6679fefecee3ee7354 (diff)
Fixes #87 (from giuseppe.bilotta)
Diffstat (limited to 'data')
-rw-r--r--data/rbot/plugins/nickserv.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/data/rbot/plugins/nickserv.rb b/data/rbot/plugins/nickserv.rb
index 6e7a26b9..93b0b015 100644
--- a/data/rbot/plugins/nickserv.rb
+++ b/data/rbot/plugins/nickserv.rb
@@ -51,6 +51,7 @@ class NickServPlugin < Plugin
@registry[@bot.nick] = passwd
m.okay
end
+
def listnicks(m, params)
if @registry.length > 0
@registry.each {|k,v|
@@ -60,23 +61,33 @@ class NickServPlugin < Plugin
m.reply "none known"
end
end
- def identify(m, params)
+
+ def do_identify
if @registry.has_key?(@bot.nick)
@bot.sendmsg "PRIVMSG", "NickServ", "IDENTIFY #{@registry[@bot.nick]}"
+ return true
+ end
+ return false
+ end
+
+ def identify(m, params)
+ if do_identify
m.okay
else
m.reply "I dunno the nickserv password for the nickname #{@bot.nick} :("
end
end
+ def connect
+ do_identify
+ end
+
def listen(m)
return unless(m.kind_of? NoticeMessage)
if (m.sourcenick == "NickServ" && m.message =~ /IDENTIFY/)
debug "nickserv asked us to identify for nick #{@bot.nick}"
- if @registry.has_key?(@bot.nick)
- @bot.sendmsg "PRIVMSG", "NickServ", "IDENTIFY " + @registry[@bot.nick]
- end
+ do_identify
end
end