Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2019-07-26 11:28:12 +0300
committerPhilipp Hörist <philipp@hoerist.com>2019-07-26 11:28:12 +0300
commitde3727290a8c22c5a8aa165531bea0b64319020a (patch)
tree7e914f50bc212b07fe4f99f251cffe841fd79f8e /nbxmpp/modules
parent7b7746b7089b21fce460a5c2b53d0a56a3b1c293 (diff)
DataForms: Don't remove empty values
Old ejabberd servers dont accept missing value elements in text fields. This now does not delete the value element anymore if it's empty.
Diffstat (limited to 'nbxmpp/modules')
-rw-r--r--nbxmpp/modules/dataforms.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/nbxmpp/modules/dataforms.py b/nbxmpp/modules/dataforms.py
index 01746ab..2e5cbcf 100644
--- a/nbxmpp/modules/dataforms.py
+++ b/nbxmpp/modules/dataforms.py
@@ -342,10 +342,8 @@ class StringField(DataField):
@value.setter
def value(self, value):
- assert isinstance(value, str)
- if value == '' and not self.required:
- del self.value
- return
+ if value is None:
+ value = ''
self.setTagData('value', value)
@value.deleter