1
0
Fork 0

Use gravity instead of verb

This commit is contained in:
Michael 2018-06-27 18:09:33 +00:00
commit 76dab3b2d7
14 changed files with 59 additions and 56 deletions

View file

@ -567,7 +567,7 @@ function item_post(App $a) {
$network = NETWORK_DFRN;
}
$gravity = ($parent ? 6 : 0);
$gravity = ($parent ? GRAVITY_COMMENT : GRAVITY_PARENT);
// even if the post arrived via API we are considering that it
// originated on this site by default for determining relayability.

View file

@ -756,7 +756,7 @@ function networkThreadedView(App $a, $update, $parent)
// Load all unseen items
$sql_extra4 = "`item`.`unseen`";
if (Config::get("system", "like_no_comment")) {
$sql_extra4 .= " AND `item`.`verb` = '".ACTIVITY_POST."'";
$sql_extra4 .= " AND `item`.`gravity` IN (" . GRAVITY_PARENT . "," . GRAVITY_COMMENT . ")";
}
if ($order === 'post') {
// Only show toplevel posts when updating posts in this order mode

View file

@ -640,6 +640,7 @@ function photos_post(App $a)
$arr['deny_gid'] = $p[0]['deny_gid'];
$arr['visible'] = 1;
$arr['verb'] = ACTIVITY_TAG;
$arr["gravity"] = GRAVITY_PARENT;
$arr['object-type'] = ACTIVITY_OBJ_PERSON;
$arr['target-type'] = ACTIVITY_OBJ_IMAGE;
$arr['tag'] = $tagged[4];

View file

@ -243,17 +243,14 @@ function profile_content(App $a, $update = 0)
$r = q("SELECT distinct(parent) AS `item_id`, `item`.`network` AS `item_network`, `item`.`created`
FROM `item` INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND
(`item`.`deleted` = 0 OR item.verb = '" . ACTIVITY_LIKE . "'
OR item.verb = '" . ACTIVITY_DISLIKE . "' OR item.verb = '" . ACTIVITY_ATTEND . "'
OR item.verb = '" . ACTIVITY_ATTENDNO . "' OR item.verb = '" . ACTIVITY_ATTENDMAYBE . "')
AND `item`.`moderated` = 0
AND `item`.`wall` = 1
AND NOT `contact`.`blocked` AND NOT `contact`.`pending`
WHERE `item`.`uid` = %d AND `item`.`visible` AND
(NOT `item`.`deleted` OR `item`.`gravity` = %d)
AND NOT `item`.`moderated` AND `item`.`wall`
$sql_extra4
$sql_extra
ORDER BY `item`.`created` DESC",
intval($a->profile['profile_uid'])
intval($a->profile['profile_uid']), intval(GRAVITY_ACTIVITY)
);
if (!DBM::is_result($r)) {

View file

@ -125,7 +125,7 @@ EOT;
$arr['type'] = 'activity';
$arr['wall'] = $item['wall'];
$arr['origin'] = 1;
$arr['gravity'] = GRAVITY_LIKE;
$arr['gravity'] = GRAVITY_ACTIVITY;
$arr['parent'] = $item['id'];
$arr['parent-uri'] = $item['uri'];
$arr['thr-parent'] = $item['uri'];

View file

@ -121,7 +121,7 @@ EOT;
$arr['contact-id'] = $contact['id'];
$arr['type'] = 'activity';
$arr['wall'] = $item['wall'];
$arr['gravity'] = GRAVITY_COMMENT;
$arr['gravity'] = GRAVITY_ACTIVITY;
$arr['parent'] = $item['id'];
$arr['parent-uri'] = $item['uri'];
$arr['owner-name'] = $item['author-name'];