comparison libervia/web/pages/chat/_browser/__init__.py @ 1595:7941444c1671

pages: set `own_local_jid` to avoid confusion with `own_jid`: - `own_jid` is the real JID of the user. - `own_local_jid` is the JID used in chat, which can be real JID, or a room JID.
author Goffi <goffi@goffi.org>
date Wed, 13 Dec 2023 22:05:48 +0100
parents 9fc4120888be
children 52098b5bab8d
comparison
equal deleted inserted replaced
1594:93abef9a3548 1595:7941444c1671
13 from template import Template, safe 13 from template import Template, safe
14 from tools import is_touch_device 14 from tools import is_touch_device
15 15
16 log.warning = log.warn 16 log.warning = log.warn
17 profile = window.profile or "" 17 profile = window.profile or ""
18 own_jid = jid.JID(window.own_jid) 18 # JID used in the local chat (real JID for one2one, room JID otherwise)
19 own_local_jid = jid.JID(window.own_local_jid)
19 target_jid = jid.JID(window.target_jid) 20 target_jid = jid.JID(window.target_jid)
20 chat_type = window.chat_type 21 chat_type = window.chat_type
21 bridge = Bridge() 22 bridge = Bridge()
22 23
23 # Sensible value to consider that user is at the bottom 24 # Sensible value to consider that user is at the bottom
251 else: 252 else:
252 await cache.fill_identities([str(jid.JID(from_jid).bare)]) 253 await cache.fill_identities([str(jid.JID(from_jid).bare)])
253 from_jid = from_jid.bare 254 from_jid = from_jid.bare
254 255
255 return { 256 return {
256 "own_jid": own_jid, 257 "own_local_jid": str(own_local_jid),
258 "chat_type": chat_type,
257 "msg": { 259 "msg": {
258 "id": uid, 260 "id": uid,
259 "timestamp": extra.get("updated", timestamp), 261 "timestamp": extra.get("updated", timestamp),
260 "type": mess_type, 262 "type": mess_type,
261 "from_": str(from_jid), 263 "from_": str(from_jid),