Mercurial > libervia-web
comparison libervia/web/pages/chat/page_meta.py @ 1627:61449c5ddd70
browser (chat): Show all one2one message when profile own JID is used:
When profile own JID is used, we want to show all one2one message, and not only message
from the user themselve.
This behaviour can be seen as an "inbox" of the user.
rel 459
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 08 Jun 2025 17:27:44 +0200 |
parents | fdb5689fb826 |
children |
comparison
equal
deleted
inserted
replaced
1626:00abe08875f5 | 1627:61449c5ddd70 |
---|---|
78 room_subject = None | 78 room_subject = None |
79 chat_type = C.CHAT_ONE2ONE | 79 chat_type = C.CHAT_ONE2ONE |
80 own_local_jid = profile_jid | 80 own_local_jid = profile_jid |
81 rdata["chat_type"] = chat_type | 81 rdata["chat_type"] = chat_type |
82 template_data["own_local_jid"] = own_local_jid | 82 template_data["own_local_jid"] = own_local_jid |
83 filters = {} | |
84 from_jid_s = profile_jid.userhost() | |
85 to_jid_s = target_jid.bare | |
86 if from_jid_s == to_jid_s: | |
87 # If we are checking messages from user's profile, we show all one2one messages. | |
88 to_jid_s = "" | |
89 filters = {"not_types": C.CHAT_GROUP} | |
83 | 90 |
84 history = await self.host.bridge_call( | 91 history = await self.host.bridge_call( |
85 "history_get", | 92 "history_get", |
86 profile_jid.userhost(), | 93 from_jid_s, |
87 target_jid.bare, | 94 to_jid_s, |
88 20, | 95 20, |
89 True, | 96 True, |
90 {}, | 97 filters, |
91 profile, | 98 profile, |
92 ) | 99 ) |
93 | 100 |
94 authors = {m[2] for m in history} | 101 authors = {m[2] for m in history} |
95 identities = session.identities | 102 identities = session.identities |