Philipp Hörist pushed to branch retraction at gajim / gajim


Commits:
731e14fc by Philipp Hörist at 2025-04-19T08:37:29+02:00
imprv: Add fallback

- - - - -


2 changed files:

- gajim/common/const.py
- gajim/common/modules/message.py


Changes:

=====================================
gajim/common/const.py
=====================================
@@ -1098,3 +1098,7 @@ def __lt__(self, other: PresenceShowExt | PresenceShow) 
-> bool:
     4: '1.2',
     5: '1.3',
 }
+
+
+RETRACTION_FALLBACK = (
+    "/me retracted a previous message, but it's unsupported by your client.")


=====================================
gajim/common/modules/message.py
=====================================
@@ -16,6 +16,7 @@
 
 from gajim.common import app
 from gajim.common import types
+from gajim.common.const import RETRACTION_FALLBACK
 from gajim.common.events import MessageAcknowledged
 from gajim.common.events import MessageCorrected
 from gajim.common.events import MessageError
@@ -411,7 +412,8 @@ def build_message_stanza(self, message: OutgoingMessage) -> 
nbxmpp.Message:
 
         # XEP-0424
         if message.retraction_id is not None:
-            stanza.setRetracted(message.retraction_id)
+            stanza.setRetracted(
+                message.retraction_id, fallback_text=RETRACTION_FALLBACK)
 
         # XEP-0490
         if message.mds_id is not None:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/731e14fc813433e0c5668572c318a7f8883ff410

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/731e14fc813433e0c5668572c318a7f8883ff410
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to