From 186ab44b233ee5fed347b76ed7b151e385aace06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 13 May 2018 14:26:54 +0200 Subject: [PATCH] xep_0384: Allowing editing .text with 'value' attr --- stanza.py | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/stanza.py b/stanza.py index 1ae9ccc..1a41f88 100644 --- a/stanza.py +++ b/stanza.py @@ -81,21 +81,48 @@ class SignedPreKeyPublic(ElementBase): namespace = OMEMO_BASE_NS name = 'signedPreKeyPublic' plugin_attrib = name - interfaces = {'signedPreKeyId'} + interfaces = {'signedPreKeyId', 'value'} + + def get_value(self): + return self.xml.text + + def set_value(self, value): + self.xml.text = value + + def del_value(self): + self.xml.text = '' class SignedPreKeySignature(ElementBase): namespace = OMEMO_BASE_NS name = 'signedPreKeySignature' plugin_attrib = name - interfaces = set() + interfaces = {'value'} + + def get_value(self): + return self.xml.text + + def set_value(self, value): + self.xml.text = value + + def del_value(self): + self.xml.text = '' class IdentityKey(ElementBase): namespace = OMEMO_BASE_NS name = 'identityKey' plugin_attrib = name - interfaces = set() + interfaces = {'value'} + + def get_value(self): + return self.xml.text + + def set_value(self, value): + self.xml.text = value + + def del_value(self): + self.xml.text = '' class PreKeys(ElementBase):