]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/ircbot.rb
Urban can now grab the first page of definitions.
[user/henk/code/ruby/rbot.git] / lib / rbot / ircbot.rb
index 9aef8408276328771219e17cfee1bf53c4a1eace..932cc3b7322fb8ac73ebdcdcb61b581f15bd2c87 100644 (file)
@@ -671,6 +671,7 @@ class Bot
     }
     @client[:join] = proc {|data|
       m = JoinMessage.new(self, server, data[:source], data[:channel], data[:message])
+      sendq("MODE #{data[:channel]}", nil, 0) if m.address?
       @plugins.irc_delegate("join", m)
       sendq("WHO #{data[:channel]}", data[:channel], 2) if m.address?
     }
@@ -913,6 +914,12 @@ class Bot
     end
 
     multi_line = original_message.to_s.gsub(/[\r\n]+/, "\n")
+
+    # if target is a channel with +c or +C modes, strip colours
+    if where.kind_of?(Channel) and where.mode.any?('c', 'C')
+      multi_line.replace(BasicUserMessage.stripcolour(multi_line).gsub(AttributeRx,''))
+    end
+
     messages = Array.new
     case opts[:newlines]
     when :join