Reduce the load of "gfollower"

This commit is contained in:
Michael 2020-03-10 21:10:59 +00:00
parent 2b5ef80912
commit f27900ad78
9 changed files with 50 additions and 10 deletions

View file

@ -1695,7 +1695,7 @@ class Item
$fields = ['uri', 'parent-uri', 'id', 'deleted',
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
'wall', 'private', 'forum_mode', 'origin'];
'wall', 'private', 'forum_mode', 'origin', 'author-id'];
$condition = ['uri' => $item['parent-uri'], 'uid' => $item['uid']];
$params = ['order' => ['id' => false]];
$parent = self::selectFirst($fields, $condition, $params);
@ -1750,7 +1750,15 @@ class Item
DBA::update('thread', ['mention' => true], ['iid' => $parent_id]);
Logger::log('tagged thread ' . $parent_id . ' as mention for user ' . $item['uid'], Logger::DEBUG);
}
} else {
// Update the contact relations
if ($item['author-id'] != $parent['author-id']) {
$fields = ['cid' => $parent['author-id'], 'relation-cid' => $item['author-id']];
if (!DBA::exists('contact-relation', $fields)) {
DBA::insert('contact-relation', $fields, true);
}
}
} else {
/*
* Allow one to see reply tweets from status.net even when
* we don't have or can't see the original post.