diff options
author | Nathan Fritz <fritzy@netflint.net> | 2009-12-10 07:33:59 +0000 |
---|---|---|
committer | Nathan Fritz <fritzy@netflint.net> | 2009-12-10 07:33:59 +0000 |
commit | a031dd24a6c82745b7272d98229ebc69dd5f4811 (patch) | |
tree | 6fa65ae73a2faafe98cf8bfab24f92ed6bcc1ec0 /sleekxmpp/basexmpp.py | |
parent | 007b04dd3086a0b02865c924022db70bbd47445e (diff) | |
download | slixmpp-a031dd24a6c82745b7272d98229ebc69dd5f4811.tar.gz slixmpp-a031dd24a6c82745b7272d98229ebc69dd5f4811.tar.bz2 slixmpp-a031dd24a6c82745b7272d98229ebc69dd5f4811.tar.xz slixmpp-a031dd24a6c82745b7272d98229ebc69dd5f4811.zip |
tweaked stanzas for easy use
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r-- | sleekxmpp/basexmpp.py | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index 0f4f799c..0eeb52e8 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -354,24 +354,26 @@ class basexmpp(object): return fulljid.split('/', 1)[0] def _handleMessage(self, msg): - xml = msg.xml - ns = xml.tag.split('}')[0] - if ns == 'message': - ns = '' - else: - ns = "%s}" % ns - mfrom = xml.attrib['from'] - message = xml.find('%sbody' % ns).text - subject = xml.find('%ssubject' % ns) - if subject is not None: - subject = subject.text - else: - subject = '' - resource = self.getjidresource(mfrom) - mfrom = self.getjidbare(mfrom) - mtype = xml.attrib.get('type', 'normal') - name = self.roster.get('name', '') - self.event("message", {'jid': mfrom, 'resource': resource, 'name': name, 'type': mtype, 'subject': subject, 'message': message, 'to': xml.attrib.get('to', '')}) + self.event('message', msg) + #xml = msg.xml + #ns = xml.tag.split('}')[0] + #if ns == 'message': + # ns = '' + #else: + # ns = "%s}" % ns + #mfrom = xml.attrib['from'] + #message = xml.find('%sbody' % ns).text + #subject = xml.find('%ssubject' % ns) + #if subject is not None: + # subject = subject.text + #else: + # subject = '' + #resource = self.getjidresource(mfrom) + #mfrom = self.getjidbare(mfrom) + #mtype = xml.attrib.get('type', 'normal') + #name = self.roster.get('name', '') + #self.event("message", {'jid': mfrom, 'resource': resource, 'name': name, 'type': mtype, 'subject': subject, 'message': message, 'to': xml.attrib.get('to', '')}) + def _handlePresence(self, presence): xml = presence.xml |