-1

strophe ライブラリを使用して、openfire サーバーに正常に接続しました。

会議室からすべてのユーザーを返す 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: 'chat@conference.neo-pc/catalin'});
        connection.send(pres);


    }
}
4

1 に答える 1

1

最初のプレゼンスを送信した後、名簿を取得します。

http://xmpp.org/rfcs/rfc6121.html#roster-login - ログイン後に名簿を取得する方法。

誰かのプレゼンスを取得するには、プレゼンス IQ を送信する必要があります。次にステータス要素を取得します。

私が strophe.js を使用して構築した xmppp クライアントを見たい場合は、http://hularing.me/ にアクセスしてください。

于 2013-03-20T01:42:45.620 に答える