Correction: privmsg and rawsend must be unicode aware.

pull/1/head
Jadjay 2016-06-21 20:33:08 +02:00
parent 5c347d82f7
commit c8bd6830ee
1 changed files with 7 additions and 7 deletions

View File

@ -763,12 +763,12 @@ class ServerConnection(Connection):
def privmsg(self, target, text):
"""Send a PRIVMSG command."""
# Should limit len(text) here!
self.send_raw("PRIVMSG %s :%s" % (target, text))
self.send_raw(u'PRIVMSG %s :%s' % (target, text))
def privmsg_many(self, targets, text):
"""Send a PRIVMSG command to multiple targets."""
# Should limit len(text) here!
self.send_raw("PRIVMSG %s :%s" % (",".join(targets), text))
self.send_raw(u'PRIVMSG %s :%s' % (','.join(targets), text))
def quit(self, message=""):
"""Send a QUIT command."""
@ -782,17 +782,17 @@ class ServerConnection(Connection):
The string will be padded with appropriate CR LF.
"""
if self.socket is None:
raise ServerNotConnectedError, "Not connected."
raise ServerNotConnectedError, u'Not connected.'
try:
if self.ssl:
self.ssl.write(string + "\r\n")
self.ssl.write(string + u'\r\n')
else:
self.socket.send(string + "\r\n")
self.socket.send(string + u'\r\n')
if DEBUG:
print "TO SERVER:", string
print u'TO SERVER:', string
except socket.error, x:
# Ouch!
self.disconnect("Connection reset by peer.")
self.disconnect(u'Connection reset by peer.')
def squit(self, server, comment=""):
"""Send an SQUIT command."""