Fix notification for global posts
This commit is contained in:
parent
751bf7ae30
commit
c1caedfa50
1 changed files with 3 additions and 3 deletions
|
@ -604,7 +604,7 @@ function check_user_notification(int $uri_id, int $uid) {
|
||||||
|
|
||||||
$usernotifications = DBA::select('post-user-notification', ['uri-id', 'uid', 'notification-type'], $condition);
|
$usernotifications = DBA::select('post-user-notification', ['uri-id', 'uid', 'notification-type'], $condition);
|
||||||
while ($usernotification = DBA::fetch($usernotifications)) {
|
while ($usernotification = DBA::fetch($usernotifications)) {
|
||||||
check_item_notification($usernotification['uri-id'], $usernotification['uid'], $usernotification['notification-type']);
|
check_item_notification($usernotification['uri-id'], $usernotification['uid'], $usernotification['notification-type'], $uid);
|
||||||
}
|
}
|
||||||
DBA::close($usernotifications);
|
DBA::close($usernotifications);
|
||||||
}
|
}
|
||||||
|
@ -618,11 +618,11 @@ function check_user_notification(int $uri_id, int $uid) {
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
function check_item_notification(int $uri_id, int $uid, int $notification_type) {
|
function check_item_notification(int $uri_id, int $uid, int $notification_type, $post_uid) {
|
||||||
$fields = ['id', 'uri-id', 'mention', 'parent', 'parent-uri-id', 'thr-parent-id',
|
$fields = ['id', 'uri-id', 'mention', 'parent', 'parent-uri-id', 'thr-parent-id',
|
||||||
'title', 'body', 'author-link', 'author-name', 'author-avatar', 'author-id',
|
'title', 'body', 'author-link', 'author-name', 'author-avatar', 'author-id',
|
||||||
'gravity', 'guid', 'parent-uri', 'uri', 'contact-id', 'network'];
|
'gravity', 'guid', 'parent-uri', 'uri', 'contact-id', 'network'];
|
||||||
$condition = ['uri-id' => $uri_id, 'uid' => $uid, 'deleted' => false];
|
$condition = ['uri-id' => $uri_id, 'uid' => [$uid, $post_uid], 'deleted' => false];
|
||||||
$item = Post::selectFirstForUser($uid, $fields, $condition);
|
$item = Post::selectFirstForUser($uid, $fields, $condition);
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue