summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0048/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_0048/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_0048/stanza.py')
-rw-r--r--sleekxmpp/plugins/xep_0048/stanza.py65
1 files changed, 0 insertions, 65 deletions
diff --git a/sleekxmpp/plugins/xep_0048/stanza.py b/sleekxmpp/plugins/xep_0048/stanza.py
deleted file mode 100644
index 21829392..00000000
--- a/sleekxmpp/plugins/xep_0048/stanza.py
+++ /dev/null
@@ -1,65 +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.xmlstream import ET, ElementBase, register_stanza_plugin
-
-
-class Bookmarks(ElementBase):
- name = 'storage'
- namespace = 'storage:bookmarks'
- plugin_attrib = 'bookmarks'
- interfaces = set()
-
- def add_conference(self, jid, nick, name=None, autojoin=None, password=None):
- conf = Conference()
- conf['jid'] = jid
- conf['nick'] = nick
- if name is None:
- name = jid
- conf['name'] = name
- conf['autojoin'] = autojoin
- conf['password'] = password
- self.append(conf)
-
- def add_url(self, url, name=None):
- saved_url = URL()
- saved_url['url'] = url
- if name is None:
- name = url
- saved_url['name'] = name
- self.append(saved_url)
-
-
-class Conference(ElementBase):
- name = 'conference'
- namespace = 'storage:bookmarks'
- plugin_attrib = 'conference'
- plugin_multi_attrib = 'conferences'
- interfaces = set(['nick', 'password', 'autojoin', 'jid', 'name'])
- sub_interfaces = set(['nick', 'password'])
-
- def get_autojoin(self):
- value = self._get_attr('autojoin')
- return value in ('1', 'true')
-
- def set_autojoin(self, value):
- del self['autojoin']
- if value in ('1', 'true', True):
- self._set_attr('autojoin', 'true')
-
-
-class URL(ElementBase):
- name = 'url'
- namespace = 'storage:bookmarks'
- plugin_attrib = 'url'
- plugin_multi_attrib = 'urls'
- interfaces = set(['url', 'name'])
-
-
-register_stanza_plugin(Bookmarks, Conference, iterable=True)
-register_stanza_plugin(Bookmarks, URL, iterable=True)