From 4e37610f21c68dc74f778f620cc49a732f2f460a Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Thu, 31 Oct 2019 12:06:38 +0100 Subject: [PATCH] fix boolean error in chatlist::get_msg_id() the error led to unusable contact requests, at least on android and ios (probably also desktop) because msg_id=dc_chatlist_get_msg_id() always returns 0 and create_chat_by_msg_id(msg_id) or dc_marknoticed_contact() failed therefore. --- src/chatlist.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chatlist.rs b/src/chatlist.rs index e15400f1d..9e1e82ed4 100644 --- a/src/chatlist.rs +++ b/src/chatlist.rs @@ -251,7 +251,7 @@ impl Chatlist { /// /// To get the message object from the message ID, use dc_get_msg(). pub fn get_msg_id(&self, index: usize) -> Result { - ensure!(index >= self.ids.len(), "Chatlist index out of range"); + ensure!(index < self.ids.len(), "Chatlist index out of range"); Ok(self.ids[index].1) }