aboutsummaryrefslogtreecommitdiffstats
path: root/include/Import
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-06-19 17:07:31 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-06-19 17:07:31 -0700
commite85d2c4b907ba1ba5aee658ba37c26eaaafc6ef5 (patch)
treece4117064e56ea6c6829707bdc7eb4db5aaadec2 /include/Import
parent0a9d3b4025cf49537c16868a093640fe7891d21c (diff)
downloadvolse-hubzilla-e85d2c4b907ba1ba5aee658ba37c26eaaafc6ef5.tar.gz
volse-hubzilla-e85d2c4b907ba1ba5aee658ba37c26eaaafc6ef5.tar.bz2
volse-hubzilla-e85d2c4b907ba1ba5aee658ba37c26eaaafc6ef5.zip
import_diaspora: add all the friends
Diffstat (limited to 'include/Import')
-rw-r--r--include/Import/import_diaspora.php17
1 files changed, 13 insertions, 4 deletions
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