comparison browser_side/panels.py @ 267:a76243c02074

browser_side: changes regarding widgets and tabs: - getOrCreateLiberviaWidget gets a tab_label argument to add widgets in a specific tab - ChatPanel can be matched not only regarding the target jid but also the dialog type ("one2one", "group"...)
author souliane <souliane@mailoo.org>
date Sun, 17 Nov 2013 17:53:37 +0100
parents 2a93f8e6f989
children 9eb9c7d41bdc
comparison
equal deleted inserted replaced
266:cc778206b7ae 267:a76243c02074
726 self.host.contact_panel.setContactMessageWaiting(self.target.bare, False) 726 self.host.contact_panel.setContactMessageWaiting(self.target.bare, False)
727 self.content_scroll.scrollToBottom() 727 self.content_scroll.scrollToBottom()
728 728
729 def matchEntity(self, entity): 729 def matchEntity(self, entity):
730 """ 730 """
731 @param entity: target jid as a string or JID instance 731 @param entity: target jid as a string or JID instance.
732 Could also be a couple with a type in the second element.
732 @return: True if self matches the given entity 733 @return: True if self matches the given entity
733 """ 734 """
735 if isinstance(entity, tuple):
736 entity, type_ = entity if len(entity) > 1 else (entity[0], self.type)
737 else:
738 type_ = self.type
734 entity = entity if isinstance(entity, JID) else JID(entity) 739 entity = entity if isinstance(entity, JID) else JID(entity)
735 try: 740 try:
736 return self.target.bare == entity.bare 741 return self.target.bare == entity.bare and self.type == type_
737 except AttributeError as e: 742 except AttributeError as e:
738 e.include_traceback() 743 e.include_traceback()
739 return False 744 return False
740 745
741 def getWarningData(self): 746 def getWarningData(self):