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-02-09 22:49:09 +0300
committerPhilipp Hörist <philipp@hoerist.com>2019-02-09 22:49:09 +0300
commit622a456648aaef22fb73a3033cb54bc0657f0b16 (patch)
tree72e02495aa6e1ffd006ae86cb7792a36c4510d73 /nbxmpp/structs.py
parent135a5d84ccfcb6d4664259599c9c42080f277466 (diff)
Add OpenPGP (XEP-0373) module
Diffstat (limited to 'nbxmpp/structs.py')
-rw-r--r--nbxmpp/structs.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/nbxmpp/structs.py b/nbxmpp/structs.py
index 2cf92a6..d22d5b6 100644
--- a/nbxmpp/structs.py
+++ b/nbxmpp/structs.py
@@ -59,7 +59,8 @@ HTTPAuthData.__new__.__defaults__ = (None, None, None, None)
StanzaIDData = namedtuple('StanzaIDData', 'id by')
StanzaIDData.__new__.__defaults__ = (None, None)
-PubSubEventData = namedtuple('PubSubEventData', 'node id item data empty')
+PubSubEventData = namedtuple('PubSubEventData', 'node id item data empty deleted retracted')
+PubSubEventData.__new__.__defaults__ = (None, None, None, False, False, False)
MoodData = namedtuple('MoodData', 'mood text')
@@ -77,6 +78,17 @@ AvatarData.__new__.__defaults__ = (None,) * len(AvatarData._fields)
BookmarkData = namedtuple('BookmarkData', 'jid name nick autojoin password')
BookmarkData.__new__.__defaults__ = (None, None, None, None)
+PGPPublicKey = namedtuple('PGPPublicKey', 'jid key date')
+
+PGPKeyMetadata = namedtuple('PGPKeyMetadata', 'jid fingerprint date')
+
+
+class CommonError(namedtuple('CommonError', 'type message')):
+ def __str__(self):
+ if self.message is not None:
+ return '%s: %s' % (self.type, self.message)
+ return self.type
+
class TuneData(namedtuple('TuneData', 'artist length rating source title track uri')):
@@ -140,6 +152,16 @@ class MessageProperties:
self.mam = None
self.pubsub = False
self.pubsub_event = None
+ self.openpgp = None
+ self.encrypted = None
+
+ @property
+ def is_encrypted(self):
+ return self.encrypted is not None
+
+ @property
+ def is_openpgp(self):
+ return self.openpgp is not None
@property
def is_pubsub(self):