示例#1
0
文件: boshMUChat.php 项目: ZZB/JAXL
 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;
 }
示例#2
0
文件: xmpp.get.php 项目: ngsru/JAXL
 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);
         }
     }
 }