chat_write: don't print strange chars; get_reply_data: strip \n
This commit is contained in:
@@ -25,7 +25,7 @@ def get_reply_data(data, field=0):
|
||||
else:
|
||||
if field > len(f):
|
||||
return None
|
||||
return f[field]
|
||||
return f[field].strip('\n')
|
||||
|
||||
def register_event(t, callback, args):
|
||||
joblist.append((t, callback, args))
|
||||
|
||||
@@ -83,6 +83,11 @@ def extract_title(url):
|
||||
def chat_write(message, prefix='/say '):
|
||||
set_conf('request_counter', conf('request_counter') + 1)
|
||||
|
||||
for m in message:
|
||||
if 0x20 > ord(m):
|
||||
logger('warn', 'strange char 0x%02x in chat_write(message), skipping' % ord(m))
|
||||
return False
|
||||
|
||||
if debug_enabled():
|
||||
print(message)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user