Mercurial > libervia-backend
comparison frontends/src/primitivus/primitivus @ 688:f7878ad3c846
tools: renamed tools.jid.JID attribute "short" to "bare"
author | souliane <souliane@mailoo.org> |
---|---|
date | Tue, 29 Oct 2013 16:26:55 +0100 |
parents | af0d08a84cc6 |
children | 56aa0e98c92e |
comparison
equal
deleted
inserted
replaced
687:af0d08a84cc6 | 688:f7878ad3c846 |
---|---|
372 self.menu_roller.addMenu(_('Chat menu'), self.chat_wins[contact].getMenu()) | 372 self.menu_roller.addMenu(_('Chat menu'), self.chat_wins[contact].getMenu()) |
373 | 373 |
374 def newMessage(self, from_jid, to_jid, msg, _type, extra, profile): | 374 def newMessage(self, from_jid, to_jid, msg, _type, extra, profile): |
375 QuickApp.newMessage(self, from_jid, to_jid, msg, _type, extra, profile) | 375 QuickApp.newMessage(self, from_jid, to_jid, msg, _type, extra, profile) |
376 | 376 |
377 if not from_jid in self.contact_list and from_jid.short != self.profiles[profile]['whoami'].short: | 377 if not from_jid in self.contact_list and from_jid.bare != self.profiles[profile]['whoami'].bare: |
378 #XXX: needed to show entities which haven't sent any | 378 #XXX: needed to show entities which haven't sent any |
379 # presence information and which are not in roster | 379 # presence information and which are not in roster |
380 #TODO: put these entities in a "not in roster" list | 380 #TODO: put these entities in a "not in roster" list |
381 self.contact_list.replace(from_jid) | 381 self.contact_list.replace(from_jid) |
382 | 382 |
383 if JID(self.contact_list.selected).short != from_jid.short: | 383 if JID(self.contact_list.selected).bare != from_jid.bare: |
384 self.contact_list.putAlert(from_jid) | 384 self.contact_list.putAlert(from_jid) |
385 | 385 |
386 def _dialogOkCb(self, widget, data): | 386 def _dialogOkCb(self, widget, data): |
387 self.removePopUp() | 387 self.removePopUp() |
388 answer_cb = data[0] | 388 answer_cb = data[0] |
516 | 516 |
517 def onAddContact(self, button, edit): | 517 def onAddContact(self, button, edit): |
518 self.removePopUp() | 518 self.removePopUp() |
519 jid=JID(edit.get_edit_text()) | 519 jid=JID(edit.get_edit_text()) |
520 if jid.is_valid(): | 520 if jid.is_valid(): |
521 self.bridge.addContact(jid.short, profile_key=self.profile) | 521 self.bridge.addContact(jid.bare, profile_key=self.profile) |
522 else: | 522 else: |
523 message = _("'%s' is an invalid JID !") % jid | 523 message = _("'%s' is an invalid JID !") % jid |
524 error (message) | 524 error (message) |
525 self.showPopUp(sat_widgets.Alert(_("Error"), message, ok_cb=self.removePopUp)) | 525 self.showPopUp(sat_widgets.Alert(_("Error"), message, ok_cb=self.removePopUp)) |
526 | 526 |
621 if from_jid_s == "@ALL@": | 621 if from_jid_s == "@ALL@": |
622 for win in self.chat_wins: | 622 for win in self.chat_wins: |
623 self.chat_wins[win].updateChatState(state) | 623 self.chat_wins[win].updateChatState(state) |
624 return | 624 return |
625 | 625 |
626 from_bare = JID(from_jid_s).short | 626 from_bare = JID(from_jid_s).bare |
627 if from_bare in self.chat_wins: | 627 if from_bare in self.chat_wins: |
628 self.chat_wins[from_bare].updateChatState(state) | 628 self.chat_wins[from_bare].updateChatState(state) |
629 | 629 |
630 sat = PrimitivusApp() | 630 sat = PrimitivusApp() |
631 sat.start() | 631 sat.start() |