From: Leberwurscht Date: Tue, 17 Apr 2012 19:15:32 +0000 (+0200) Subject: jappixmini: improve logging X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9c7b38fb4aea603b62ad5af8c32e841791521001;p=friendica-addons.git jappixmini: improve logging --- diff --git a/jappixmini/lib.js b/jappixmini/lib.js index a270a28f..1f2586b3 100644 --- a/jappixmini/lib.js +++ b/jappixmini/lib.js @@ -137,6 +137,8 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) { // autosubscribe if (!autosubscribe) return; + console.log("Start autosubscribe."); + var get_roster = new JSJaCIQ(); get_roster.setType('get'); get_roster.setQuery(NS_ROSTER); @@ -161,7 +163,6 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) { }); 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."); @@ -170,6 +171,7 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) { // authorize if necessary if (subscription=="to") { sendSubscribe(xid, 'subscribed'); + console.log("Authorized "+xid+" automatically."); } // 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]"); con.send(presence); - console.log("subscribed to "+xid); + console.log("Subscribed to "+xid+" automatically."); // add to roster var iq = new JSJaCIQ(); @@ -198,9 +200,11 @@ function jappixmini_manage_roster(contacts, autoapprove, autosubscribe) { 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() {