Skip to content

Commit 041a8cb

Browse files
authored
Merge pull request #16 from drlight17/v0.9.1-beta
V0.9.1 beta
2 parents a22900c + 4994157 commit 041a8cb

File tree

8 files changed

+491
-61963
lines changed

8 files changed

+491
-61963
lines changed

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,18 @@ It is fully tested on 5.0.5, 6.0.1, 7.0.5, 8.0.1, 9.1.1 and 10.x.x
99

1010
Xmpp-prebind-php module supports php7 and newer
1111

12-
## What's Changed
13-
* added support for new CDN versions of conversejs + many fixes by @drlight17 in https://github.com/conversejs/roundcube-plugin/pull/15
14-
15-
**Full Changelog**: https://github.com/conversejs/roundcube-plugin/commits/v0.9.0-alpha
1612

1713
Requirements
1814
------------
1915
* BOSH support in XMPP server or BOSH connection manager
2016
* (optional) BOSH proxy in web server, to avoid crossdomain issues
2117
* (recommended) XMPP server set to broadcast incoming messages to all resources.
18+
* (recommended) XMPP server with websockets connection support
2219

2320
Installation
2421
------------
2522
* `cd your_roundcube_dir/plugins`
26-
* `git clone https://github.com/drlight17/roundcube-converse.js-xmpp-plugin converse`
23+
* `git clone https://github.com/conversejs/roundcube-plugin converse`
2724
* `cd converse`
2825
* `cp config.inc.php.dist config.inc.php`
2926
* `vi config.inc.php` (make necessary adjustments)
@@ -37,12 +34,7 @@ session files to force log out all of your users.
3734

3835
Notes
3936
-----
40-
41-
This plugin was using the same resource (both BOSH prebind and active), but this will changed in near future release.
42-
Everytime you make one page active will result in close connection on the other page.
43-
This version uses only login authentication method of conversejs (utilizes jid + password) which is not secure. There is a prebind method that utilizes rid, jid and sid from prebind_url in future plan (code for this implementation is commented now in converse.php).
44-
45-
**New version will support BOSH connection method with and without prebind and websocket connection method (during my testings this method is way more stable and faster then BOSH) and many other fixes.**
37+
This version supports BOSH connection method with login and prebind auth methods and websocket connection method with login auth method. The last one is recommended as more stable and faster then BOSH.
4638

4739
Stay in touch. Fill free to make PRs ;)
4840

composer.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "converse",
3+
"description": "Adds support of conversejs to RC.",
4+
"homepage": "https://github.com/conversejs/roundcube-plugin/",
5+
"license": "MIT",
6+
"type": "roundcube-plugin",
7+
"version": "0.9.1-beta",
8+
"authors": [
9+
{
10+
"name": "Yuri Samoilov",
11+
"email": "[email protected]",
12+
"role": "Developer"
13+
14+
},
15+
{
16+
"name": "Dennis Schridde",
17+
"email": "https://github.com/devurandom",
18+
"role": "Developer"
19+
20+
},
21+
{
22+
"name": "Priyadi Iman Nurcahyo",
23+
"email": "http://priyadi.net",
24+
"role": "Developer"
25+
26+
}
27+
],
28+
"require": {
29+
"php": ">=5.4.0",
30+
"roundcube/plugin-installer": ">=0.1.2"
31+
},
32+
"extra": {
33+
"roundcube": {
34+
"min-version": "1.4"
35+
}
36+
}
37+
}

config.inc.php.dist

Lines changed: 48 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,30 @@
44
// $args['user'] : IMAP username
55
// $args['pass'] : IMAP password
66

