From 78f42fde5c8cb54d5fc5490c26ae2a162027e091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Mon, 14 May 2018 11:09:29 +0200 Subject: [PATCH] xep_0384: add helper to access .text --- stanza.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/stanza.py b/stanza.py index db6205e..245df4c 100644 --- a/stanza.py +++ b/stanza.py @@ -132,7 +132,17 @@ class PreKeyPublic(ElementBase): namespace = OMEMO_BASE_NS name = 'preKeyPublic' plugin_attrib = name - interfaces = {'preKeyId'} + plugin_multi_attrib = 'prekeys' + interfaces = {'preKeyId', 'value'} + + def get_value(self): + return self.xml.text + + def set_value(self, value): + self.xml.text = str(value) + + def del_value(self): + self.xml.text = '' register_stanza_plugin(Message, Encrypted)