diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-08-10 16:16:26 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-08-10 16:16:26 -0700 |
commit | 81c740178d6667c2221b3b795bc31c644e715ce5 (patch) | |
tree | 3f465008660b388fbfd3d27d9c6b572882cb5f9c | |
parent | 2656aeaf9cb8482e22055e9c6788fd1593ff3744 (diff) | |
download | volse-hubzilla-81c740178d6667c2221b3b795bc31c644e715ce5.tar.gz volse-hubzilla-81c740178d6667c2221b3b795bc31c644e715ce5.tar.bz2 volse-hubzilla-81c740178d6667c2221b3b795bc31c644e715ce5.zip |
convert abook_flags from hubzilla during cloning
-rw-r--r-- | mod/import.php | 34 | ||||
-rw-r--r-- | version.inc | 2 |
2 files changed, 31 insertions, 5 deletions
diff --git a/mod/import.php b/mod/import.php index ccedb2c0b..2961867a8 100644 --- a/mod/import.php +++ b/mod/import.php @@ -353,11 +353,37 @@ function import_post(&$a) { $abooks = $data['abook']; if($abooks) { foreach($abooks as $abook) { - if($max_friends !== false && $friends > $max_friends) - continue; - if($max_feeds !== false && ($abook['abook_flags'] & ABOOK_FLAG_FEED) && $feeds > $max_feeds) - continue; + if(array_key_exists('abook_blocked',$abook) && intval($abook['abook_blocked'])) { + $abook['abook_flags'] |= ABOOK_FLAG_BLOCKED; + } + if(array_key_exists('abook_ignored',$abook) && intval($abook['abook_ignored'])) { + $abook['abook_flags'] |= ABOOK_FLAG_IGNORED; + } + if(array_key_exists('abook_hidden',$abook) && intval($abook['abook_hidden'])) { + $abook['abook_flags'] |= ABOOK_FLAG_HIDDEN; + } + if(array_key_exists('abook_archived',$abook) && intval($abook['abook_archived'])) { + $abook['abook_flags'] |= ABOOK_FLAG_ARCHIVED; + } + if(array_key_exists('abook_pending',$abook) && intval($abook['abook_pending'])) { + $abook['abook_flags'] |= ABOOK_FLAG_PENDING; + } + if(array_key_exists('abook_unconnected',$abook) && intval($abook['abook_unconnected'])) { + $abook['abook_flags'] |= ABOOK_FLAG_UNCONNECTED; + } + if(array_key_exists('abook_self',$abook) && intval($abook['abook_self'])) { + $abook['abook_flags'] |= ABOOK_FLAG_SELF; + } + if(array_key_exists('abook_feed',$abook) && intval($abook['abook_feed'])) { + $abook['abook_flags'] |= ABOOK_FLAG_FEED; + } + if(! ( $abook['abook_flags'] & ABOOK_FLAG_SELF)) { + if($max_friends !== false && $friends > $max_friends) + continue; + if($max_feeds !== false && ($abook['abook_flags'] & ABOOK_FLAG_FEED) && $feeds > $max_feeds) + continue; + } unset($abook['abook_id']); $abook['abook_account'] = get_account_id(); $abook['abook_channel'] = $channel['channel_id']; diff --git a/version.inc b/version.inc index 699013c51..a9c1d2158 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2015-08-08.1118 +2015-08-10.1120 |