3 Jappix - An open social platform
4 These are the XMPP links handling JS scripts for Jappix
6 -------------------------------------------------
10 Last revision: 08/05/11
14 // Does an action with the provided XMPP link
15 function xmppLink(link) {
16 /* REF: http://xmpp.org/registrar/querytypes.html */
18 // Remove the "xmpp:" string
19 link = explodeThis(':', link, 1);
21 // The XMPP URI has no "?"
22 if(link.indexOf('?') == -1)
23 checkChatCreate(link, 'chat');
27 var xid = explodeThis('?', link, 0);
28 var action = explodeThis('?', link, 1);
33 checkChatCreate(xid, 'groupchat');
51 sendRoster(xid, 'remove');
57 checkChatCreate(xid, 'chat');
66 // Gets the links vars (get parameters in URL)
67 var LINK_VARS = (function() {
69 var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
71 for(var i = 0; i < hashes.length; i++) {
72 var hash = hashes[i].split('=');
74 vars[hash[0]] = decodeURIComponent(hash[1]);