mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Fix message tester when no storage is used
This commit is contained in:
parent
96a488a5ca
commit
8934000867
4 changed files with 20 additions and 14 deletions
|
|
@ -303,9 +303,9 @@ static void call_received(SalOp *h){
|
|||
linphone_address_destroy(to_addr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
call=linphone_call_new_incoming(lc,from_addr,to_addr,h);
|
||||
|
||||
|
||||
linphone_call_make_local_media_description(lc,call);
|
||||
sal_call_set_local_media_description(call->op,call->localdesc);
|
||||
md=sal_call_get_final_media_description(call->op);
|
||||
|
|
@ -1170,14 +1170,15 @@ static void text_delivery_update(SalOp *op, SalTextDeliveryStatus status){
|
|||
}
|
||||
|
||||
chat_msg->state=chatStatusSal2Linphone(status);
|
||||
linphone_chat_message_store_state(chat_msg);
|
||||
linphone_chat_message_update_state(chat_msg);
|
||||
|
||||
if (chat_msg && chat_msg->cb) {
|
||||
ms_message("Notifying text delivery with status %i",chat_msg->state);
|
||||
chat_msg->cb(chat_msg
|
||||
,chat_msg->state
|
||||
,chat_msg->cb_ud);
|
||||
}
|
||||
if (status != SalTextDeliveryInProgress) { /*don't release op if progress*/
|
||||
if (status != SalTextDeliveryInProgress) { /*only release op if not in progress*/
|
||||
linphone_chat_message_destroy(chat_msg);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -494,6 +494,17 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM
|
|||
linphone_chat_message_unref(msg);
|
||||
}
|
||||
|
||||
void linphone_chat_message_update_state(LinphoneChatMessage* chat_msg ) {
|
||||
linphone_chat_message_store_state(chat_msg);
|
||||
|
||||
if( chat_msg->state == LinphoneChatMessageStateDelivered
|
||||
|| chat_msg->state == LinphoneChatMessageStateNotDelivered ){
|
||||
// message is not transient anymore, we can remove it from our transient list and unref it :
|
||||
chat_msg->chat_room->transient_messages = ms_list_remove(chat_msg->chat_room->transient_messages, chat_msg);
|
||||
linphone_chat_message_unref(chat_msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a message to peer member of this chat room.
|
||||
* @deprecated linphone_chat_room_send_message2() gives more control on the message expedition.
|
||||
|
|
@ -523,7 +534,7 @@ void linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessag
|
|||
addr=linphone_address_new(sal_msg->from);
|
||||
linphone_address_clean(addr);
|
||||
cr=linphone_core_get_chat_room(lc,addr);
|
||||
|
||||
|
||||
if (sal_msg->content_type != NULL) { /* content_type field is, for now, used only for rcs file transfer but we shall strcmp it with "application/vnd.gsma.rcs-ft-http+xml" */
|
||||
xmlChar *file_url = NULL;
|
||||
xmlDocPtr xmlMessageBody;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ static int linphone_chat_message_store_content(LinphoneChatMessage *msg) {
|
|||
linphone_content_get_encoding(content),
|
||||
linphone_content_get_size(content),
|
||||
NULL
|
||||
);
|
||||
);
|
||||
linphone_sql_request(lc->db, buf);
|
||||
sqlite3_free(buf);
|
||||
id = (unsigned int) sqlite3_last_insert_rowid (lc->db);
|
||||
|
|
@ -237,7 +237,7 @@ unsigned int linphone_chat_message_store(LinphoneChatMessage *msg){
|
|||
(int64_t)msg->time,
|
||||
msg->appdata,
|
||||
content_id
|
||||
);
|
||||
);
|
||||
linphone_sql_request(lc->db,buf);
|
||||
sqlite3_free(buf);
|
||||
ms_free(local_contact);
|
||||
|
|
@ -255,13 +255,6 @@ void linphone_chat_message_store_state(LinphoneChatMessage *msg){
|
|||
linphone_sql_request(lc->db,buf);
|
||||
sqlite3_free(buf);
|
||||
}
|
||||
|
||||
if( msg->state == LinphoneChatMessageStateDelivered
|
||||
|| msg->state == LinphoneChatMessageStateNotDelivered ){
|
||||
// message is not transient anymore, we can remove it from our transient list:
|
||||
msg->chat_room->transient_messages = ms_list_remove(msg->chat_room->transient_messages, msg);
|
||||
linphone_chat_message_unref(msg);
|
||||
}
|
||||
}
|
||||
|
||||
void linphone_chat_message_store_appdata(LinphoneChatMessage* msg){
|
||||
|
|
|
|||
|
|
@ -441,6 +441,7 @@ void _linphone_proxy_config_release_ops(LinphoneProxyConfig *obj);
|
|||
/*chat*/
|
||||
void linphone_chat_room_release(LinphoneChatRoom *cr);
|
||||
void linphone_chat_message_destroy(LinphoneChatMessage* msg);
|
||||
void linphone_chat_message_update_state(LinphoneChatMessage* chat_msg );
|
||||
/**/
|
||||
|
||||
struct _LinphoneProxyConfig
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue