1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-22 13:29:21 +00:00

Fix bad refresh

This commit is contained in:
Pierre HUBERT 2021-03-06 14:41:55 +01:00
parent 7f9e2549a2
commit cbb12a87e1

View File

@ -216,11 +216,11 @@ pub fn refresh_single(r: &mut HttpRequestHandler) -> RequestResult {
messages.sort_by(|one, two| one.id.cmp(&two.id));
if messages.len() > 0 {
if messages.len() > 0 && messages.last().unwrap().id > conv.last_message_seen {
conversations_helper::mark_user_seen(
conv.conv_id,
r.user_id_ref()?,
&messages[messages.len() - 1],
&messages.last().unwrap(),
)?;
}