Fix repeating bug.

This commit is contained in:
AZ Huang 2014-04-06 08:12:34 +08:00
parent 898f2ddf26
commit 0a71eb83a4

View file

@ -149,7 +149,7 @@ class SyncBot(Tox):
def on_group_message(self, groupnumber, friendgroupnumber, message): def on_group_message(self, groupnumber, friendgroupnumber, message):
name = self.group_peername(groupnumber, friendgroupnumber) name = self.group_peername(groupnumber, friendgroupnumber)
if name != NAME: if len(name) and name != NAME:
print('TOX> %s: %s' % (name, message)) print('TOX> %s: %s' % (name, message))
if message.startswith('>'): if message.startswith('>'):
message = '\x0309%s\x03' % message message = '\x0309%s\x03' % message
@ -161,7 +161,7 @@ class SyncBot(Tox):
def on_group_action(self, groupnumber, friendgroupnumber, action): def on_group_action(self, groupnumber, friendgroupnumber, action):
name = self.group_peername(groupnumber, friendgroupnumber) name = self.group_peername(groupnumber, friendgroupnumber)
if name != NAME: if len(name) and name != NAME:
print('TOX> %s: %s' % (name, action)) print('TOX> %s: %s' % (name, action))
if action.startswith('>'): if action.startswith('>'):
action = '\x0309%s\x03' % action action = '\x0309%s\x03' % action