From e85d2c4b907ba1ba5aee658ba37c26eaaafc6ef5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 19 Jun 2015 17:07:31 -0700 Subject: import_diaspora: add all the friends --- include/Import/import_diaspora.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include/Import') diff --git a/include/Import/import_diaspora.php b/include/Import/import_diaspora.php index c9c785385..060a1b38d 100644 --- a/include/Import/import_diaspora.php +++ b/include/Import/import_diaspora.php @@ -2,6 +2,7 @@ require_once('include/bb2diaspora.php'); require_once('include/group.php'); +require_once('include/follow.php'); function import_diaspora($data) { $a = get_app(); @@ -75,16 +76,24 @@ function import_diaspora($data) { // now add connections and send friend requests - - + if($data['contacts']) { + foreach($data['contacts'] as $contact) { + $result = new_contact($channel_id, $contact['person_diaspora_handle'], $c['channel']); + if($result['success']) { + if($contact['aspects']) { + foreach($contact['aspects'] as $aspect) { + group_add_member($channel_id,$aspect['name'],$result['abook']['xchan_hash']); + } + } + } + } + } // Then add items - note this can't be done until Diaspora adds guids to exported // items and comments - - proc_run('php','include/notifier.php','location',$channel_id); // This will indirectly perform a refresh_all *and* update the directory -- cgit v1.2.3