From 0ffac8056397baef91d7144ffb3db0eeff43eeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Martinovi=C4=87?= Date: Sat, 19 May 2012 22:38:52 +0300 Subject: [PATCH] If no resource provided, JID ends up with trailing slash what causes SASL authentication failure. --- lib/XmppPrebind.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/XmppPrebind.php b/lib/XmppPrebind.php index 5974d3a..5d33484 100644 --- a/lib/XmppPrebind.php +++ b/lib/XmppPrebind.php @@ -116,7 +116,9 @@ public function __construct($jabberHost, $boshUri, $resource, $useSsl = false, $ * @param string $password Password */ public function connect($username, $password) { - $this->jid = $username . '@' . $this->jabberHost . '/' . $this->resource; + $this->jid = $username . '@' . $this->jabberHost; + if($this->resource != null) + $this->jid .= '/' . $this->resource; $this->password = $password; $response = $this->sendInitialConnection();