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
This commit is contained in:
Goffi 2012-10-11 00:48:35 +02:00
commit 8ad8ca1933

View file

@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
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 @@ class QuickChat():
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):