使用Strophe.js-Register-Plugin注册XMPP-Account [英] Register XMPP-Account using the Strophe.js-Register-Plugin

查看:244
本文介绍了使用Strophe.js-Register-Plugin注册XMPP-Account的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用strophe-register-plugin( https://github.com/metajack/strophejs-plugins/tree/master/register ).它与示例" http://bosh.metajack.im:5280/xmpp-httpbind ",但我无法使用OpenFire连接管理器注册帐户. (两个连接管理器都可以正常登录...)

I try to register a xmpp-account using the strophe-register-plugin (https://github.com/metajack/strophejs-plugins/tree/master/register). It works fine with the connection manager from example "http://bosh.metajack.im:5280/xmpp-httpbind" but I can't register the account using the OpenFire connection manager. (Normal login works with both connection managers...)

连接状态更改为1-> 10,就这样. 1表示正在连接",但我不知道10意味着什么...

Connection State Changes are 1 -> 10, thats it. 1 means "connecting" but i dont know what 10 means...

var connection = new Strophe.Connection(
//          "http://bosh.metajack.im:5280/xmpp-httpbind");
        "http://localhost/http-bind");

var callback = function (status) {alert(status);
    if (status === Strophe.Status.REGISTER) {
        connection.register.fields.username = "fghdfhg";
        connection.register.fields.name = "dfgfdgfdg";
        connection.register.fields.password = "dfddfgfdg";
        connection.register.submit();
    } else if (status === Strophe.Status.REGISTERED) {
        console.log("registered!");
        connection.authenticate();
    } else if (status === Strophe.Status.CONNECTED) {
        $(document).trigger('connected');
    } else if (status === Strophe.Status.DISCONNECTED) {
        console.log("Disconnected from XMPP-Server");
    }
};

//    connection.connect(data.jid, data.password, callback);
connection.register.connect("xyz.com", callback, 60, 1);

strophe.register.js 中的

推荐答案

转到第215行并按照以下代码进行更改.

in strophe.register.js go to line no 215 and make change as per below code.

 /*if (register.length === 0) {
            that._changeConnectStatus(Strophe.Status.REGIFAIL, null);
            return;
        } else */
this.enabled = true;

尝试以上一项.

这篇关于使用Strophe.js-Register-Plugin注册XMPP-Account的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