summaryrefslogtreecommitdiff
path: root/sleekxmpp/basexmpp.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-06-19 00:06:31 -0700
committerLance Stout <lancestout@gmail.com>2012-06-19 00:06:31 -0700
commitf7a74d960edb3ced00423c081ec74e9e91f3aea2 (patch)
tree0087925f8fa77ce027b1ad4583490b3d687d8b43 /sleekxmpp/basexmpp.py
parent95a0e51b41c1989b4785bd7cb502090a32fd6a63 (diff)
downloadslixmpp-f7a74d960edb3ced00423c081ec74e9e91f3aea2.tar.gz
slixmpp-f7a74d960edb3ced00423c081ec74e9e91f3aea2.tar.bz2
slixmpp-f7a74d960edb3ced00423c081ec74e9e91f3aea2.tar.xz
slixmpp-f7a74d960edb3ced00423c081ec74e9e91f3aea2.zip
Simplify send_presence_subscription()
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r--sleekxmpp/basexmpp.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 099b6dd0..576cfe87 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -551,14 +551,10 @@ class BaseXMPP(XMLStream):
:param ptype: The type of presence, such as ``'subscribe'``.
:param pnick: Optional nickname of the presence's sender.
"""
- presence = self.makePresence(ptype=ptype,
- pfrom=pfrom,
- pto=self.getjidbare(pto))
- if pnick:
- nick = ET.Element('{http://jabber.org/protocol/nick}nick')
- nick.text = pnick
- presence.append(nick)
- presence.send()
+ self.make_presence(ptype=ptype,
+ pfrom=pfrom,
+ pto=JID(pto).bare,
+ pnick=pnick).send()
@property
def jid(self):