Mercurial > libervia-backend
diff frontends/src/quick_frontend/quick_chat.py @ 510:886754295efe
quick frontend, primitivus, wix: MUC private messages management
/!\ not fully finished, backend part is not done yet /!\
- as resources are discarded to manage chat windows lists, a pretty dirty hack is done to work around this:
full jid is escaped using a prefix (it becomes invalid and resource is preserved).
- new quick_utils module, with helper methods. escapePrivate and unescapePrivate implementations
- MUC private messages are not managed in Wix yet
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 11 Oct 2012 00:48:35 +0200 |
parents | f98bef71a918 |
children | 862c0d6ab974 |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_chat.py Fri Sep 28 00:48:52 2012 +0200 +++ b/frontends/src/quick_frontend/quick_chat.py Thu Oct 11 00:48:35 2012 +0200 @@ -21,7 +21,7 @@ from logging import debug, info, warning, error from sat.tools.jid import JID - +from sat_frontends.quick_frontend.quick_utils import unescapePrivate class QuickChat(): @@ -110,6 +110,8 @@ def _get_nick(self, jid): """Return nick of this jid when possible""" + if jid.startswith(const_PRIVATE_PREFIX): + return unescapePrivate(jid).resource return jid.resource if self.type == "group" else (self.host.contact_list.getCache(jid,'nick') or self.host.contact_list.getCache(jid,'name') or jid.node) def printMessage(self, from_jid, msg, profile, timestamp):