changeset 2322:310a454c8657

plugins invitation, XEP-0277: strip language, we don't want spaces
author Goffi <goffi@goffi.org>
date Wed, 12 Jul 2017 19:05:33 +0200
parents c2a9da96e40b
children 2dae79990122
files src/plugins/plugin_misc_invitations.py src/plugins/plugin_xep_0277.py
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_misc_invitations.py	Sun Jul 09 16:17:16 2017 +0200
+++ b/src/plugins/plugin_misc_invitations.py	Wed Jul 12 19:05:33 2017 +0200
@@ -254,7 +254,7 @@
         ## email
         language = kwargs.pop(u'language', None)
         if language is not None:
-            extra[u'language'] = language
+            extra[u'language'] = language.strip()
 
         if email is not None:
             extra[u'email'] = email
--- a/src/plugins/plugin_xep_0277.py	Sun Jul 09 16:17:16 2017 +0200
+++ b/src/plugins/plugin_xep_0277.py	Wed Jul 12 19:05:33 2017 +0200
@@ -192,7 +192,7 @@
 
         # language
         try:
-            microblog_data[u'language'] = entry_elt[(C.NS_XML, u'lang')]
+            microblog_data[u'language'] = entry_elt[(C.NS_XML, u'lang')].strip()
         except KeyError:
             pass
 
@@ -353,7 +353,7 @@
 
         ## language ##
         if u'language' in data:
-            entry_elt[(C.NS_XML, u'lang')] = data[u'language']
+            entry_elt[(C.NS_XML, u'lang')] = data[u'language'].strip()
 
         ## content and title ##
         synt = self.host.plugins["TEXT-SYNTAXES"]