From 6f86da2e8e55fe8b1a687656ce0e5a44bd7b6dd9 Mon Sep 17 00:00:00 2001 From: Guillaume BIENKOWSKI Date: Fri, 11 Jul 2014 10:30:26 +0200 Subject: [PATCH] Invert direction from old messages, because iOS was storing direction in the opposite manner than Linphone core --- Classes/LinphoneManager.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index a02a9774d..fc931d0c8 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -371,6 +371,14 @@ static int check_should_migrate_images(void* data ,int argc,char** argv,char** c goto exit_dbmigration; } + // invert direction of old messages, because iOS was storing the direction flag incorrectly + const char* invert_direction = "UPDATE history SET direction = NOT direction"; + if( sqlite3_exec(newDb, invert_direction, NULL, NULL, &errMsg) != SQLITE_OK){ + [LinphoneLogger log: LinphoneLoggerError format:@"Inverting direction failed, error[%s]", errMsg]; + sqlite3_free(errMsg); + goto exit_dbmigration; + } + // replace empty from: or to: by the current identity. if( default_proxy ){ identity = linphone_proxy_config_get_identity(default_proxy);