Only import OStatus threads if we follow the thread starter

This commit is contained in:
Michael Vogel 2016-03-06 14:53:30 +01:00
parent bb06026147
commit 4bd1061a09
3 changed files with 11 additions and 1 deletions

View File

@ -1509,6 +1509,9 @@ function killme() {
* @brief Redirect to another URL and terminate this process.
*/
function goaway($s) {
if (!strstr(normalise_link($s), normalise_link(App::get_baseurl())))
$s = App::get_baseurl()."/".$s;
header("Location: $s");
killme();
}

View File

@ -809,6 +809,13 @@ function ostatus_completion($conversation_url, $uid, $item = array()) {
// 2. This first post is a post inside our thread
// 3. This first post is a post inside another thread
if (($first_id != $parent["uri"]) AND ($parent["uri"] != "")) {
// Do we only want to import threads that were started by our contacts?
if (get_config('system','ostatus_full_threads')) {
logger("Don't import uri ".$first_id." because we don't follow this person.", LOGGER_DEBUG);
continue;
}
$new_parents = q("SELECT `id`, `parent`, `uri`, `contact-id`, `type`, `verb`, `visible` FROM `item` WHERE `id` IN
(SELECT `parent` FROM `item`
WHERE `uid` = %d AND `uri` = '%s' AND `network` IN ('%s','%s')) LIMIT 1",

View File

@ -949,7 +949,7 @@ function admin_page_site(&$a) {
'$max_author_posts_community_page' => array('max_author_posts_community_page', t("Posts per user on community page"), get_config('system','max_author_posts_community_page'), t("The maximum number of posts per user on the community page. (Not valid for 'Global Community')")),
'$ostatus_disabled' => array('ostatus_disabled', t("Enable OStatus support"), !get_config('system','ostatus_disabled'), t("Provide built-in OStatus \x28StatusNet, GNU Social etc.\x29 compatibility. All communications in OStatus are public, so privacy warnings will be occasionally displayed.")),
'$ostatus_poll_interval' => array('ostatus_poll_interval', t("OStatus conversation completion interval"), (string) intval(get_config('system','ostatus_poll_interval')), t("How often shall the poller check for new entries in OStatus conversations? This can be a very ressource task."), $ostatus_poll_choices),
'$ostatus_full_threads' => array('ostatus_disabled', t("Only import OStatus threads from our contacts"), get_config('system','ostatus_full_threads'), t("Normally we import every content from our OStatus contacts. With this option we only store threads that are started by a contact that is known on our system.")),
'$ostatus_full_threads' => array('ostatus_full_threads', t("Only import OStatus threads from our contacts"), get_config('system','ostatus_full_threads'), t("Normally we import every content from our OStatus contacts. With this option we only store threads that are started by a contact that is known on our system.")),
'$ostatus_not_able' => t("OStatus support can only be enabled if threading is enabled."),
'$diaspora_able' => $diaspora_able,
'$diaspora_not_able' => t("Diaspora support can't be enabled because Friendica was installed into a sub directory."),