From 2c02f1184cc576eaced4b72ae7ec6fd54c347ea7 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 28 Jan 2015 15:23:00 -0800 Subject: allow diaspora posts to be delivered to the discover channel unless prohibited from doing so. --- include/diaspora.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/diaspora.php') diff --git a/include/diaspora.php b/include/diaspora.php index e494aac0f..655f5750a 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -15,8 +15,10 @@ function diaspora_dispatch_public($msg) { return; } - // find everybody following or allowing this author + $sys_disabled = get_config('system','disable_diaspora_discover_tab'); + $sys = (($sys_disabled) ? null : get_sys_channel()); + // find everybody following or allowing this author $r = q("SELECT * from channel where channel_id in ( SELECT abook_channel from abook left join xchan on abook_xchan = xchan_hash WHERE xchan_network like '%%diaspora%%' and xchan_addr = '%s' )", dbesc($msg['author']) @@ -29,6 +31,8 @@ function diaspora_dispatch_public($msg) { logger('diaspora_public: delivering to: ' . $rr['channel_name'] . ' (' . $rr['channel_address'] . ') '); diaspora_dispatch($rr,$msg); } + if($sys) + diaspora_dispatch($sys,$msg); } else logger('diaspora_public: no subscribers'); -- cgit v1.2.3 From 54fd8b21db2d8f3841cf590f88611a1d4f44ce48 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 28 Jan 2015 15:27:58 -0800 Subject: make sure we honour the disable_discover_tab pref --- include/diaspora.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/diaspora.php') diff --git a/include/diaspora.php b/include/diaspora.php index 655f5750a..767758164 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -15,7 +15,11 @@ function diaspora_dispatch_public($msg) { return; } - $sys_disabled = get_config('system','disable_diaspora_discover_tab'); + $sys_disabled = true; + + if(! get_config('system','disable_discover_tab')) { + $sys_disabled = get_config('system','disable_diaspora_discover_tab'); + } $sys = (($sys_disabled) ? null : get_sys_channel()); // find everybody following or allowing this author -- cgit v1.2.3 From 872b165eb2bb5d632a12f2d7e1a28e195c2d5348 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 29 Jan 2015 00:25:29 -0800 Subject: implement diaspora profile message (oops) or updated profile photos won't be updated --- include/diaspora.php | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'include/diaspora.php') diff --git a/include/diaspora.php b/include/diaspora.php index 767758164..8f2f93209 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -2168,8 +2168,7 @@ function diaspora_profile($importer,$xml,$msg) { if($name === '') { $name = $handle_parts[0]; } - - + if( preg_match("|^https?://|", $image_url) === 0) { $image_url = "http://" . $handle_parts[1] . $image_url; } @@ -2190,32 +2189,16 @@ function diaspora_profile($importer,$xml,$msg) { if(substr($birthday,5) === substr($contact['bd'],5)) $birthday = $contact['bd']; - // TODO: update name on item['author-name'] if the name changed. See consume_feed() - // Not doing this currently because D* protocol is scheduled for revision soon. - -/* $r = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' , `bd` = '%s' WHERE `id` = %d AND `uid` = %d", + $r = q("update xchan set xchan_name = '%s', xchan_name_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s' where xchan_hash = '%s' ", dbesc($name), dbesc(datetime_convert()), dbesc($images[0]), dbesc($images[1]), dbesc($images[2]), + dbesc($images[3]), dbesc(datetime_convert()), - dbesc($birthday), - intval($contact['id']), - intval($importer['channel_id']) + intval($contact['xchan_hash']) ); -*/ -/* if($r) { - if($oldphotos) { - foreach($oldphotos as $ph) { - q("DELETE FROM `photo` WHERE `uid` = %d AND `contact-id` = %d AND `album` = 'Contact Photos' AND `resource-id` = '%s' ", - intval($importer['channel_id']), - intval($contact['id']), - dbesc($ph['resource-id']) - ); - } - } - } */ return; -- cgit v1.2.3