summaryrefslogtreecommitdiff
path: root/sleekxmpp/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/__init__.py')
-rw-r--r--sleekxmpp/__init__.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/sleekxmpp/__init__.py b/sleekxmpp/__init__.py
index b680ddaf..16fd1056 100644
--- a/sleekxmpp/__init__.py
+++ b/sleekxmpp/__init__.py
@@ -222,9 +222,10 @@ class ClientXMPP(basexmpp, XMLStream):
def handler_bind_resource(self, xml):
logging.debug("Requesting resource: %s" % self.resource)
iq = self.Iq(stype='set')
- res = ET.Element('resource')
- res.text = self.resource
- xml.append(res)
+ if self.resource:
+ res = ET.Element('resource')
+ res.text = self.resource
+ xml.append(res)
iq.append(xml)
response = iq.send()
#response = self.send(iq, self.Iq(sid=iq['id']))