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
path: root/nbxmpp
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-08-06 13:31:32 +0300
committerlovetox <philipp@hoerist.com>2020-09-23 00:21:15 +0300
commitddb5134fc83a98825d256336445e84a1ee1d9002 (patch)
treee30fb5073472b28cb351e919c89f6aae8415c39b /nbxmpp
parent192e8093dccc8462e6228a629ffbb622855b3eeb (diff)
Protocol: Add isError() and isResult() methods
Diffstat (limited to 'nbxmpp')
-rw-r--r--nbxmpp/protocol.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nbxmpp/protocol.py b/nbxmpp/protocol.py
index da11953..d7d134a 100644
--- a/nbxmpp/protocol.py
+++ b/nbxmpp/protocol.py
@@ -1072,6 +1072,12 @@ class Protocol(Node):
if timestamp is not None:
self.setTimestamp(timestamp)
+ def isError(self):
+ return self.getAttr('type') == 'error'
+
+ def isResult(self):
+ return self.getAttr('type') == 'result'
+
def getTo(self):
"""
Return value of the 'to' attribute