mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 12:08:11 +00:00
Fix message_storage for WP8
This commit is contained in:
parent
40a82f05f5
commit
4be7d1c931
2 changed files with 14 additions and 8 deletions
|
|
@ -53,7 +53,7 @@
|
|||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\belle-sip\include;$(ProjectDir)..\..\oRTP\include;$(ProjectDir)..\..\mediastreamer2\include;$(ProjectDir)..\..\..\tunnel\include;$(ProjectDir)..\..\coreapi;$(ProjectDir)..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;$(ProjectDir)..\..\..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\belle-sip\include;$(ProjectDir)..\..\oRTP\include;$(ProjectDir)..\..\mediastreamer2\include;$(ProjectDir)..\..\..\tunnel\include;$(ProjectDir)..\..\coreapi;$(ProjectDir)..\..\include;$(SolutionDir)$(Platform)\$(Configuration)\include;$(ProjectDir)..\..\..\zlib;$(ProjectDir)..\..\..\sqlite\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>__STDC_CONSTANT_MACROS;_CRT_SECURE_NO_WARNINGS;WIN32;_WINDOWS;_USRDLL;WINDOW_NATIVE;_TRUE_TIME;IN_LINPHONE;USE_BELLESIP;TUNNEL_ENABLED;VIDEO_ENABLED;LINPHONE_PACKAGE_NAME="linphone";LINPHONE_VERSION="Devel";LIBLINPHONE_EXPORTS;LINPHONE_PLUGINS_DIR=".";UNICODE;_XKEYCHECK_H;HAVE_ZLIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>_DEBUG;MSG_STORAGE_ENABLED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG;MSG_STORAGE_ENABLED;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<StringPooling>true</StringPooling>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
|
|
@ -189,6 +189,9 @@
|
|||
<ProjectReference Include="..\..\..\mswp8vid\mswp8vid\mswp8vid.vcxproj">
|
||||
<Project>{0565952a-ea62-46a2-8261-f5b4b490da42}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\sqlite\sqlite.vcxproj">
|
||||
<Project>{a45d63b9-60de-476c-8836-f8eedbe139d0}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\tunnel\build\wp8\tunnel\tunnel.vcxproj">
|
||||
<Project>{59500dd1-b192-4ddf-a402-8a8e3739e032}</Project>
|
||||
</ProjectReference>
|
||||
|
|
|
|||
|
|
@ -21,10 +21,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "linphonecore.h"
|
||||
|
||||
#ifdef MSG_STORAGE_ENABLED
|
||||
#ifndef PRIu64
|
||||
#define PRIu64 "I64u"
|
||||
#endif
|
||||
|
||||
#include "sqlite3.h"
|
||||
|
||||
static inline LinphoneChatMessage* get_transient_message(LinphoneChatRoom* cr, unsigned int storage_id){
|
||||
static ORTP_INLINE LinphoneChatMessage* get_transient_message(LinphoneChatRoom* cr, unsigned int storage_id){
|
||||
MSList* transients = cr->transient_messages;
|
||||
LinphoneChatMessage* chat;
|
||||
while( transients ){
|
||||
|
|
@ -225,7 +228,7 @@ unsigned int linphone_chat_message_store(LinphoneChatMessage *msg){
|
|||
|
||||
peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(msg->chat_room));
|
||||
local_contact=linphone_address_as_string_uri_only(linphone_chat_message_get_local_address(msg));
|
||||
buf=sqlite3_mprintf("INSERT INTO history VALUES(NULL,%Q,%Q,%i,%Q,%Q,%i,%i,%Q,%i,%Q,%i);",
|
||||
buf = sqlite3_mprintf("INSERT INTO history VALUES(NULL,%Q,%Q,%i,%Q,%Q,%i,%i,%Q,%lld,%Q,%i);",
|
||||
local_contact,
|
||||
peer,
|
||||
msg->dir,
|
||||
|
|
@ -250,7 +253,7 @@ unsigned int linphone_chat_message_store(LinphoneChatMessage *msg){
|
|||
void linphone_chat_message_store_state(LinphoneChatMessage *msg){
|
||||
LinphoneCore *lc=msg->chat_room->lc;
|
||||
if (lc->db){
|
||||
char *buf=sqlite3_mprintf("UPDATE history SET status=%i WHERE (id = %i) AND utc = %i;",
|
||||
char *buf=sqlite3_mprintf("UPDATE history SET status=%i WHERE (id = %i) AND utc = %lld;",
|
||||
msg->state,msg->storage_id,msg->time);
|
||||
linphone_sql_request(lc->db,buf);
|
||||
sqlite3_free(buf);
|
||||
|
|
@ -459,7 +462,7 @@ static int migrate_messages_timestamp(void* data,int argc, char** argv, char** c
|
|||
time_t new_time = parse_time_from_db(argv[1]);
|
||||
if( new_time ){
|
||||
/* replace 'time' by -1 and set 'utc' to the timestamp */
|
||||
char *buf = sqlite3_mprintf("UPDATE history SET utc=%i,time='-1' WHERE id=%i;", new_time, atoi(argv[0]));
|
||||
char *buf = sqlite3_mprintf("UPDATE history SET utc=%lld,time='-1' WHERE id=%i;", new_time, atoi(argv[0]));
|
||||
if( buf) {
|
||||
linphone_sql_request((sqlite3*)data, buf);
|
||||
sqlite3_free(buf);
|
||||
|
|
@ -486,7 +489,7 @@ static void linphone_migrate_timestamps(sqlite3* db){
|
|||
uint64_t end;
|
||||
linphone_sql_request(db, "COMMIT");
|
||||
end=ortp_get_cur_time_ms();
|
||||
ms_message("Migrated message timestamps to UTC in %i ms",(int)(end-begin));
|
||||
ms_message("Migrated message timestamps to UTC in %lld ms",(end-begin));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue