Mercurial > libervia-backend
comparison libervia/backend/plugins/plugin_xep_0424.py @ 4381:3c97717fd662
plugin XEP-0428: Add missing "for" attribute:
The "for" attribute was missing from <fallback> element.
rel 461
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 04 Jul 2025 12:30:20 +0200 |
parents | 79d463e3fdeb |
children |
comparison
equal
deleted
inserted
replaced
4380:2e3ce128973c | 4381:3c97717fd662 |
---|---|
14 | 14 |
15 # You should have received a copy of the GNU Affero General Public License | 15 # You should have received a copy of the GNU Affero General Public License |
16 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
18 import time | 18 import time |
19 from typing import Any, Dict | 19 from typing import Any, Dict, cast |
20 | 20 |
21 from sqlalchemy.orm.attributes import flag_modified | 21 from sqlalchemy.orm.attributes import flag_modified |
22 from twisted.internet import defer | 22 from twisted.internet import defer |
23 from twisted.words.protocols.jabber import jid, xmlstream | 23 from twisted.words.protocols.jabber import jid, xmlstream |
24 from twisted.words.xish import domish | 24 from twisted.words.xish import domish |
29 from libervia.backend.core.constants import Const as C | 29 from libervia.backend.core.constants import Const as C |
30 from libervia.backend.core.core_types import MessageDataLegacy, SatXMPPEntity | 30 from libervia.backend.core.core_types import MessageDataLegacy, SatXMPPEntity |
31 from libervia.backend.core.i18n import D_, _ | 31 from libervia.backend.core.i18n import D_, _ |
32 from libervia.backend.core.log import getLogger | 32 from libervia.backend.core.log import getLogger |
33 from libervia.backend.memory.sqla_mapping import History | 33 from libervia.backend.memory.sqla_mapping import History |
34 from libervia.backend.plugins.plugin_xep_0428 import XEP_0428 | |
34 from libervia.backend.tools.common import data_format | 35 from libervia.backend.tools.common import data_format |
35 | 36 |
36 log = getLogger(__name__) | 37 log = getLogger(__name__) |
37 | 38 |
38 | 39 |
109 message_elt["from"] = client.jid.full() | 110 message_elt["from"] = client.jid.full() |
110 message_elt["to"] = peer_jid.full() | 111 message_elt["to"] = peer_jid.full() |
111 message_elt["type"] = history.type | 112 message_elt["type"] = history.type |
112 retract_elt = message_elt.addElement((NS_MESSAGE_RETRACT, "retract")) | 113 retract_elt = message_elt.addElement((NS_MESSAGE_RETRACT, "retract")) |
113 retract_elt["id"] = retract_id | 114 retract_elt["id"] = retract_id |
114 self.host.plugins["XEP-0428"].add_fallback_elt( | 115 fallback = cast(XEP_0428, self.host.plugins["XEP-0428"]) |
116 fallback.add_fallback_elt( | |
115 message_elt, | 117 message_elt, |
118 NS_MESSAGE_RETRACT, | |
116 "[A message retraction has been requested, but your client doesn't support " | 119 "[A message retraction has been requested, but your client doesn't support " |
117 "it]", | 120 "it]", |
118 ) | 121 ) |
119 self._h.add_hint_elements(message_elt, [self._h.HINT_STORE]) | 122 self._h.add_hint_elements(message_elt, [self._h.HINT_STORE]) |
120 client.send(message_elt) | 123 client.send(message_elt) |