summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0198/stanza.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-07-17 14:19:04 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-07-17 14:19:04 +0200
commit5ab77c745270d7d5c016c1dc7ef2a82533a4b16e (patch)
tree259377cc666f8b9c7954fc4e7b8f7a912bcfe101 /sleekxmpp/plugins/xep_0198/stanza.py
parente5582694c07236e6830c20361840360a1dde37f3 (diff)
downloadslixmpp-5ab77c745270d7d5c016c1dc7ef2a82533a4b16e.tar.gz
slixmpp-5ab77c745270d7d5c016c1dc7ef2a82533a4b16e.tar.bz2
slixmpp-5ab77c745270d7d5c016c1dc7ef2a82533a4b16e.tar.xz
slixmpp-5ab77c745270d7d5c016c1dc7ef2a82533a4b16e.zip
Rename to slixmpp
Diffstat (limited to 'sleekxmpp/plugins/xep_0198/stanza.py')
-rw-r--r--sleekxmpp/plugins/xep_0198/stanza.py150
1 files changed, 0 insertions, 150 deletions
diff --git a/sleekxmpp/plugins/xep_0198/stanza.py b/sleekxmpp/plugins/xep_0198/stanza.py
deleted file mode 100644
index 6461d766..00000000
--- a/sleekxmpp/plugins/xep_0198/stanza.py
+++ /dev/null
@@ -1,150 +0,0 @@
-"""
- SleekXMPP: The Sleek XMPP Library
- Copyright (C) 2012 Nathanael C. Fritz, Lance J.T. Stout
- This file is part of SleekXMPP.
-
- See the file LICENSE for copying permission.
-"""
-
-from sleekxmpp.stanza import Error
-from sleekxmpp.xmlstream import ElementBase, StanzaBase
-
-
-class Enable(StanzaBase):
- name = 'enable'
- namespace = 'urn:xmpp:sm:3'
- interfaces = set(['max', 'resume'])
-
- def setup(self, xml):
- StanzaBase.setup(self, xml)
- self.xml.tag = self.tag_name()
-
- def get_resume(self):
- return self._get_attr('resume', 'false').lower() in ('true', '1')
-
- def set_resume(self, val):
- self._del_attr('resume')
- self._set_attr('resume', 'true' if val else 'false')
-
-
-class Enabled(StanzaBase):
- name = 'enabled'
- namespace = 'urn:xmpp:sm:3'
- interfaces = set(['id', 'location', 'max', 'resume'])
-
- def setup(self, xml):
- StanzaBase.setup(self, xml)
- self.xml.tag = self.tag_name()
-
- def get_resume(self):
- return self._get_attr('resume', 'false').lower() in ('true', '1')
-
- def set_resume(self, val):
- self._del_attr('resume')
- self._set_attr('resume', 'true' if val else 'false')
-
-
-class Resume(StanzaBase):
- name = 'resume'
- namespace = 'urn:xmpp:sm:3'
- interfaces = set(['h', 'previd'])
-
- def setup(self, xml):
- StanzaBase.setup(self, xml)
- self.xml.tag = self.tag_name()
-
- def get_h(self):
- h = self._get_attr('h', None)
- if h:
- return int(h)
- return None
-
- def set_h(self, val):
- self._set_attr('h', str(val))
-
-
-class Resumed(StanzaBase):
- name = 'resumed'
- namespace = 'urn:xmpp:sm:3'
- interfaces = set(['h', 'previd'])
-
- def setup(self, xml):
- StanzaBase.setup(self, xml)
- self.xml.tag = self.tag_name()
-
- def get_h(self):
- h = self._get_attr('h', None)
- if h:
- return int(h)
- return None
-
- def set_h(self, val):
- self._set_attr('h', str(val))
-
-
-class Failed(StanzaBase, Error):
- name = 'failed'
- namespace = 'urn:xmpp:sm:3'
- interfaces = set()
-
- def setup(self, xml):
- StanzaBase.setup(self, xml)
- self.xml.tag = self.tag_name()
-
-
-class StreamManagement(ElementBase):
- name = 'sm'
- namespace = 'urn:xmpp:sm:3'
- plugin_attrib = name
- interfaces = set(['required', 'optional'])
-
- def get_required(self):
- return self.find('{%s}required' % self.namespace) is not None
-
- def set_required(self, val):
- self.del_required()
- if val:
- self._set_sub_text('required', '', keep=True)
-
- def del_required(self):
- self._del_sub('required')
-
- def get_optional(self):
- return self.find('{%s}optional' % self.namespace) is not None
-
- def set_optional(self, val):
- self.del_optional()
- if val:
- self._set_sub_text('optional', '', keep=True)
-
- def del_optional(self):
- self._del_sub('optional')
-
-
-class RequestAck(StanzaBase):
- name = 'r'
- namespace = 'urn:xmpp:sm:3'
- interfaces = set()
-
- def setup(self, xml):
- StanzaBase.setup(self, xml)
- self.xml.tag = self.tag_name()
-
-
-class Ack(StanzaBase):
- name = 'a'
- namespace = 'urn:xmpp:sm:3'
- interfaces = set(['h'])
-
- def setup(self, xml):
- StanzaBase.setup(self, xml)
- self.xml.tag = self.tag_name()
-
- def get_h(self):
- h = self._get_attr('h', None)
- if h:
- return int(h)
- return None
-
- def set_h(self, val):
- self._set_attr('h', str(val))