7+
// XMPP auth method for conversejs (possible values are "login" and "prebind")
8+
// Login method will use credentials_url and prebind - prebind_url. For prebind you MUST
9+
// specify converse_xmpp_bosh_prebind_url and converse_xmpp_bosh_url parameters below and set converse_xmpp_conn_method to websocket!
10+
$rcmail_config['converse_xmpp_auth_method'] = 'login';
11+
12+
// XMPP connection method (possible values are "websocket" and "bosh")
13+
// For BOSH you MUST specify converse_xmpp_bosh_prebind_url and converse_xmpp_bosh_url.
14+
// For websocket you MUST specify converse_xmpp_websocket_url
15+
// websocket is highly recommended as more fast, reliable and stable connection method
16+
$rcmail_config['converse_xmpp_conn_method'] = 'websocket';
17+
18+
// Hostname of websocket endpoint, used by web browsers (called by Javascript code),
19+
// this can be a relative URL
20+
$rcmail_config['converse_xmpp_websocket_url']= function($args) {
21+
//return '/ws';
22+
return 'wss://your-xmpp.domain.com:7443/ws';
23+
24+
};
25+
726
// Hostname of BOSH endpoint, used for prebinding only (called by PHP),
827
// this must be an absolute URL
928
$rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) {
10-
return 'http://localhost:5280/http-bind';
29+
//return 'http://localhost:5280/http-bind';
30+
return 'https://your-xmpp.domain.com:7443/http-bind';
1131
// return sprintf('http://%s/http-bind', $_SERVER['HTTP_HOST']);
1232
// return sprintf('http://%s/http-bind', $args['host']);
1333
};
@@ -16,13 +36,16 @@ $rcmail_config['converse_xmpp_bosh_prebind_url']= function($args) {
1636
// this can be a relative URL
1737
$rcmail_config['converse_xmpp_bosh_url']= function($args) {
1838
//return '/http-bind';
19-
return 'http://localhost:5280/http-bind';
39+
return 'https://your-xmpp.domain.com:7443/http-bind';
40+
//return 0;
2041
};
2142

2243
// Hostname portion of XMPP username aka XMPP domain (bare JID), example: "example.net"
2344
$rcmail_config['converse_xmpp_hostname']= function($args) {
45+
return 'domain.com';
46+
//return;
2447
// return preg_replace('/^.*@/', '', $args['user']);
25-
return $args['host'];
48+
// return $args['host'];
2649
};
2750

2851
// Username portion of XMPP username (bare JID), example: "user"
@@ -38,40 +61,52 @@ $rcmail_config['converse_xmpp_password']= function($args) {
3861
return $args['pass'];
3962
};
4063

64+
// URL prefix of the CDN where Converse.js is being included from.
65+
// May point to a local path, if you use the same directory structure as
66+
// on the CDN (dist/ + css/).
67+
//$rcmail_config['converse_cdn'] = 'https://cdn.conversejs.org/5.0.5'; // last version with previous avatar design and more stable user connection status
68+
$rcmail_config['converse_cdn'] = 'https://cdn.conversejs.org/10.1.2';
69+
//$rcmail_config['converse_cdn'] = 'https://cdn.conversejs.org/9.1.1';
70+
4171
// Additional converse.js option to use
4272
// refer to https://conversejs.org/docs/html/index.html#configuration-variables
43-
// some options are overriden: expose_rid_and_sid, bosh_service_url, debug,
44-
// prebind, jid, sid, rid
73+
// some options are overriden by plugin so there is no need to fill them:
74+
// bosh_service_url, debug, prebind, password, login, jid, sid, rid, auto_login, auto_reconnect
75+
// !!! allow_logout will be overridden only if prebind auth method is configured !!!
4576
$rcmail_config['converse_config'] = array(
4677
'blacklisted_plugins' => array(
78+
//'converse-controlbox'
79+
),
80+
'whitelisted_plugins' => array(
81+
//'converse-notification'
4782
),
4883
'show_message_avatar' => true,
4984
'show_send_button' => true,
50-
//'view_mode' => 'overlayed',
5185
'allow_dragresize' => true,
5286
'allow_contact_removal' => false,
5387
'allow_registration' => false,
88+
'allow_logout' => true,
5489
'allow_user_trust_override' => false,
55-
'auto_login' => true,
56-
'auto_reconnect' => true,
57-
'allow_logout' => false,
5890
'allow_contact_requests' => false,
5991
'show_client_info' => false,
6092
'visible_toolbar_buttons' => array(
61-
'spoiler' => true,
93+
'spoiler' => false,
6294
'call' => false,
6395
'emoji' => true,
6496
'toggle_occupants' => true
6597
),
66-
'theme' => 'default',
67-
'dark_theme' => 'concord',
98+
//'theme' => 'default', // may be set to forced override RC theme. available: default (browser/system), concord, dracula
99+
'dark_theme' => 'concord', // available dracula and concord (default hardcoded in plugin as I don't like dracula =)) - will be useful if theme is not configured or default (browser/system) is set
68100
'auto_away' => 300,
69101
'allow_adhoc_commands' => false,
70102
'omemo_default' => true,
103+
'discover_connection_methods' => false,
104+
'play_sounds' => true,
105+
'sounds_path' => $rcmail_config['converse_cdn'].'/sounds/',
71106
'singleton' => false //for helpdesk like chat
72107
);
73108

74-
// Always embed chat even if prebinding is not configured or failed
109+
// Always embed chat even if auth is failed. Setting it to true and manually filling login and password is not very secure as plugin saves your jid and password in browser local storage until the end of RC or conversejs session
75110
$rcmail_config['converse_xmpp_enable_always'] = false;
76111

77112
// Enable debug mode
@@ -80,12 +115,3 @@ $rcmail_config['converse_xmpp_debug'] = false;
80115
// Enable development mode
81116
$rcmail_config['converse_xmpp_devel_mode'] = false;
82117

83-
// Configure XMPP resource prefix. XMPP resource is set to this variable
84-
// appended with a unique id. Defaults to 'roundcube-'.
85-
$rcmail_config['converse_xmpp_resource_prefix'] = 'roundcube-';
86-
87-
// URL prefix of the CDN where Converse.js is being included from.
88-
// May point to a local path, if you use the same directory structure as
89-
// on the CDN (dist/ + css/).
90-
//$rcmail_config['converse_cdn'] = 'https://cdn.conversejs.org/5.0.5';
91-
$rcmail_config['converse_cdn'] = 'https://cdn.conversejs.org/10.0.0';

0 commit comments

Comments
 (0)