comparison sat.tac @ 72:f271fff3a713

MUC implementation: first draft /!\ the experimental muc branche of wokkel must be used - bridge: new roomJoined signal - wix: contact list widget is now in a separate file, and manage different kinds of presentation - wix: chat window now manage group chat (first draft, not working yet) - wix: constants are now in a separate class, so then can be accessible from everywhere - wix: new menu to join room (do nothing yet, except entering in a test room) - new plugin for xep 0045 (MUC), use wokkel experimental MUC branch - plugins: the profile is now given for get_handler, cause it can be used internally by a plugin (e.g.: xep-0045 plugin)
author Goffi <goffi@goffi.org>
date Sun, 21 Mar 2010 10:28:55 +1100
parents 86f1f7f6d332
children db0a0f000e37
comparison
equal deleted inserted replaced
71:efe81b61673c 72:f271fff3a713
183 def __init__(self, host): 183 def __init__(self, host):
184 xmppim.PresenceClientProtocol.__init__(self) 184 xmppim.PresenceClientProtocol.__init__(self)
185 self.host = host 185 self.host = host
186 186
187 def availableReceived(self, entity, show=None, statuses=None, priority=0): 187 def availableReceived(self, entity, show=None, statuses=None, priority=0):
188 info (_("presence update for [%s]"), entity) 188 debug (_("presence update for [%(entity)s] (available, show=%(show)s statuses=%(statuses)s priority=%(priority)d)") % {'entity':entity, 'show':show, 'statuses':statuses, 'priority':priority})
189 189
190 if statuses.has_key(None): #we only want string keys 190 if statuses.has_key(None): #we only want string keys
191 statuses["default"] = statuses[None] 191 statuses["default"] = statuses[None]
192 del statuses[None] 192 del statuses[None]
193 193
197 #now it's time to notify frontends 197 #now it's time to notify frontends
198 self.host.bridge.presenceUpdate(entity.full(), show or "", 198 self.host.bridge.presenceUpdate(entity.full(), show or "",
199 int(priority), statuses, self.parent.profile) 199 int(priority), statuses, self.parent.profile)
200 200
201 def unavailableReceived(self, entity, statuses=None): 201 def unavailableReceived(self, entity, statuses=None):
202 debug (_("presence update for [%(entity)s] (unavailable, statuses=%(statuses)s)") % {'entity':entity, 'statuses':statuses})
202 if statuses and statuses.has_key(None): #we only want string keys 203 if statuses and statuses.has_key(None): #we only want string keys
203 statuses["default"] = statuses[None] 204 statuses["default"] = statuses[None]
204 del statuses[None] 205 del statuses[None]
205 self.host.memory.addPresenceStatus(entity, "unavailable", 0, statuses, self.parent.profile) 206 self.host.memory.addPresenceStatus(entity, "unavailable", 0, statuses, self.parent.profile)
206 207
414 415
415 debug (_("setting plugins parents")) 416 debug (_("setting plugins parents"))
416 417
417 for plugin in self.plugins.iteritems(): 418 for plugin in self.plugins.iteritems():
418 if plugin[1].is_handler: 419 if plugin[1].is_handler:
419 plugin[1].getHandler().setHandlerParent(current) 420 plugin[1].getHandler(profile).setHandlerParent(current)
420 421
421 current.startService() 422 current.startService()
422 423
423 def disconnect(self, profile_key='@DEFAULT@'): 424 def disconnect(self, profile_key='@DEFAULT@'):
424 """disconnect from jabber server""" 425 """disconnect from jabber server"""