-1
我使用strophe librabry成功連接到openfire服務器。使用strophe獲取在線用戶列表xmpp
我想要一個可以從會議室返回所有用戶的javascript函數。
另一個問題是:我如何設置/獲取當前用戶的狀態?
我當前的代碼:
$(document).ready(function() {
connection = new Strophe.Connection(BOSH_SERVICE);
connection.connect("null",
"null",
onConnect);
});
function onConnect(status)
{
if (status == Strophe.Status.CONNECTED) {
$('#notifications').html('<p class="welcome">Hello! Any new posts will appear below.</p>');
connection.addHandler(notifyUser, null, 'message', null, null, null);
console.log('send ');
var pres = $pres({to: '[email protected]/catalin'});
connection.send(pres);
}
}
感謝,正是想我需要的。順便說一句,我試圖登錄hularing,但我說連接到服務器失敗。我需要特殊的身份證/密碼嗎? – Catalin 2013-03-20 12:55:57