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
89340008
Commit
89340008
authored
Nov 24, 2014
by
Guillaume BIENKOWSKI
Browse files
Fix message tester when no storage is used
parent
96a488a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
14 deletions
+20
-14
coreapi/callbacks.c
coreapi/callbacks.c
+5
-4
coreapi/chat.c
coreapi/chat.c
+12
-1
coreapi/message_storage.c
coreapi/message_storage.c
+2
-9
coreapi/private.h
coreapi/private.h
+1
-0
No files found.
coreapi/callbacks.c
View file @
89340008
...
...
@@ -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
)
{
/*
d
on
't
release op if progress*/
if
(
status
!=
SalTextDeliveryInProgress
)
{
/*on
ly
release op if
not in
progress*/
linphone_chat_message_destroy
(
chat_msg
);
}
}
...
...
coreapi/chat.c
View file @
89340008
...
...
@@ -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
;
...
...
coreapi/message_storage.c
View file @
89340008
...
...
@@ -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
){
...
...
coreapi/private.h
View file @
89340008
...
...
@@ -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
...
...
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