fix - can not set priority 0

This commit is contained in:
Ivan Borzenkov 2010-02-27 22:42:05 +03:00
parent b25d7819b6
commit bde088057d

View File

@ -187,7 +187,7 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream {
* @param string $show * @param string $show
* @param string $to * @param string $to
*/ */
public function presence($status = null, $show = 'available', $to = null, $type='available', $priority=0) { public function presence($status = null, $show = 'available', $to = null, $type='available', $priority=null) {
if($type == 'available') $type = ''; if($type == 'available') $type = '';
$to = htmlspecialchars($to); $to = htmlspecialchars($to);
$status = htmlspecialchars($status); $status = htmlspecialchars($status);
@ -202,7 +202,7 @@ class XMPPHP_XMPP extends XMPPHP_XMLStream {
$out .= ">"; $out .= ">";
if($show != 'available') $out .= "<show>$show</show>"; if($show != 'available') $out .= "<show>$show</show>";
if($status) $out .= "<status>$status</status>"; if($status) $out .= "<status>$status</status>";
if($priority) $out .= "<priority>$priority</priority>"; if($priority !== null) $out .= "<priority>$priority</priority>";
$out .= "</presence>"; $out .= "</presence>";
} }