Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
60708a53
Commit
60708a53
authored
Jan 06, 2016
by
Simon Morlat
Browse files
repair message storage
parent
c82307a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
coreapi/callbacks.c
View file @
60708a53
...
...
@@ -187,7 +187,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
ms_message
(
"Media ip type has changed, destroying sessions context on call [%p]"
,
call
);
ms_media_stream_sessions_uninit
(
&
call
->
sessions
[
call
->
main_audio_stream_index
]);
ms_media_stream_sessions_uninit
(
&
call
->
sessions
[
call
->
main_video_stream_index
]);
if
(
call
->
params
->
realtimetext_enabled
)
ms_media_stream_sessions_uninit
(
&
call
->
sessions
[
call
->
main_text_stream_index
]);
ms_media_stream_sessions_uninit
(
&
call
->
sessions
[
call
->
main_text_stream_index
]);
}
linphone_call_init_media_streams
(
call
);
}
...
...
coreapi/linphonecore.c
View file @
60708a53
...
...
@@ -2947,7 +2947,7 @@ int linphone_core_restart_invite(LinphoneCore *lc, LinphoneCall *call){
linphone_call_stop_media_streams
(
call
);
ms_media_stream_sessions_uninit
(
&
call
->
sessions
[
call
->
main_audio_stream_index
]);
ms_media_stream_sessions_uninit
(
&
call
->
sessions
[
call
->
main_video_stream_index
]);
if
(
call
->
params
->
realtimetext_enabled
)
ms_media_stream_sessions_uninit
(
&
call
->
sessions
[
call
->
main_text_stream_index
]);
ms_media_stream_sessions_uninit
(
&
call
->
sessions
[
call
->
main_text_stream_index
]);
linphone_call_init_media_streams
(
call
);
return
linphone_core_start_invite
(
lc
,
call
,
NULL
);
}
...
...
coreapi/message_storage.c
View file @
60708a53
...
...
@@ -468,12 +468,13 @@ MSList *linphone_chat_room_get_history_range(LinphoneChatRoom *cr, int startm, i
ms_free
(
buf
);
buf
=
buf2
;
}
begin
=
ortp_get_cur_time_ms
();
linphone_sql_request_message
(
lc
->
db
,
buf
,
cr
);
end
=
ortp_get_cur_time_ms
();
if
(
endm
+
1
-
startm
>
1
)
{
//display message only if at least 2 messages are loaded
begin
=
ortp_get_cur_time_ms
();
linphone_sql_request_message
(
lc
->
db
,
buf
,
cr
);
end
=
ortp_get_cur_time_ms
();
ms_message
(
"%s(): completed in %i ms"
,
__FUNCTION__
,
(
int
)(
end
-
begin
));
}
ms_free
(
buf
);
...
...
tester/message_tester.c
View file @
60708a53
...
...
@@ -1241,8 +1241,16 @@ static void history_count(void) {
messages
=
linphone_chat_room_get_history
(
chatroom
,
0
);
BC_ASSERT_EQUAL
(
linphone_chat_room_get_history_size
(
chatroom
),
1270
,
int
,
"%d"
);
BC_ASSERT_EQUAL
(
ms_list_size
(
messages
),
1270
,
int
,
"%d"
);
/*check the second most recent msg*/
BC_ASSERT_STRING_EQUAL
(
linphone_chat_message_get_text
((
LinphoneChatMessage
*
)
messages
->
next
->
data
),
"Fore and aft follow each other."
);
BC_ASSERT_PTR_NOT_NULL
(
messages
);
if
(
messages
){
BC_ASSERT_PTR_NOT_NULL
(
messages
->
next
->
data
);
if
(
messages
->
next
->
data
){
BC_ASSERT_STRING_EQUAL
(
linphone_chat_message_get_text
((
LinphoneChatMessage
*
)
messages
->
next
->
data
),
"Fore and aft follow each other."
);
}
}
ms_list_free_with_data
(
messages
,
(
void
(
*
)(
void
*
))
linphone_chat_message_unref
);
/*test offset+limit: retrieve the 42th latest msg only and check its content*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment