summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rbot/ircbot.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 91c383a5..f5681338 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -272,6 +272,10 @@ class Bot
Config.register Config::IntegerValue.new('server.ping_timeout',
:default => 30, :validate => Proc.new{|v| v >= 0},
:desc => "reconnect if server doesn't respond to PING within this many seconds (set to 0 to disable)")
+ Config.register Config::ArrayValue.new('server.nocolor_modes',
+ :default => ['c'], :wizard => false,
+ :requires_restart => false,
+ :desc => "List of channel modes that require messages to be without colors")
Config.register Config::StringValue.new('irc.nick', :default => "rbot",
:desc => "IRC nickname the bot should attempt to use", :wizard => true,
@@ -929,8 +933,8 @@ class Bot
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')
+ # if target is a channel with nocolor modes, strip colours
+ if where.kind_of?(Channel) and where.mode.any?(*config['server.nocolor_modes'])
multi_line.replace BasicUserMessage.strip_formatting(multi_line)
end