From 093644ffbd6708121150c92359bce60408f924bb Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Tue, 5 Jan 2010 21:56:48 +0000 Subject: * major stanza improvements * raise XMPPError in handler to reply with error stanza * started work on pubsub stanzas --- sleekxmpp/stanza/presence.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'sleekxmpp/stanza/presence.py') diff --git a/sleekxmpp/stanza/presence.py b/sleekxmpp/stanza/presence.py index cb6bd6ce..6a8247c5 100644 --- a/sleekxmpp/stanza/presence.py +++ b/sleekxmpp/stanza/presence.py @@ -1,8 +1,9 @@ from .. xmlstream.stanzabase import StanzaBase from xml.etree import cElementTree as ET from . error import Error +from . rootstanza import RootStanza -class Presence(StanzaBase): +class Presence(RootStanza): interfaces = set(('type', 'to', 'from', 'id', 'status', 'priority')) types = set(('available', 'unavailable', 'error', 'probe', 'subscribe', 'subscribed', 'unsubscribe', 'unsubscribed')) showtypes = set(('dnd', 'ffc', 'xa', 'away')) @@ -52,12 +53,3 @@ class Presence(StanzaBase): elif self['type'] == 'subscribe': self['type'] = 'subscribed' return StanzaBase.reply(self) - - def exception(self, text): - self.reply() - self['error']['condition'] = 'undefined-condition' - self['error']['text'] = text - self.send() - -Presence.plugin_attrib_map['error'] = Error -Presence.plugin_tag_map["{%s}%s" % (Error.namespace, Error.name)] = Error -- cgit v1.2.3