diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-06-19 18:06:55 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-06-19 18:06:55 -0700 |
commit | 94e7a425e6fe455238379800c2a8c30bac70ce2f (patch) | |
tree | 6783ca72da71e2c9b882e83ae3dbdef39a4e2b4c /include/Import/import_diaspora.php | |
parent | a6b9d1595e1a33d81fed5ecff6b049c1a0e55b14 (diff) | |
download | volse-hubzilla-94e7a425e6fe455238379800c2a8c30bac70ce2f.tar.gz volse-hubzilla-94e7a425e6fe455238379800c2a8c30bac70ce2f.tar.bz2 volse-hubzilla-94e7a425e6fe455238379800c2a8c30bac70ce2f.zip |
import_diaspora - a few more atypical settings
Diffstat (limited to 'include/Import/import_diaspora.php')
-rw-r--r-- | include/Import/import_diaspora.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/include/Import/import_diaspora.php b/include/Import/import_diaspora.php index 060a1b38d..f81f28273 100644 --- a/include/Import/import_diaspora.php +++ b/include/Import/import_diaspora.php @@ -25,16 +25,27 @@ function import_diaspora($data) { $channel_id = $c['channel']['channel_id']; - // todo - add nsfw, auto follow, (and strip exif in hubzilla) + // todo - add auto follow settings, (and strip exif in hubzilla) $location = escape_tags($data['user']['profile']['location']); if(! $location) $location = ''; + q("update channel set channel_location = '%s' where channel_id = %d", - dbesc($location) + dbesc($location), + intval($channel_id) ); + if($data['user']['profile']['nsfw']) { + // fixme for hubzilla which doesn't use pageflags any more + q("update channel set channel_pageflags = (channel_pageflags & %d) where channel_id = %d", + intval(PAGE_ADULT), + intval($channel_id) + ); + } + + $photos = import_profile_photo($data['user']['profile']['image_url'],$c['channel']['channel_hash']); if($photos[4]) @@ -55,15 +66,20 @@ function import_diaspora($data) { $gender = escape_tags($data['user']['profile']['gender']); $about = diaspora2bb($data['user']['profile']['bio']); + $publish = intval($data['user']['profile']['searchable']); if($data['user']['profile']['birthday']) $dob = datetime_convert('UTC','UTC',$data['user']['profile']['birthday'],'Y-m-d'); else $dob = '0000-00-00'; - $r = q("update profile set gender = '%s', about = '%s', dob = '%s' where uid = %d", + // we're relying on the fact that this channel was just created and will only + // have the default profile currently + + $r = q("update profile set gender = '%s', about = '%s', dob = '%s', publish = %d where uid = %d", dbesc($gender), dbesc($about), dbesc($dob), + dbesc($publish), intval($channel_id) ); |