blob: 0733e9a97a4aec1663cc880ca40d53dad246f81c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
from .. xmlstream.stanzabase import StanzaBase
from .. xmlstream import xmlstream as xmlstreammod
from .. xmlstream.matcher.xpath import MatchXPath
#_bases = [StanzaBase] + xmlstreammod.stanza_extensions.get('PresenceStanza', [])
#class PresenceStanza(*_bases):
class PresenceStanza(StanzaBase):
def __init__(self, stream, xml=None):
self.pfrom = ''
self.pto = ''
StanzaBase.__init__(self, stream, xml, xmlstreammod.stanza_extensions.get('PresenceStanza', []))
def fromXML(self, xml):
StanzaBase.fromXML(self, xml)
self.pfrom = xml.get('from')
self.pto = xml.get('to')
self.ptype = xml.get('type')
stanzas = ({'stanza_class': PresenceStanza, 'matcher': MatchXPath('{jabber:client}presence'), 'root': True},)
|