mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-04-25 15:10:20 +00:00
make bosh proxy optional, add subscribe functionality and some more improvements of jappixmini addon
This commit is contained in:
parent
011bf47e59
commit
c376bc162b
3 changed files with 128 additions and 21 deletions
|
@ -108,12 +108,26 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) {
|
|||
}
|
||||
}
|
||||
|
||||
function jappixmini_addon_start(server, username, bosh, encrypted_password, nickname) {
|
||||
function jappixmini_addon_subscribe() {
|
||||
if (!window.con) {
|
||||
alert("Not connected.");
|
||||
return;
|
||||
}
|
||||
|
||||
xid = prompt("Jabber address");
|
||||
sendSubscribe(xid, "subscribe");
|
||||
}
|
||||
|
||||
function jappixmini_addon_start(server, username, bosh, encrypted, password, nickname) {
|
||||
// decrypt password
|
||||
if (encrypted)
|
||||
password = jappixmini_addon_decrypt_password(password);
|
||||
|
||||
// check if settings have changed, reinitialize jappix mini if this is the case
|
||||
settings_identifier = str_sha1(server);
|
||||
settings_identifier += str_sha1(username);
|
||||
settings_identifier += str_sha1(bosh);
|
||||
settings_identifier += str_sha1(encrypted_password);
|
||||
settings_identifier += str_sha1(password);
|
||||
settings_identifier += str_sha1(nickname);
|
||||
|
||||
saved_identifier = getDB("jappix-mini", "settings_identifier");
|
||||
|
@ -121,10 +135,8 @@ function jappixmini_addon_start(server, username, bosh, encrypted_password, nick
|
|||
setDB("jappix-mini", "settings_identifier", settings_identifier);
|
||||
|
||||
// set bosh host
|
||||
HOST_BOSH = HOST_BOSH+"?host_bosh="+encodeURI(bosh);
|
||||
|
||||
// decrypt password
|
||||
password = jappixmini_addon_decrypt_password(encrypted_password);
|
||||
if (bosh)
|
||||
HOST_BOSH = HOST_BOSH+"?host_bosh="+encodeURI(bosh);
|
||||
|
||||
// start jappix mini
|
||||
MINI_NICKNAME = nickname;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue