// autosubscribe
if (!autosubscribe) return;
+ console.log("Start autosubscribe.");
+
var get_roster = new JSJaCIQ();
get_roster.setType('get');
get_roster.setQuery(NS_ROSTER);
});
if ($.inArray("Friendica", groups)==-1) {
- console.log("Add "+xid+" to Friendica group.");
groups.push("Friendica");
sendRoster(xid, null, null, groups);
console.log("Added "+xid+" to Friendica group.");
// authorize if necessary
if (subscription=="to") {
sendSubscribe(xid, 'subscribed');
+ console.log("Authorized "+xid+" automatically.");
}
// remove from list
presence.setStatus("I'm "+MINI_NICKNAME+" from ~Friendica.\n[machine-generated message]");
con.send(presence);
- console.log("subscribed to "+xid);
+ console.log("Subscribed to "+xid+" automatically.");
// add to roster
var iq = new JSJaCIQ();
item.setAttribute('name', contacts[xid]);
item.appendChild(iq.buildNode('group', {'xmlns': NS_ROSTER}, "Friendica"));
con.send(iq);
- console.log("added to roster: "+xid);
+ console.log("Added "+xid+" to roster.");
}
+ console.log("Autosubscribe done.");
});
+
}
function jappixmini_addon_subscribe() {