priyadi / roundcube-converse.js-xmpp-plugin

XMPP plugin for Roundcube Webmail based on converse.js
48 stars 18 forks source link

Freeze Interface #2

Closed aacunha closed 11 years ago

aacunha commented 11 years ago

hi,

i converse.js plugin loaded correctly, but after that, the interface froze roundcube, messages do not carry over, and the buttons on the interface does not work.

Regards, André

captura de tela de 2013-07-18 12 28 58

priyadi commented 11 years ago

if you disable converse.js plugin, does roundcube work correctly?

aacunha commented 11 years ago

Yes, works.

Regards Andre Em 18/07/2013 13:10, "Priyadi Iman Nurcahyo" notifications@github.com escreveu:

if you disable converse.js plugin, does roundcube work correctly?

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/issues/2#issuecomment-21194539 .

aacunha commented 11 years ago

Follow the print screen captura de tela de 2013-07-18 13 55 15

priyadi commented 11 years ago

Could you copy and paste the errors from javascript console? in chrome/chromium, hit F12 and click 'Console'. Then reload the page again.

aacunha commented 11 years ago

The problem is where: if (bare.indexOf("@") < 0) {

and i solved like that:

[root@yoda converse]# pico converse.js/Libraries/strophe.js

getDomainFromJid: function (jid)
{
    /* var bare = Strophe.getBareJidFromJid(jid); */
    var bare = 'iff.edu.br';
    return bare;

/ if (bare.indexOf("@") < 0) { return bare; } else { var parts = bare.split("@"); parts.splice(0, 1); return parts.join('@'); } /

Now the page loads ok, but a cant add user or change the status:

It`s normal the plugin communicate with jabber.org in every action? captura de tela de 2013-07-18 14 53 06

priyadi commented 11 years ago

Hi, I don't understand why it would fix your problem. Could you see what 'jid' in that function contains? Maybe add an alert(jid) in the first line of getDomainFromJid. It should output something like user@iff.edu.br.

The second problem is more obvious. It is cross domain problem. More explanation: http://en.wikipedia.org/wiki/Same_origin_policy

Easiest solution would be proxying http://mail.iff.edu.br:5280/http-bind under http://mail.iff.edu.br/http-bind where your roundcube resides. See here for information on setting up BOSH proxy on various web servers: http://prosody.im/doc/setting_up_bosh

aacunha commented 11 years ago

The alert return a null value:

captura de tela de 2013-07-18 15 30 06

priyadi commented 11 years ago

did you change anything in config.inc.php? if you did, please paste yours here.

priyadi commented 11 years ago

oh if you haven't fixed the crossdomain issue it would make sense the jid came out empty. you need to fix your crossdomain issue first before doing anything else.

aacunha commented 11 years ago

I already setup the proxy in apache, try: http://mail.iff.edu.br/htp-bind

config.inc.php:

<?php // important variables in the following anonymous functions: // $args['host'] : IMAP hostname // $args['user'] : IMAP username // $args['pass'] : IMAP password

// Hostname of BOSH endpoint, used for prebinding only (called by PHP), // this must be an absolute URL $rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) { return 'http://mail.iff.edu.br/http-bind';

return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);

    # return sprintf('http://%s/http-bind', $args['host']);

};

// Hostname of BOSH endpoint, used by web browsers (called by Javascript code), // this can be a relative URL $rcmail_config['converse_xmpp_bosh_url']= function($args) { return '/http-bind'; };

// Hostname portion of XMPP username (bare JID), example: "example.net" $rcmail_config['converse_xmpp_hostname']= function($args) { return 'iff.edu.br';

return preg_replace('/^.*@/', '', $args['user'];

    # return $args['host'];

};

// Username portion of XMPP username (bare JID), example: "user" // if this contains @, this will only take the part before @, // and the part after @ will replace the hostname definition above. $rcmail_config['converse_xmpp_username']= function($args) {

return $args['user'];

    return preg_replace('/@.*$/', '', $args['user']);

};

// XMPP password $rcmail_config['converse_xmpp_password']= function($args) { return $args['pass']; };

Regards Andre

2013/7/18 Priyadi Iman Nurcahyo notifications@github.com

oh if you haven't fixed the crossdomain issue it would make sense the jid came out empty. you need to fix your crossdomain issue first before doing anything else.

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/issues/2#issuecomment-21206477 .

Att André Cunha Analista de Tecnologia da Informação

aacunha commented 11 years ago

It`s correct my config.php? What yours roundcube version?

aacunha commented 11 years ago

Hi!

am I still with the same problem yet. I already configured my apache proxy to bosh, and are avaiable at mail.iff.edu.br/http-bind .

What can i try?

Thanks! Regards, André

priyadi commented 11 years ago

sorry, i have been busy for this past week.

if you can provide me with an account I can test with, maybe I can be more helpful. preferably the account that is not in production (that URL you provided looks like it is production site).

aacunha commented 11 years ago

Can you send to me your email account? (to pass the server account)

priyadi commented 11 years ago

my email is priyadi@priyadi.net

markuman commented 11 years ago

yes the hole interface freeze because there is no option to enter account details (jabber id, server, passwort).

aacunha commented 11 years ago

Markuman,

I dont understand your answer. Can you explain?

Regards, Andre Em 04/08/2013 09:28, "markuman" notifications@github.com escreveu:

yes the hole interface freeze because there is no option to enter account details (jabber id, server, passwort).

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/issues/2#issuecomment-22070952 .

markuman commented 11 years ago

where do you add your jabberaccount details?

priyadi commented 11 years ago

@markuman,

this plugin is designed to use credentials used by roundcube. i.e. if your email is user@example.com, then your XMPP account is user@example.com, with the same password. it is supposed to be like gmail, where you enter your username & password once, and you are logged to both email and XMPP account.

markuman commented 11 years ago

but this is the reason why the interface is freezing. it would be nice to have a setting page where you can en/disable autologin and change login details for different jabber server. futhermore, not everyone is logging in with mailadress@domain.tld. there are many people who are using just the usernames.

priyadi commented 11 years ago

@markuman:

the interface is freezing because it currently doesn't cope well with login errors. i'm still looking into this. yes it would be nice to have different login detail from the IMAP account used by roundcube. but it is not my priority right now.

the plugin can already accomodate the case where users are logging in just by their usernames. in fact, the default configuration does precisely that by appending @example.net to the username logged on to roundcube.

$rcmail_config['converse_xmpp_hostname']= function($args) {
    return 'example.net';
};

$rcmail_config['converse_xmpp_username']= function($args) {
    return $args['user'];
};
markuman commented 11 years ago

I've configures now everythink like that but it still don't work. now the interface is not freezing anymore but the toggle_chat part is not visible anymore.

[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string(): Entity: line 4: parser error : Opening and ending tag mismatch: meta line 3 and head in /srv/http/roundcube/plugins/converse/converse.php on line 59
[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string(): &lt;/head&gt; in /srv/http/roundcube/plugins/converse/converse.php on line 59
[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string():        ^ in /srv/http/roundcube/plugins/converse/converse.php on line 59
[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string(): Entity: line 7: parser error : Opening and ending tag mismatch: head line 3 and html in /srv/http/roundcube/plugins/converse/converse.php on line 59
[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string(): &lt;/html&gt; in /srv/http/roundcube/plugins/converse/converse.php on line 59
[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string():        ^ in /srv/http/roundcube/plugins/converse/converse.php on line 59
[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string(): Entity: line 7: parser error : Premature end of data in tag html line 2 in /srv/http/roundcube/plugins/converse/converse.php on line 59
[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string(): &lt;/html&gt; in /srv/http/roundcube/plugins/converse/converse.php on line 59
[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning:  simplexml_load_string():        ^ in /srv/http/roundcube/plugins/converse/converse.php on line 59
aacunha commented 11 years ago

Hi still with the same problem. I try to use ejabberd and now openfire. In the two cases i got the interface freeze.

Regards, André

2013/8/10 markuman notifications@github.com

I've configures now everythink like that but it still don't work. now the interface is not freezing anymore but the toggle_chat part is not visible anymore.

[10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): Entity: line 4: parser error : Opening and ending tag mismatch: meta line 3 and head in /srv/http/roundcube/plugins/converse/converse.php on line 59 [10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): </head> in /srv/http/roundcube/plugins/converse/converse.php on line 59 [10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): ^ in /srv/http/roundcube/plugins/converse/converse.php on line 59 [10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): Entity: line 7: parser error : Opening and ending tag mismatch: head line 3 and html in /srv/http/roundcube/plugins/converse/converse.php on line 59 [10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): </html> in /srv/http/roundcube/plugins/converse/converse.php on line 59 [10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): ^ in /srv/http/roundcube/plugins/converse/converse.php on line 59 [10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): Entity: line 7: parser error : Premature end of data in tag html line 2 in /srv/http/roundcube/plugins/converse/converse.php on line 59 [10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): </html> in /srv/http/roundcube/plugins/converse/converse.php on line 59 [10-Aug-2013 11:48:02 Europe/Berlin] PHP Warning: simplexml_load_string(): ^ in /srv/http/roundcube/plugins/converse/converse.php on line 59

— Reply to this email directly or view it on GitHubhttps://github.com/priyadi/roundcube-converse.js-xmpp-plugin/issues/2#issuecomment-22437214 .

Att André Cunha Analista de Tecnologia da Informação

aacunha commented 11 years ago

printscreen captura de tela de 2013-08-12 11 49 57

aacunha commented 11 years ago

Via strobe.js example ( /examples/echobot.html ) i can connect:

captura de tela de 2013-08-12 18 05 54

MaximeCheramy commented 11 years ago

I have the same issue. The jid is null. Muckl and Jappix both work fine on this server.

aacunha commented 11 years ago

I still with the same problem. Any news?

silvergo commented 11 years ago

I have the same issue too.

CyBeRoni commented 11 years ago

I'm no xmpp expert but I think it's because the author appears to have taken a short cut for authenticating the client to the jabber server, which probably works with his server but not with ours. I patched it to be more (but not perfectly, still) compliant to the BOSH spec and that works for me with OpenFire.

https://github.com/CyBeRoni/roundcube-converse.js-xmpp-plugin/commit/8a7f55b52e711fe3f32f68ad637d5efc42af2daf

silvergo commented 11 years ago

I use prosody and I'm no xmpp expert too. I got these rows in log:

Sep 06 10:22:59 mod_bosh info New BOSH session, assigned it sid '1bc94d84-99b3-4a7e-b700-cdd7b75d83db' Sep 06 10:23:01 stanzarouter warn Received stanza with invalid source JID: Sep 06 10:23:01 stanzarouter warn Received stanza with invalid source JID: ... (two minutes after:) Sep 06 10:25:19 bosh1bc94d84-99b3-4a7e-b700-cdd7b75d83db info Destroying session for (unknown) ((unknown)@.)

I added some trigger_error in function authenticate inside converse.php and the host, user, pass etc are got correctly. CyBeRoni, could you post your workaround plz?

CyBeRoni commented 11 years ago

I did, see the link at the bottom of my previous post.

silvergo commented 11 years ago

Ooops. It works for me too (prosody 0.8.2 - auth backend: dovecot) Tnx.

aacunha commented 11 years ago

fixed with the patch of CyBeRoni.

Thanks!

Regards Andre

priyadi commented 11 years ago

Hi guys, I admit I don't know that much about XMPP. I pretty much stole my prebind auth code from here: https://gist.github.com/Zash/3681653. I'm thinking to use better supported 3rd party prebind php library to avoid compatibility problem in the future.

Anyway, I've merged CyBeRoni's pull requests, and from what I've read here, it should fix everyone's problem.