1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-29 16:56:28 +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)); 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( conversations_helper::mark_user_seen(
conv.conv_id, conv.conv_id,
r.user_id_ref()?, r.user_id_ref()?,
&messages[messages.len() - 1], &messages.last().unwrap(),
)?; )?;
} }