summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-06-16 21:07:33 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-06-16 21:07:33 +0200
commiteea0523e74b28acacb1156f10bc88b8191c37ce0 (patch)
tree6b4bbf567f01d7bec35f7e3f4dfc7a7688eac556
parent8f13bfa7bb8b734f259ff492dab86ea8ada0fcfb (diff)
irclog: log own CTCP message with correct syntax
-rw-r--r--lib/rbot/core/irclog.rb20
1 files changed, 19 insertions, 1 deletions
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