Merge pull request #8561 from annando/issue-8560

Iissue 8560: Wrong value for parent in mail notification
This commit is contained in:
Hypolite Petovan 2020-04-28 16:39:01 -04:00 committed by GitHub
commit 99ce487e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View File

@ -352,13 +352,7 @@ function message_content(App $a)
$messages = DBA::toArray($messages_stmt); $messages = DBA::toArray($messages_stmt);
DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => local_user()]); DBA::update('mail', ['seen' => 1], ['parent-uri' => $message['parent-uri'], 'uid' => local_user()]);
DBA::update('notify', ['seen' => 1], ['type' => Type::MAIL, 'parent' => $message['id'], 'uid' => local_user()]);
if ($message['convid']) {
// Clear Diaspora private message notifications
DBA::update('notify', ['seen' => 1], ['type' => Type::MAIL, 'parent' => $message['convid'], 'uid' => local_user()]);
}
// Clear DFRN private message notifications
DBA::update('notify', ['seen' => 1], ['type' => Type::MAIL, 'parent' => $message['parent-uri'], 'uid' => local_user()]);
} else { } else {
$messages = false; $messages = false;
} }

View File

@ -92,7 +92,7 @@ class Mail
'to_email' => $user['email'], 'to_email' => $user['email'],
'uid' => $user['uid'], 'uid' => $user['uid'],
'item' => $msg, 'item' => $msg,
'parent' => 0, 'parent' => $msg['id'],
'source_name' => $msg['from-name'], 'source_name' => $msg['from-name'],
'source_link' => $msg['from-url'], 'source_link' => $msg['from-url'],
'source_photo' => $msg['from-photo'], 'source_photo' => $msg['from-photo'],