|
@@ -48,19 +48,27 @@ function doJoin() {
|
48
|
48
|
var roomnode = null;
|
49
|
49
|
var path = window.location.pathname;
|
50
|
50
|
var roomjid;
|
51
|
|
- /*
|
52
|
|
- * this is making assumptions about how the URL->room mapping happens.
|
53
|
|
- * It currently assumes deployment at root, with a rewrite like the
|
54
|
|
- * following one (for nginx):
|
55
|
|
- location ~ ^/([a-zA-Z0-9]+)$ {
|
56
|
|
- rewrite ^/(.*)$ / break;
|
57
|
|
- }
|
58
|
|
- */
|
59
|
|
- if (path.length > 1) {
|
60
|
|
- roomnode = path.substr(1).toLowerCase();
|
|
51
|
+
|
|
52
|
+ // determinde the room node from the url
|
|
53
|
+ // TODO: just the roomnode or the whole bare jid?
|
|
54
|
+ if (config.getroomnode && typeof config.getroomnode === 'function') {
|
|
55
|
+ // custom function might be responsible for doing the pushstate
|
|
56
|
+ roomnode = config.getroomnode(path);
|
61
|
57
|
} else {
|
62
|
|
- roomnode = Math.random().toString(36).substr(2, 20);
|
63
|
|
- window.history.pushState('VideoChat', 'Room: ' + roomnode, window.location.pathname + roomnode);
|
|
58
|
+ /* fall back to default strategy
|
|
59
|
+ * this is making assumptions about how the URL->room mapping happens.
|
|
60
|
+ * It currently assumes deployment at root, with a rewrite like the
|
|
61
|
+ * following one (for nginx):
|
|
62
|
+ location ~ ^/([a-zA-Z0-9]+)$ {
|
|
63
|
+ rewrite ^/(.*)$ / break;
|
|
64
|
+ }
|
|
65
|
+ */
|
|
66
|
+ if (path.length > 1) {
|
|
67
|
+ roomnode = path.substr(1).toLowerCase();
|
|
68
|
+ } else {
|
|
69
|
+ roomnode = Math.random().toString(36).substr(2, 20);
|
|
70
|
+ window.history.pushState('VideoChat', 'Room: ' + roomnode, window.location.pathname + roomnode);
|
|
71
|
+ }
|
64
|
72
|
}
|
65
|
73
|
roomjid = roomnode + '@' + config.hosts.muc;
|
66
|
74
|
|