summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-08-09 20:25:41 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-08-09 20:25:41 +0200
commit2d2e6d1fb24e5d687eab7e77bf251ad777ca736d (patch)
treedeb30af4990b4e3e2452019f4d95fce20051a7e5 /lib
parentbf8d3dc80f6103fdd8e2a629880ab0470d516d70 (diff)
message.rb: correct @plainmessage and @message for CTCP messages
After CTCP parsing, @plainmessage was not defined correctly (as it still contained the CTCP command), and @plainmessage and @message were not being cleaned up correctly. This manifested itself e.g. with spurious \001ACTION and other strange unusual byte sequence popping up in markov-generated text. Fix by redefining @plainmessage and @message appropriately in CTCP handling.
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/message.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb
index fe7b3cb0..5d6ea60f 100644
--- a/lib/rbot/message.rb
+++ b/lib/rbot/message.rb
@@ -357,6 +357,8 @@ module Irc
@action = @ctcp == 'ACTION'
debug "Received CTCP command #{@ctcp} with options #{@message} (action? #{@action})"
@logmessage = @message.dup
+ @plainmessage = BasicUserMessage.strip_formatting(@message)
+ @message = BasicUserMessage.strip_initial_formatting(@message)
end
# free splitting for plugins