comparison frontends/src/quick_frontend/quick_chat.py @ 1361:d3e9848b9574 frontends_multi_profiles

quick_frontend, primitivus (chat): pass a sorted list to Chat.setPresents
author souliane <souliane@mailoo.org>
date Wed, 11 Mar 2015 20:06:13 +0100
parents 8ea8fa13c351
children ba87b940f07a
comparison
equal deleted inserted replaced
1360:8ea8fa13c351 1361:d3e9848b9574
91 if mess_type != C.MESS_TYPE_GROUPCHAT and entity in self.targets: 91 if mess_type != C.MESS_TYPE_GROUPCHAT and entity in self.targets:
92 return True 92 return True
93 return False 93 return False
94 94
95 def setPresents(self, nicks): 95 def setPresents(self, nicks):
96 """Set the users presents in the contact list for a group chat 96 """Set the occupants of a group chat.
97 @param nicks: list of nicknames 97
98 """ 98 @param nicks (list[unicode]): sorted list of nicknames
99 log.debug (_("Adding users %s to room") % nicks) 99 """
100 if self.type != C.CHAT_GROUP: 100 log.debug(_("Adding users %s to room") % nicks)
101 log.error (_("[INTERNAL] trying to set presents nicks for a non group chat window")) 101 if self.type != C.CHAT_GROUP:
102 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here 102 log.error(_("[INTERNAL] trying to set presents nicks for a non group chat window"))
103 raise Exception("INTERNAL ERROR") # TODO: raise proper Exception here
103 self.occupants.update(nicks) 104 self.occupants.update(nicks)
104 105
105 def replaceUser(self, nick, show_info=True): 106 def replaceUser(self, nick, show_info=True):
106 """Add user if it is not in the group list""" 107 """Add user if it is not in the group list"""
107 log.debug (_("Replacing user %s") % nick) 108 log.debug (_("Replacing user %s") % nick)