comparison participant.py @ 103:23416c27b592

New command system Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sat, 21 Nov 2009 16:26:09 +0100
parents 35e0ddf3b13c
children d062efcfbe9d
comparison
equal deleted inserted replaced
102:b3eba9489329 103:23416c27b592
23 from threading import Thread 23 from threading import Thread
24 from time import sleep 24 from time import sleep
25 25
26 26
27 class participant: 27 class participant:
28 def __init__(self, owner_bridge, protocol, nickname): 28 def __init__(self, owner_bridge, protocol, nickname, real_jid=None):
29 self.bot_admin = False
30 self.real_jid = real_jid
29 self.bridge = owner_bridge 31 self.bridge = owner_bridge
30 self.protocol = protocol 32 self.protocol = protocol
31 self.nickname = nickname 33 self.nickname = nickname
32 self.irc_connection = None 34 self.irc_connection = None
33 self.xmpp_c = None 35 self.xmpp_c = None
42 44
43 def createDuplicateOnXMPP(self): 45 def createDuplicateOnXMPP(self):
44 if isinstance(self.xmpp_c, xmpp.client.Client) or isinstance(self.irc_connection, ServerConnection) or self.bridge.mode == 'minimal' or self.nickname == 'ChanServ': 46 if isinstance(self.xmpp_c, xmpp.client.Client) or isinstance(self.irc_connection, ServerConnection) or self.bridge.mode == 'minimal' or self.nickname == 'ChanServ':
45 return 47 return
46 self.xmpp_c = self.bridge.bot.get_xmpp_connection(self.nickname) 48 self.xmpp_c = self.bridge.bot.get_xmpp_connection(self.nickname)
47 self.muc = xmpp.muc(self.bridge.xmpp_room.room_jid) 49 self.muc = xmpp.muc(self.bridge.xmpp_room_jid)
48 self.muc.join(self.xmpp_c, self.nickname, status='From IRC', callback=self._xmpp_join_callback) 50 self.muc.join(self.xmpp_c, self.nickname, status='From IRC', callback=self._xmpp_join_callback)
49 51
50 52
51 def _xmpp_join_callback(self, errors): 53 def _xmpp_join_callback(self, errors):
52 if len(errors) == 0: 54 if len(errors) == 0: