From 2f909788778208bac970faa2128949bcb3bc6c01 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 28 Oct 2006 08:27:01 +0000 Subject: Too much stuff was being sent with each line, go back to 400 bytes max --- lib/rbot/ircbot.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/rbot') diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 4bf3e8d3..4be0c444 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -650,10 +650,12 @@ class IrcBot # relevant say() or notice() methods. This one should be used for IRCd # extensions you want to use in modules. def sendmsg(type, where, message, chan=nil, ring=0) - # Split the message so that each line sent is not longher than 510 bytes + # Split the message so that each line sent is not longher than 400 bytes # TODO allow something to do for commands that produce too many messages # TODO example: math 10**10000 - left = 510 - type.length - where.to_s.length - 3 + # TODO try to use the maximum line length allowed by the server, if there is + # a way to know what it is + left = 400 - type.length - where.to_s.length - 3 begin if(left >= message.length) sendq "#{type} #{where} :#{message}", chan, ring -- cgit v1.2.3