comparison src/browser/libervia_main.py @ 572:7a823c6568e2

browser_side: fixes a bug that arrived with the last changes on the JID class (this is related to how pyjamas handle the property decorator)
author souliane <souliane@mailoo.org>
date Fri, 17 Oct 2014 10:44:06 +0200
parents cd56f2b0e85b
children 12823bcbd05b
comparison
equal deleted inserted replaced
571:f0c8a4d51890 572:7a823c6568e2
772 if hasattr(plugin, 'presenceReceivedTrigger'): 772 if hasattr(plugin, 'presenceReceivedTrigger'):
773 plugin.presenceReceivedTrigger(entity_jid, show, priority, statuses) 773 plugin.presenceReceivedTrigger(entity_jid, show, priority, statuses)
774 774
775 def _roomJoinedCb(self, room_jid, room_nicks, user_nick): 775 def _roomJoinedCb(self, room_jid, room_nicks, user_nick):
776 _target = jid.JID(room_jid) 776 _target = jid.JID(room_jid)
777
778 # XXX: _target.node.startwith(...) raises an error "startswith is not a function"
779 # This happens when node a is property defined in the JID class
780 # FIXME: pyjamas doesn't handle the properties well
781 node = _target.node
782
777 if _target not in self.room_list: 783 if _target not in self.room_list:
778 self.room_list.append(_target) 784 self.room_list.append(_target)
779 chat_panel = panels.ChatPanel(self, _target, type_='group') 785 chat_panel = panels.ChatPanel(self, _target, type_='group')
780 chat_panel.setUserNick(user_nick) 786 chat_panel.setUserNick(user_nick)
781 if _target.node.startswith('sat_tarot_'): # XXX: it's not really beautiful, but it works :) 787 if node.startswith('sat_tarot_'): # XXX: it's not really beautiful, but it works :)
782 self.addTab("Tarot", chat_panel) 788 self.addTab("Tarot", chat_panel)
783 elif _target.node.startswith('sat_radiocol_'): 789 elif node.startswith('sat_radiocol_'):
784 self.addTab("Radio collective", chat_panel) 790 self.addTab("Radio collective", chat_panel)
785 else: 791 else:
786 self.addTab(_target.node, chat_panel) 792 self.addTab(_target.node, chat_panel)
787 chat_panel.setPresents(room_nicks) 793 chat_panel.setPresents(room_nicks)
788 chat_panel.historyPrint() 794 chat_panel.historyPrint()