From eea0523e74b28acacb1156f10bc88b8191c37ce0 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 16 Jun 2008 21:07:33 +0200 Subject: irclog: log own CTCP message with correct syntax --- lib/rbot/core/irclog.rb | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rbot/core/irclog.rb b/lib/rbot/core/irclog.rb index 6ad2d4cc..507cdbe2 100644 --- a/lib/rbot/core/irclog.rb +++ b/lib/rbot/core/irclog.rb @@ -92,7 +92,25 @@ class IrcLogModule < CoreBotModule when NoticeMessage irclog "-#{m.source}- #{m.message}", m.target when PrivMessage - irclog "<#{m.source}> #{m.message}", m.target + logtarget = who = m.target + if m.ctcp + case m.ctcp.intern + when :ACTION + irclog "* #{m.source} #{m.logmessage}", logtarget + when :VERSION + irclog "@ #{m.source} asked #{who} about version info", logtarget + when :SOURCE + irclog "@ #{m.source} asked #{who} about source info", logtarget + when :PING + irclog "@ #{m.source} pinged #{who}", logtarget + when :TIME + irclog "@ #{m.source} asked #{who} what time it is", logtarget + else + irclog "@ #{m.source} asked #{who} about #{[m.ctcp, m.message].join(' ')}", logtarget + end + else + irclog "<#{m.source}> #{m.logmessage}", logtarget + end when QuitMessage m.was_on.each { |ch| irclog "@ quit (#{m.message})", ch -- cgit v1.2.3