<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Monday 19 October 2015 11:01:23 Mathias Friman wrote:<br /></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hi list!<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">No progress in my migration so I'll try another issue instead. I've managed to do a ugly hack with the converse.js-xmpp-plugin that has not seen any action in a while. You see, my municipality administration is considering a switch from FirstClass to Office365, but I would think that Kolab could make an excellent alternative, combined with some other software. <br /><br />One of the key functions though, is the chat presence which is a must. So I've setup a Prosody XMPP server and ugly hacked together</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a href="https://github.com/priyadi/roundcube-converse.js-xmpp-plugin"><span style=" text-decoration: underline; color:#0057ae;">https://github.com/priyadi/roundcube-converse.js-xmpp-plugin</span></a> in a way that is sufficiently pleasing to the eye: <a href="http://imgur.com/fZO8bTj.png"><span style=" text-decoration: underline; color:#0057ae;">http://imgur.com/fZO8bTj.png</span></a> <br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Now to the problem(s).<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">1. This plugin only works if i set the user and password manually in config.inc.php like so:<br /><br />$rcmail_config['converse_xmpp_username']= function($args) {<br />        return 'osdmatfri';<br />        //return $args['user'];<br />        //return preg_replace('/@.*$/', '', $args['user']);<br />};<br /><br />// XMPP password<br />$rcmail_config['converse_xmpp_password']= function($args) {<br />        return 'OpenSourceRules!';<br />        //return $args['pass'];<br />};<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">When I try with "return $args['pass'];" etc, which seems to be the default behaviour, it doesn't work. Having a username and password value hard coded in the config is, as you understand, suboptimal.<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">As I understand this plugin, you connect to the XMPP server at login, and Roundcube/Kolab handles the login/logout procedure. Which leads me to the second problem.<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">2. When I have the chat in Kolab like on the screenshot, the whole system becomes unresponsive to clicks. onMouseOver-effects work when i steer the mouse pointer, but I cannot click anywhere. The javascript errors out with "TypeError: converse.on is not a function" in js/converse-rcmail.js :<br /><br />    // hook into login event and keep XMPP session in Roundcube's session<br />    converse.on('onReady', function(e){<br />        if (!args.sid && e.target.bare_jid)<br />            rcmail.http_post('plugin.converse_bind', { jid:e.target.bare_jid, sid:converse.getSID() });<br />    });<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I guess this is because I've changed the JavaScript-code in converse.php like so:<br /><br />        //define("jquery", [], function() { return jQuery; });<br />        //require.config({ baseUrl: "'.$this->urlbase.'devel/converse.js" });<br />        //require(["converse"], function (converse) {<br />                var args = '.$rcmail->output->json_serialize($converse_prop).';<br />                args.i18n = locales["'.$locale.'"];<br />                rcmail_converse_init(converse, args);<br />        //});<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I understand that commenting out the define and require statements is probably a bad idea, but otherwise the converse.js chat will not start at all and gives a whole other lot of errors. I guess the converse.js has changed a bit in a year or two.<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I'm no JavaScript programmer and rather terrible at PHP too, so I would like some help with this in some way. <br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">When inserting the converse.js chat "as is" in Kolab it works splendidly, however the user is required to login one extra time and that does not give the impression of very great integration.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I have a working configuration, and my config looks like:</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">$rcmail_config['converse_xmpp_hostname'] = function($args) {</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  list($user,$host) = explode('@', $args['user']);</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">//    return $host;</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">    return 'domain.ro';</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">    };</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">This server use "short usernames" for login ( no domain so i added it manually)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">IMHO the fact converse is not appearing at login is just because it not authenticate but you should dig.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">( I think after you change the config you need to logoff and logon again in order the plugin read again the user and pass; i think a little logging can be helpfull here)</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Usually my customers have desktop clients (I tried  pandion or jitsi, pandion is not an active project but is easy to configure and it have a user friendly interface) but they use the web client when are not at the office.</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Any ideas?<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Kindest regards,<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Mathias <br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /><br />-- </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a href="http://mihai.badici.ro"><span style=" text-decoration: underline; color:#0057ae;">Mihai Badici</span></a> </p></body></html>