Fix lime.

This commit is contained in:
Ghislain MARY 2016-12-20 12:38:55 +01:00
parent 66887a5200
commit 6ee6437b21
3 changed files with 17 additions and 9 deletions

View file

@ -67,7 +67,8 @@ void linphone_im_encryption_engine_cbs_set_user_data(LinphoneImEncryptionEngineC
}
LinphoneImEncryptionEngine *linphone_im_encryption_engine_new(LinphoneCore *lc) {
LinphoneImEncryptionEngine *imee = ms_new0(LinphoneImEncryptionEngine, 1);
LinphoneImEncryptionEngine *imee = belle_sip_object_new(LinphoneImEncryptionEngine);
belle_sip_object_ref(imee);
imee->lc = lc;
imee->callbacks = linphone_im_encryption_engine_cbs_new();
return imee;

View file

@ -1953,12 +1953,10 @@ void linphone_core_enable_lime(LinphoneCore *lc, LinphoneLimeState val){
linphone_im_encryption_engine_cbs_set_process_uploading_file(cbs, lime_im_encryption_engine_process_uploading_file_cb);
linphone_im_encryption_engine_cbs_set_is_encryption_enabled_for_file_transfer(cbs, lime_im_encryption_engine_is_file_encryption_enabled_cb);
linphone_im_encryption_engine_cbs_set_generate_file_transfer_key(cbs, lime_im_encryption_engine_generate_file_transfer_key_cb);
lc->im_encryption_engine = imee;
linphone_core_set_im_encryption_engine(lc, imee);
linphone_im_encryption_engine_unref(imee);
} else {
if (lc->im_encryption_engine) {
linphone_im_encryption_engine_unref(lc->im_encryption_engine);
lc->im_encryption_engine = NULL;
}
linphone_core_set_im_encryption_engine(lc, NULL);
}
}
@ -5939,6 +5937,9 @@ static void linphone_core_uninit(LinphoneCore *lc)
if (lc->ringtoneplayer) {
linphone_ringtoneplayer_destroy(lc->ringtoneplayer);
}
if (lc->im_encryption_engine) {
linphone_im_encryption_engine_unref(lc->im_encryption_engine);
}
linphone_core_free_payload_types(lc);
if (lc->supported_formats) ms_free((void *)lc->supported_formats);
@ -7064,7 +7065,13 @@ const char *linphone_core_get_tls_key_path(const LinphoneCore *lc) {
}
void linphone_core_set_im_encryption_engine(LinphoneCore *lc, LinphoneImEncryptionEngine *imee) {
lc->im_encryption_engine = imee;
if (lc->im_encryption_engine) {
linphone_im_encryption_engine_unref(lc->im_encryption_engine);
lc->im_encryption_engine = NULL;
}
if (imee) {
lc->im_encryption_engine = linphone_im_encryption_engine_ref(imee);
}
}
LinphoneImEncryptionEngine *linphone_core_get_im_encryption_engine(const LinphoneCore *lc) {

View file

@ -1492,7 +1492,7 @@ MsZrtpCryptoTypesCount linphone_core_get_zrtp_auth_suites(LinphoneCore *lc, MSZr
MsZrtpCryptoTypesCount linphone_core_get_zrtp_sas_suites(LinphoneCore *lc, MSZrtpSasType sasTypes[MS_MAX_ZRTP_CRYPTO_TYPES]);
struct _LinphoneImEncryptionEngineCbs {
belle_sip_object_t *base;
belle_sip_object_t base;
void *user_data;
LinphoneImEncryptionEngineCbsIncomingMessageCb process_incoming_message;
LinphoneImEncryptionEngineCbsOutgoingMessageCb process_outgoing_message;
@ -1507,7 +1507,7 @@ BELLE_SIP_DECLARE_VPTR(LinphoneImEncryptionEngineCbs);
LinphoneImEncryptionEngineCbs * linphone_im_encryption_engine_cbs_new(void);
struct _LinphoneImEncryptionEngine {
belle_sip_object_t *base;
belle_sip_object_t base;
void *user_data;
LinphoneCore *lc;
LinphoneImEncryptionEngineCbs *callbacks;