mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 03:28:07 +00:00
Fix a special case in message history retrieval.
This function is not yet completely tested,
This commit is contained in:
parent
96ca18f8db
commit
06de47db2e
2 changed files with 5 additions and 1 deletions
|
|
@ -371,7 +371,7 @@ MSList *linphone_chat_room_get_history_range(LinphoneChatRoom *cr, int startm, i
|
|||
|
||||
if (startm<0) startm=0;
|
||||
|
||||
if (endm>0&&endm>=startm){
|
||||
if ((endm>0&&endm>=startm) || (startm == 0 && endm == 0) ){
|
||||
buf2=ms_strdup_printf("%s LIMIT %i ",buf,endm+1-startm);
|
||||
ms_free(buf);
|
||||
buf = buf2;
|
||||
|
|
|
|||
|
|
@ -1045,6 +1045,10 @@ static void history_messages_count() {
|
|||
CU_ASSERT_EQUAL(ms_list_size(messages), 10);
|
||||
ms_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref);
|
||||
|
||||
messages=linphone_chat_room_get_history(chatroom,1);
|
||||
CU_ASSERT_EQUAL(ms_list_size(messages), 1);
|
||||
ms_list_free_with_data(messages, (void (*)(void*))linphone_chat_message_unref);
|
||||
|
||||
messages=linphone_chat_room_get_history(chatroom,0);
|
||||
CU_ASSERT_EQUAL(linphone_chat_room_get_history_size(chatroom), 1270);
|
||||
CU_ASSERT_EQUAL(ms_list_size(messages), 1270);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue