mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 23:06:32 +03:00
off by one: show chats cnt-1..0 instead of cnt-1..1
This commit is contained in:
@@ -606,7 +606,6 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
let listflags = if arg0 == "listarchived" { 0x01 } else { 0 };
|
let listflags = if arg0 == "listarchived" { 0x01 } else { 0 };
|
||||||
let chatlist = Chatlist::try_load(context, listflags, Some(arg1), None)?;
|
let chatlist = Chatlist::try_load(context, listflags, Some(arg1), None)?;
|
||||||
|
|
||||||
let mut i: usize;
|
|
||||||
let cnt = chatlist.len();
|
let cnt = chatlist.len();
|
||||||
if cnt > 0 {
|
if cnt > 0 {
|
||||||
info!(
|
info!(
|
||||||
@@ -614,9 +613,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
"================================================================================"
|
"================================================================================"
|
||||||
);
|
);
|
||||||
|
|
||||||
i = cnt - 1;
|
for i in (0..cnt).rev() {
|
||||||
|
|
||||||
while i > 0 {
|
|
||||||
let chat = dc_get_chat(context, chatlist.get_chat_id(i));
|
let chat = dc_get_chat(context, chatlist.get_chat_id(i));
|
||||||
let temp_subtitle = dc_chat_get_subtitle(chat);
|
let temp_subtitle = dc_chat_get_subtitle(chat);
|
||||||
let temp_name = dc_chat_get_name(chat);
|
let temp_name = dc_chat_get_name(chat);
|
||||||
@@ -670,8 +667,6 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
context, 0,
|
context, 0,
|
||||||
"================================================================================"
|
"================================================================================"
|
||||||
);
|
);
|
||||||
|
|
||||||
i -= 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if dc_is_sending_locations_to_chat(context, 0 as uint32_t) {
|
if dc_is_sending_locations_to_chat(context, 0 as uint32_t) {
|
||||||
|
|||||||
Reference in New Issue
Block a user