some diaspora import issues uncovered during dry-run tests
This commit is contained in:
parent
9f9dee28ca
commit
68534fd5dc
@ -52,7 +52,6 @@ function import_diaspora($data) {
|
||||
'permissions_role' => 'social'
|
||||
));
|
||||
|
||||
|
||||
if(! $c['success'])
|
||||
return;
|
||||
|
||||
@ -106,8 +105,8 @@ function import_diaspora($data) {
|
||||
intval($channel_id)
|
||||
);
|
||||
|
||||
if($data['aspects']) {
|
||||
foreach($data['aspects'] as $aspect) {
|
||||
if($data['user']['aspects']) {
|
||||
foreach($data['user']['aspects'] as $aspect) {
|
||||
group_add($channel_id,escape_tags($aspect['name']),intval($aspect['contacts_visible']));
|
||||
}
|
||||
}
|
||||
@ -115,8 +114,8 @@ function import_diaspora($data) {
|
||||
// now add connections and send friend requests
|
||||
|
||||
|
||||
if($data['contacts']) {
|
||||
foreach($data['contacts'] as $contact) {
|
||||
if($data['user']['contacts']) {
|
||||
foreach($data['user']['contacts'] as $contact) {
|
||||
$result = new_contact($channel_id, $contact['person_diaspora_handle'], $c['channel']);
|
||||
if($result['success']) {
|
||||
if($contact['aspects']) {
|
||||
@ -133,7 +132,6 @@ function import_diaspora($data) {
|
||||
// items and comments
|
||||
|
||||
|
||||
proc_run('php','include/notifier.php','location',$channel_id);
|
||||
|
||||
// This will indirectly perform a refresh_all *and* update the directory
|
||||
|
||||
|
@ -93,17 +93,16 @@ function import_post(&$a) {
|
||||
|
||||
$data = json_decode($data,true);
|
||||
|
||||
if(array_key_exists('user',$data) && array_key_exists('aspects',$data)) {
|
||||
// logger('import: data: ' . print_r($data,true));
|
||||
// print_r($data);
|
||||
|
||||
|
||||
if(array_key_exists('user',$data) && array_key_exists('version',$data)) {
|
||||
require_once('include/Import/import_diaspora.php');
|
||||
import_diaspora($data);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// logger('import: data: ' . print_r($data,true));
|
||||
|
||||
// print_r($data);
|
||||
|
||||
// import channel
|
||||
|
||||
$channel = $data['channel'];
|
||||
@ -515,6 +514,7 @@ function import_content(&$a) {
|
||||
'$common' => t('For either option, please choose whether to make this hub your new primary address, or whether your old location should continue this role. You will be able to post from either location, but only one can be marked as the primary location for files, photos, and media.'),
|
||||
'$label_import_primary' => t('Make this hub my primary location'),
|
||||
'$label_import_posts' => t('Import existing posts if possible'),
|
||||
'$pleasewait' => t('This process may take several minutes to complete. Please submit the form only once and leave this page open until finished.'),
|
||||
'$email' => '',
|
||||
'$pass' => '',
|
||||
'$submit' => t('Submit')
|
||||
|
@ -1 +1 @@
|
||||
2015-06-20.1069
|
||||
2015-06-21.1070
|
||||
|
@ -36,5 +36,8 @@
|
||||
<input type="submit" name="submit" id="import-submit-button" value="{{$submit}}" />
|
||||
<div id="import-submit-end" class="import-field-end"></div>
|
||||
|
||||
<div id="import-common-desc" class="descriptive-paragraph">{{$pleasewait}}</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
Reference in New Issue
Block a user