*/
public static function setNotification(int $iid)
{
- $fields = ['id', 'uri-id', 'parent-uri-id', 'uid', 'body', 'parent', 'gravity', 'tag',
+ $fields = ['id', 'uri-id', 'parent-uri-id', 'uid', 'body', 'parent', 'gravity',
'private', 'contact-id', 'thr-parent', 'parent-uri', 'author-id', 'verb'];
- $item = Item::selectFirst($fields, ['id' => $iid, 'origin' => false]);
+ $item = Post::selectFirst($fields, ['id' => $iid, 'origin' => false]);
if (!DBA::isResult($item)) {
return;
}
Logger::info('Set notification', ['iid' => $item['id'], 'uid' => $uid, 'notification-type' => $notification_type]);
- DBA::update('user-item', ['notification-type' => $notification_type], ['iid' => $item['id'], 'uid' => $uid], true);
+ $fields = ['notification-type' => $notification_type];
+ Post\User::update($item['uri-id'], $uid, $fields);
+ DBA::update('user-item', $fields, ['iid' => $item['id'], 'uid' => $uid], true);
}
/**
private static function checkCommentedThread(array $item, array $contacts)
{
$condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_PARENT];
- return Item::exists($condition);
+ return Post::exists($condition);
}
/**
private static function checkDirectComment(array $item, array $contacts)
{
$condition = ['uri' => $item['thr-parent'], 'uid' => $item['uid'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_COMMENT];
- return Item::exists($condition);
+ return Post::exists($condition);
}
/**
private static function checkDirectCommentedThread(array $item, array $contacts)
{
$condition = ['uri' => $item['thr-parent'], 'uid' => $item['uid'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_PARENT];
- return Item::exists($condition);
+ return Post::exists($condition);
}
/**
private static function checkCommentedParticipation(array $item, array $contacts)
{
$condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_COMMENT];
- return Item::exists($condition);
+ return Post::exists($condition);
}
/**
private static function checkActivityParticipation(array $item, array $contacts)
{
$condition = ['parent' => $item['parent'], 'author-id' => $contacts, 'deleted' => false, 'gravity' => GRAVITY_ACTIVITY];
- return Item::exists($condition);
+ return Post::exists($condition);
}
}