comparison frontends/quick_frontend/quick_app.py @ 53:6dfe5bb10008

Wix: groups in contact list, first draft
author Goffi <goffi@goffi.org>
date Sun, 10 Jan 2010 16:42:09 +1100
parents 6455fb62ff83
children a5b5fb5fc9fd
comparison
equal deleted inserted replaced
52:6455fb62ff83 53:6dfe5bb10008
115 self.setStatusOnline(False) 115 self.setStatusOnline(False)
116 return 116 return
117 117
118 if show != 'unavailable': 118 if show != 'unavailable':
119 name="" 119 name=""
120 group="" 120 groups = []
121 if self.rosterList.has_key(from_jid.short): 121 if self.rosterList.has_key(from_jid.short):
122 if self.rosterList[from_jid.short][0].has_key("name"): 122 if self.rosterList[from_jid.short][0].has_key("name"):
123 name=self.rosterList[from_jid.short][0]["name"] 123 name=self.rosterList[from_jid.short][0]["name"]
124 if len(self.rosterList[from_jid.short][1]): 124 groups=self.rosterList[from_jid.short][1]
125 group=self.rosterList[from_jid.short][1][0]
126 125
127 #FIXME: must be moved in a plugin 126 #FIXME: must be moved in a plugin
128 if from_jid.short in self.watched and not from_jid.short in self.onlineContact: 127 if from_jid.short in self.watched and not from_jid.short in self.onlineContact:
129 self.showAlert("Watched jid [%s] is connected !" % from_jid.short) 128 self.showAlert("Watched jid [%s] is connected !" % from_jid.short)
130 129
131 self.onlineContact.add(from_jid) #FIXME onlineContact is useless with CM, must be removed 130 self.onlineContact.add(from_jid) #FIXME onlineContact is useless with CM, must be removed
132 self.CM.add(from_jid) 131 self.CM.add(from_jid)
133 self.CM.update(from_jid, 'name', name) 132 self.CM.update(from_jid, 'name', name)
134 self.CM.update(from_jid, 'show', show) 133 self.CM.update(from_jid, 'show', show)
135 self.CM.update(from_jid, 'statuses', statuses) 134 self.CM.update(from_jid, 'statuses', statuses)
136 self.CM.update(from_jid, 'group', group) 135 self.CM.update(from_jid, 'groups', groups)
137 cache = self.bridge.getProfileCache(from_jid) 136 cache = self.bridge.getProfileCache(from_jid)
138 if cache.has_key('nick'): 137 if cache.has_key('nick'):
139 self.CM.update(from_jid, 'nick', cache['nick']) 138 self.CM.update(from_jid, 'nick', cache['nick'])
140 if cache.has_key('avatar'): 139 if cache.has_key('avatar'):
141 self.CM.update(from_jid, 'avatar', self.bridge.getAvatarFile(cache['avatar'])) 140 self.CM.update(from_jid, 'avatar', self.bridge.getAvatarFile(cache['avatar']))
186 self.onlineContact.remove(target.short) 185 self.onlineContact.remove(target.short)
187 except KeyError: 186 except KeyError:
188 pass 187 pass
189 188
190 def updatedValue(self, name, data): 189 def updatedValue(self, name, data):
191 print "toto"
192 print "updatedValue", name, data
193 if name == "profile_nick": 190 if name == "profile_nick":
194 target = JID(data['jid']) 191 target = JID(data['jid'])
195 self.CM.update(target, 'nick', data['nick']) 192 self.CM.update(target, 'nick', data['nick'])
196 self.contactList.replace(target) 193 self.contactList.replace(target)
197 elif name == "profile_avatar": 194 elif name == "profile_avatar":