public static function getPresence($payloads, $jaxl) { $html = ''; foreach ($payloads as $payload) { if (in_array($payload['type'], array('', 'available', 'unavailable'))) { list($room, $domain, $nick) = JAXLUtil::splitJid($payload['from']); $html .= '<div class="presIn">'; $html .= '<p class="from">' . $nick; if ($payload['type'] == 'unavailable') { $html .= ' left the room</p>'; } else { $html .= ' joined the room</p>'; } $html .= '</div>'; } } if ($html != '') { $response = array('jaxl' => 'presence', 'presence' => urlencode($html)); $jaxl->JAXL0206('out', $response); } return $payloads; }
public static function postBind($arr, $jaxl) { if ($arr["type"] == "result") { $jaxl->jid = $arr["bindJid"]; list($user, $domain, $resource) = JAXLUtil::splitJid($jaxl->jid); $jaxl->resource = $resource; $jaxl->executePlugin('jaxl_post_bind', false); if ($jaxl->sessionRequired) { $jaxl->startSession(); } else { $jaxl->auth = true; $jaxl->log("[[XMPPGet]] Auth completed..."); $jaxl->executePlugin('jaxl_post_auth', false); } } }