Mercurial > libervia-backend
diff frontends/src/quick_frontend/quick_app.py @ 513:8ee9113d307b
core, quick_frontend, primitivus, wixi, bridge: fixed delayed message timestamp:
- new "extra" parameter in newMessage signal
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 20 Oct 2012 17:23:56 +0200 |
parents | 886754295efe |
children | 0bb595eff25b |
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py Wed Oct 17 00:35:48 2012 +0200 +++ b/frontends/src/quick_frontend/quick_app.py Sat Oct 20 17:23:56 2012 +0200 @@ -235,7 +235,7 @@ _groups = list(groups) self.contact_list.replace(entity, _groups, attributes) - def _newMessage(self, from_jid_s, msg, _type, to_jid_s, profile): + def _newMessage(self, from_jid_s, msg, _type, to_jid_s, extra, profile): """newMessage premanagement: a dirty hack to manage private messages if a private MUC message is detected, from_jid or to_jid is prefixed and resource is escaped""" if not self.check_profile(profile): @@ -259,16 +259,17 @@ if new_jid not in self.contact_list: self.contact_list.add(new_jid) - self.newMessage(from_jid, to_jid, msg, _type, profile) + self.newMessage(from_jid, to_jid, msg, _type, extra, profile) - def newMessage(self, from_jid, to_jid, msg, _type, profile): + def newMessage(self, from_jid, to_jid, msg, _type, extra, profile): from_me = from_jid.short == self.profiles[profile]['whoami'].short win = to_jid if from_me else from_jid self.current_action_ids = set() self.current_action_ids_cb = {} - self.chat_wins[win.short].printMessage(from_jid, msg, profile) + timestamp = extra.get('archive') + self.chat_wins[win.short].printMessage(from_jid, msg, profile, float(timestamp) if timestamp else '') def sendMessage(self, to_jid, message, subject='', mess_type="auto", profile_key="@DEFAULT@"): if to_jid.startswith(const_PRIVATE_PREFIX):