[Git][gajim/python-nbxmpp][master] 3 commits: Fix nickname parsing

Philipp Hörist gitlab at dev.gajim.org
Tue Jan 1 12:53:50 CET 2019


Philipp Hörist pushed to branch master at gajim / python-nbxmpp


Commits:
55e4ec4f by Philipp Hörist at 2019-01-01T11:52:27Z
Fix nickname parsing

- - - - -
ae343483 by Philipp Hörist at 2019-01-01T11:53:26Z
Add str method to ErrorProperties

- - - - -
0ee912a2 by Philipp Hörist at 2019-01-01T11:53:42Z
Add property for self presence

- - - - -


2 changed files:

- nbxmpp/modules/nickname.py
- nbxmpp/structs.py


Changes:

=====================================
nbxmpp/modules/nickname.py
=====================================
@@ -53,7 +53,7 @@ class Nickname:
 
     @staticmethod
     def _parse_nickname(stanza):
-        nickname = stanza.getTagData('nick', namespace=NS_NICK)
-        if not nickname:
+        nickname = stanza.getTag('nick', namespace=NS_NICK)
+        if nickname is None:
             return
-        return nickname
+        return nickname.getData() or None


=====================================
nbxmpp/structs.py
=====================================
@@ -141,6 +141,10 @@ class PresenceProperties:
         self.muc_nickname = None
         self.muc_destroyed = None
 
+    @property
+    def is_self_presence(self):
+        return self.self_presence
+
     @property
     def is_muc_destroyed(self):
         return self.muc_destroyed is not None
@@ -222,6 +226,9 @@ class ErrorProperties:
         self.legacy_type = stanza.getErrorType()
         self.message = stanza.getErrorMsg()
 
+    def __str__(self):
+        return '%s %s' % (self.type, self.message)
+
 
 class BaseResult:
     @property



View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/compare/3959f58046e4f30b417e5bcb615e6fe89a57b489...0ee912a2923d897c34f462a987866b8144a19425

-- 
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/compare/3959f58046e4f30b417e5bcb615e6fe89a57b489...0ee912a2923d897c34f462a987866b8144a19425
You're receiving this email because of your account on dev.gajim.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gajim.org/pipermail/commits/attachments/20190101/7fa46e5d/attachment-0001.html>


More information about the Commits mailing list