diff options
-rw-r--r-- | lib/rbot/ircbot.rb | 16 | ||||
-rw-r--r-- | lib/rbot/message.rb | 4 |
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 1e12ddcc..05e58de2 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -1203,15 +1203,15 @@ class Bot def irclogprivmsg(m) if(m.action?) if(m.private?) - irclog "* [#{m.source}(#{m.sourceaddress})] #{m.message}", m.source + irclog "* [#{m.source}(#{m.sourceaddress})] #{m.logmessage}", m.source else - irclog "* #{m.source} #{m.message}", m.target + irclog "* #{m.source} #{m.logmessage}", m.target end else if(m.public?) - irclog "<#{m.source}> #{m.message}", m.target + irclog "<#{m.source}> #{m.logmessage}", m.target else - irclog "[#{m.source}(#{m.sourceaddress})] #{m.message}", m.source + irclog "[#{m.source}(#{m.sourceaddress})] #{m.logmessage}", m.source end end end @@ -1248,18 +1248,18 @@ class Bot def irclogpart(m) if(m.address?) debug "left channel #{m.channel}" - irclog "@ Left channel #{m.channel} (#{m.message})", m.channel + irclog "@ Left channel #{m.channel} (#{m.logmessage})", m.channel else - irclog "@ #{m.source} left channel #{m.channel} (#{m.message})", m.channel + irclog "@ #{m.source} left channel #{m.channel} (#{m.logmessage})", m.channel end end def irclogkick(m) if(m.address?) debug "kicked from channel #{m.channel}" - irclog "@ You have been kicked from #{m.channel} by #{m.source} (#{m.message})", m.channel + irclog "@ You have been kicked from #{m.channel} by #{m.source} (#{m.logmessage})", m.channel else - irclog "@ #{m.target} has been kicked from #{m.channel} by #{m.source} (#{m.message})", m.channel + irclog "@ #{m.target} has been kicked from #{m.channel} by #{m.source} (#{m.logmessage})", m.channel end end diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index 9881503c..47994c10 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -122,6 +122,9 @@ module Irc # contents of the message attr_accessor :message + # contents of the message (for logging purposes) + attr_accessor :logmessage + # has the message been replied to/handled by a plugin? attr_accessor :replied @@ -152,6 +155,7 @@ module Irc warning "Message does not have identification" end end + @logmessage = @message.dup if target && target == @bot.myself @address = true |