diff options
author | Lance Stout <lancestout@gmail.com> | 2012-02-19 20:28:31 -0800 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-02-19 20:28:31 -0800 |
commit | e3d596c9fa1a8c138df0ebd97e90c6d510b77929 (patch) | |
tree | 9b97923bb42b3fe1552941aa714b62a34d3e3e2c /sleekxmpp/plugins/xep_0085/stanza.py | |
parent | ecd6ad69303466029e6498f9927964d9ee9e631b (diff) | |
download | slixmpp-e3d596c9fa1a8c138df0ebd97e90c6d510b77929.tar.gz slixmpp-e3d596c9fa1a8c138df0ebd97e90c6d510b77929.tar.bz2 slixmpp-e3d596c9fa1a8c138df0ebd97e90c6d510b77929.tar.xz slixmpp-e3d596c9fa1a8c138df0ebd97e90c6d510b77929.zip |
Update XEP-0085 plugin to work with both ElementTree and cElementTree
Each state element must have its own stanza class now. A stanza class
with an empty name field causes errors in ElementTree, even though
it works fine with cElementTree.
Diffstat (limited to 'sleekxmpp/plugins/xep_0085/stanza.py')
-rw-r--r-- | sleekxmpp/plugins/xep_0085/stanza.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0085/stanza.py b/sleekxmpp/plugins/xep_0085/stanza.py index 8c46758c..73c109ac 100644 --- a/sleekxmpp/plugins/xep_0085/stanza.py +++ b/sleekxmpp/plugins/xep_0085/stanza.py @@ -71,3 +71,23 @@ class ChatState(ElementBase): if state_xml is not None: self.xml = ET.Element('') parent.xml.remove(state_xml) + + +class Active(ChatState): + name = 'active' + + +class Composing(ChatState): + name = 'composing' + + +class Gone(ChatState): + name = 'gone' + + +class Inactive(ChatState): + name = 'inactive' + + +class Paused(ChatState): + name = 'paused' |