mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-12 18:56:12 +00:00
Mark own private messages as read in api (fixes #2484)
This commit is contained in:
parent
b5cd732372
commit
6b73184a2f
|
@ -39,6 +39,14 @@ impl PerformCrud for GetPrivateMessages {
|
|||
})
|
||||
.await??;
|
||||
|
||||
// Messages sent by ourselves should be marked as read. The `read` column in database is only
|
||||
// for the recipient, and shouldnt be exposed to sender.
|
||||
messages.iter_mut().for_each(|pmv| {
|
||||
if pmv.creator.id == person_id {
|
||||
pmv.private_message.read = true
|
||||
}
|
||||
});
|
||||
|
||||
// Blank out deleted or removed info
|
||||
for pmv in messages
|
||||
.iter_mut()
|
||||
|
|
Loading…
Reference in a new issue