jappixmini: improve logging
This commit is contained in:
parent
cd28f9d7cc
commit
9c7b38fb4a
1 changed files with 7 additions and 3 deletions
|
@ -137,6 +137,8 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) {
|
||||||
// autosubscribe
|
// autosubscribe
|
||||||
if (!autosubscribe) return;
|
if (!autosubscribe) return;
|
||||||
|
|
||||||
|
console.log("Start autosubscribe.");
|
||||||
|
|
||||||
var get_roster = new JSJaCIQ();
|
var get_roster = new JSJaCIQ();
|
||||||
get_roster.setType('get');
|
get_roster.setType('get');
|
||||||
get_roster.setQuery(NS_ROSTER);
|
get_roster.setQuery(NS_ROSTER);
|
||||||
|
@ -161,7 +163,6 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) {
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($.inArray("Friendica", groups)==-1) {
|
if ($.inArray("Friendica", groups)==-1) {
|
||||||
console.log("Add "+xid+" to Friendica group.");
|
|
||||||
groups.push("Friendica");
|
groups.push("Friendica");
|
||||||
sendRoster(xid, null, null, groups);
|
sendRoster(xid, null, null, groups);
|
||||||
console.log("Added "+xid+" to Friendica group.");
|
console.log("Added "+xid+" to Friendica group.");
|
||||||
|
@ -170,6 +171,7 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) {
|
||||||
// authorize if necessary
|
// authorize if necessary
|
||||||
if (subscription=="to") {
|
if (subscription=="to") {
|
||||||
sendSubscribe(xid, 'subscribed');
|
sendSubscribe(xid, 'subscribed');
|
||||||
|
console.log("Authorized "+xid+" automatically.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove from list
|
// remove from list
|
||||||
|
@ -188,7 +190,7 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) {
|
||||||
presence.setStatus("I'm "+MINI_NICKNAME+" from ~Friendica.\n[machine-generated message]");
|
presence.setStatus("I'm "+MINI_NICKNAME+" from ~Friendica.\n[machine-generated message]");
|
||||||
|
|
||||||
con.send(presence);
|
con.send(presence);
|
||||||
console.log("subscribed to "+xid);
|
console.log("Subscribed to "+xid+" automatically.");
|
||||||
|
|
||||||
// add to roster
|
// add to roster
|
||||||
var iq = new JSJaCIQ();
|
var iq = new JSJaCIQ();
|
||||||
|
@ -198,9 +200,11 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) {
|
||||||
item.setAttribute('name', contacts[xid]);
|
item.setAttribute('name', contacts[xid]);
|
||||||
item.appendChild(iq.buildNode('group', {'xmlns': NS_ROSTER}, "Friendica"));
|
item.appendChild(iq.buildNode('group', {'xmlns': NS_ROSTER}, "Friendica"));
|
||||||
con.send(iq);
|
con.send(iq);
|
||||||
console.log("added to roster: "+xid);
|
console.log("Added "+xid+" to roster.");
|
||||||
}
|
}
|
||||||
|
console.log("Autosubscribe done.");
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function jappixmini_addon_subscribe() {
|
function jappixmini_addon_subscribe() {
|
||||||
|
|
Loading…
Reference in a new issue