Merge pull request #79 from vtluug/undo_long_messages

undo split messages
master
mutantmonkey 2017-12-30 13:34:15 +00:00 committed by GitHub
commit 55ae9ebbc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 13 deletions

13
irc.py
View File

@ -185,19 +185,6 @@ class Bot(asynchat.async_chat):
except UnicodeEncodeError as e: except UnicodeEncodeError as e:
return return
# Split long messages
maxlength = 430
if len(text) > maxlength:
first_message = text[0:maxlength].decode('utf-8','ignore')
line_break = len(first_message)
for i in range(len(first_message)-1,-1,-1):
if first_message[i] == " ":
line_break = i
break
self.msg(recipient, text.decode('utf-8','ignore')[0:line_break])
self.msg(recipient, text.decode('utf-8','ignore')[line_break+1:])
return
# No messages within the last 3 seconds? Go ahead! # No messages within the last 3 seconds? Go ahead!
# Otherwise, wait so it's been at least 0.8 seconds + penalty # Otherwise, wait so it's been at least 0.8 seconds + penalty
if self.stack: if self.stack: