comparison frontends/quick_frontend/quick_chat.py @ 132:a86607e5cf38

quick_app: self.occupants for group chat are now managed by quick_chat. self.options.profile now support unicode
author Goffi <goffi@goffi.org>
date Fri, 16 Jul 2010 20:12:54 +0800
parents 1ca5f254ce41
children 80661755ea8d
comparison
equal deleted inserted replaced
131:6cad483a6d84 132:a86607e5cf38
46 """ 46 """
47 debug (_("Adding users %s to room") % nicks) 47 debug (_("Adding users %s to room") % nicks)
48 if self.type != "group": 48 if self.type != "group":
49 error (_("[INTERNAL] trying to set presents nicks for a non group chat window")) 49 error (_("[INTERNAL] trying to set presents nicks for a non group chat window"))
50 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here 50 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here
51 self.occupants.update(nicks)
51 52
52 def replaceUser(self, nick): 53 def replaceUser(self, nick):
53 """Add user if it is not in the group list""" 54 """Add user if it is not in the group list"""
54 debug (_("Replacing user %s") % nick) 55 debug (_("Replacing user %s") % nick)
55 if self.type != "group": 56 if self.type != "group":
56 error (_("[INTERNAL] trying to replace user for a non group chat window")) 57 error (_("[INTERNAL] trying to replace user for a non group chat window"))
57 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here 58 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here
59 self.occupants.add(nick)
58 60
59 def setUserNick(self, nick): 61 def setUserNick(self, nick):
60 """Set the nick of the user, usefull for e.g. change the color of the user""" 62 """Set the nick of the user, usefull for e.g. change the color of the user"""
61 self.nick = nick 63 self.nick = nick
62 64
64 """Remove a user from the group list""" 66 """Remove a user from the group list"""
65 debug(_("Removing user %s") % nick) 67 debug(_("Removing user %s") % nick)
66 if self.type != "group": 68 if self.type != "group":
67 error (_("[INTERNAL] trying to remove user for a non group chat window")) 69 error (_("[INTERNAL] trying to remove user for a non group chat window"))
68 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here 70 raise Exception("INTERNAL ERROR") #TODO: raise proper Exception here
71 self.occupants.remove(nick)
69 72
70 def setSubject(self, subject): 73 def setSubject(self, subject):
71 """Set title for a group chat""" 74 """Set title for a group chat"""
72 debug(_("Setting subject to %s") % subject) 75 debug(_("Setting subject to %s") % subject)
73 if self.type != "group": 76 if self.type != "group":