mirror of
https://github.com/friendica/friendica
synced 2025-04-23 22:30:10 +00:00
Added handling another situation
This commit is contained in:
parent
4f1e61457d
commit
59045b2e23
2 changed files with 52 additions and 26 deletions
|
@ -193,7 +193,7 @@ class Notification extends BaseModel
|
|||
$announce = Verb::getID(Activity::ANNOUNCE);
|
||||
$post = Verb::getID(Activity::POST);
|
||||
|
||||
if (in_array($notification['type'], [Post\UserNotification::NOTIF_THREAD_COMMENT, Post\UserNotification::NOTIF_COMMENT_PARTICIPATION, Post\UserNotification::NOTIF_EXPLICIT_TAGGED])) {
|
||||
if (in_array($notification['type'], [Post\UserNotification::NOTIF_THREAD_COMMENT, Post\UserNotification::NOTIF_COMMENT_PARTICIPATION, Post\UserNotification::NOTIF_ACTIVITY_PARTICIPATION, Post\UserNotification::NOTIF_EXPLICIT_TAGGED])) {
|
||||
$item = Post::selectFirst([], ['uri-id' => $notification['parent-uri-id'], 'uid' => [0, $notification['uid']]], ['order' => ['uid' => true]]);
|
||||
if (empty($item)) {
|
||||
Logger::info('Parent post not found', ['uri-id' => $notification['parent-uri-id']]);
|
||||
|
@ -221,6 +221,12 @@ class Notification extends BaseModel
|
|||
Logger::info('Causer not found', ['causer' => $item['causer-id']]);
|
||||
return $message;
|
||||
}
|
||||
} elseif (in_array($notification['type'], [Post\UserNotification::NOTIF_COMMENT_PARTICIPATION, Post\UserNotification::NOTIF_ACTIVITY_PARTICIPATION])) {
|
||||
$contact = Contact::getById($item['author-id'], ['id', 'name', 'url']);
|
||||
if (empty($contact)) {
|
||||
Logger::info('Author not found', ['author' => $item['author-id']]);
|
||||
return $message;
|
||||
}
|
||||
}
|
||||
|
||||
$link = DI::baseUrl() . '/display/' . urlencode($item['guid']);
|
||||
|
@ -284,11 +290,16 @@ class Notification extends BaseModel
|
|||
break;
|
||||
|
||||
case Post\UserNotification::NOTIF_COMMENT_PARTICIPATION:
|
||||
$msg = $l10n->t('%1$s commented in the thread %2$s');
|
||||
break;
|
||||
|
||||
case Post\UserNotification::NOTIF_ACTIVITY_PARTICIPATION:
|
||||
// Unhandled
|
||||
if (($causer['id'] == $contact['id']) && ($title != '')) {
|
||||
$msg = $l10n->t('%1$s commented in their thread %2$s');
|
||||
} elseif ($causer['id'] == $contact['id']) {
|
||||
$msg = $l10n->t('%1$s commented in their thread');
|
||||
} elseif ($title != '') {
|
||||
$msg = $l10n->t('%1$s commented in the thread %2$s from %3$s');
|
||||
} else {
|
||||
$msg = $l10n->t('%1$s commented in the thread from %3$s');
|
||||
}
|
||||
break;
|
||||
|
||||
case Post\UserNotification::NOTIF_DIRECT_THREAD_COMMENT:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue