From b7b302105316a5915e02d28803aab61809633b3e Mon Sep 17 00:00:00 2001 From: Leberwurscht Date: Tue, 17 Apr 2012 23:38:27 +0200 Subject: [PATCH] jappixmini: no multiple 'Friendica' groups in roster --- jappixmini/lib.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jappixmini/lib.js b/jappixmini/lib.js index 6c47f590..deeb8b46 100644 --- a/jappixmini/lib.js +++ b/jappixmini/lib.js @@ -164,13 +164,17 @@ function jappixmini_manage_roster(contacts, contacts_hash, autoapprove, autosubs // add to Friendica group or change name if necessary var groups = []; + var group_missing = false; node.find('group').each(function() { var group_text = $(this).text(); if (group_text) groups.push(group_text); }); - - if ($.inArray("Friendica", groups)==-1 || name!=contacts[xid]) { + if ($.inArray("Friendica", groups)==-1) { + group_missing = true; groups.push("Friendica"); + } + + if (group_missing || name!=contacts[xid]) { sendRoster(xid, null, contacts[xid], groups); console.log("Added "+xid+" to Friendica group and set name to "+contacts[xid]+"."); }