Mercurial > libervia-backend
comparison frontends/src/quick_frontend/quick_app.py @ 955:cad958239b5c
quick frontends: first connection fixes
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 31 Mar 2014 15:22:35 +0200 |
parents | 71926ec2114d |
children | d1084f7e56a5 |
comparison
equal
deleted
inserted
replaced
954:5925c9ebfcd2 | 955:cad958239b5c |
---|---|
316 presences = self.profiles[profile].setdefault('presences', {}) | 316 presences = self.profiles[profile].setdefault('presences', {}) |
317 | 317 |
318 if show != 'unavailable': | 318 if show != 'unavailable': |
319 | 319 |
320 #FIXME: must be moved in a plugin | 320 #FIXME: must be moved in a plugin |
321 if from_jid.bare in self.profiles[profile]['watched'] and not from_jid.bare in self.profiles[profile]['onlineContact']: | 321 if from_jid.bare in self.profiles[profile].get('watched',[]) and not from_jid.bare in self.profiles[profile]['onlineContact']: |
322 self.showAlert(_("Watched jid [%s] is connected !") % from_jid.bare) | 322 self.showAlert(_("Watched jid [%s] is connected !") % from_jid.bare) |
323 | 323 |
324 presences[jabber_id] = {'show': show, 'priority': priority, 'statuses': statuses} | 324 presences[jabber_id] = {'show': show, 'priority': priority, 'statuses': statuses} |
325 self.profiles[profile]['onlineContact'].add(from_jid) # FIXME onlineContact is useless with CM, must be removed | 325 self.profiles[profile].setdefault('onlineContact',set()).add(from_jid) # FIXME onlineContact is useless with CM, must be removed |
326 | 326 |
327 #TODO: vcard data (avatar) | 327 #TODO: vcard data (avatar) |
328 | 328 |
329 if show == "unavailable" and from_jid in self.profiles[profile]['onlineContact']: | 329 if show == "unavailable" and from_jid in self.profiles[profile].get('onlineContact',set()): |
330 try: | 330 try: |
331 del presences[jabber_id] | 331 del presences[jabber_id] |
332 except KeyError: | 332 except KeyError: |
333 pass | 333 pass |
334 self.profiles[profile]['onlineContact'].remove(from_jid) | 334 self.profiles[profile]['onlineContact'].remove(from_jid) |