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
b3c08e5d
Commit
b3c08e5d
authored
Aug 14, 2013
by
Sylvain Berfini
Browse files
Added method to update message's url field in database in case of changes
parent
d16f15f1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
0 deletions
+33
-0
coreapi/linphonecore.h
coreapi/linphonecore.h
+1
-0
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+7
-0
coreapi/message_storage.c
coreapi/message_storage.c
+13
-0
java/common/org/linphone/core/LinphoneChatRoom.java
java/common/org/linphone/core/LinphoneChatRoom.java
+6
-0
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
+6
-0
No files found.
coreapi/linphonecore.h
View file @
b3c08e5d
...
...
@@ -860,6 +860,7 @@ LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_message(LinphoneC
LINPHONE_PUBLIC
const
LinphoneAddress
*
linphone_chat_room_get_peer_address
(
LinphoneChatRoom
*
cr
);
LINPHONE_PUBLIC
void
linphone_chat_room_send_message
(
LinphoneChatRoom
*
cr
,
const
char
*
msg
);
LINPHONE_PUBLIC
void
linphone_chat_room_send_message2
(
LinphoneChatRoom
*
cr
,
LinphoneChatMessage
*
msg
,
LinphoneChatMessageStateChangeCb
status_cb
,
void
*
ud
);
LINPHONE_PUBLIC
void
linphone_chat_room_update_url
(
LinphoneChatRoom
*
cr
,
LinphoneChatMessage
*
msg
);
LINPHONE_PUBLIC
MSList
*
linphone_chat_room_get_history
(
LinphoneChatRoom
*
cr
,
int
nb_message
);
LINPHONE_PUBLIC
void
linphone_chat_room_mark_as_read
(
LinphoneChatRoom
*
cr
);
LINPHONE_PUBLIC
void
linphone_chat_room_delete_message
(
LinphoneChatRoom
*
cr
,
LinphoneChatMessage
*
msg
);
...
...
coreapi/linphonecore_jni.cc
View file @
b3c08e5d
...
...
@@ -2100,6 +2100,13 @@ extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_markAsRead(JNIEnv*
linphone_chat_room_mark_as_read
((
LinphoneChatRoom
*
)
ptr
);
}
extern
"C"
void
Java_org_linphone_core_LinphoneChatRoomImpl_updateUrl
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
room
,
jlong
msg
)
{
linphone_chat_room_update_url
((
LinphoneChatRoom
*
)
room
,
(
LinphoneChatMessage
*
)
msg
);
}
extern
"C"
void
Java_org_linphone_core_LinphoneChatRoomImpl_destroy
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
)
{
...
...
coreapi/message_storage.c
View file @
b3c08e5d
...
...
@@ -165,6 +165,16 @@ void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr){
ms_free
(
peer
);
}
void
linphone_chat_room_update_url
(
LinphoneChatRoom
*
cr
,
LinphoneChatMessage
*
msg
)
{
LinphoneCore
*
lc
=
linphone_chat_room_get_lc
(
cr
);
if
(
lc
->
db
==
NULL
)
return
;
char
*
buf
=
sqlite3_mprintf
(
"update history set url=%Q where id=%i;"
,
msg
->
external_body_url
,
msg
->
storage_id
);
linphone_sql_request
(
lc
->
db
,
buf
);
sqlite3_free
(
buf
);
}
int
linphone_chat_room_get_unread_messages_count
(
LinphoneChatRoom
*
cr
){
LinphoneCore
*
lc
=
linphone_chat_room_get_lc
(
cr
);
int
numrows
=
0
;
...
...
@@ -320,6 +330,9 @@ void linphone_core_message_storage_init(LinphoneCore *lc){
void
linphone_core_message_storage_close
(
LinphoneCore
*
lc
){
}
void
linphone_chat_room_update_url
(
LinphoneChatRoom
*
cr
,
LinphoneChatMessage
*
msg
)
{
}
int
linphone_chat_room_get_unread_messages_count
(
LinphoneChatRoom
*
cr
){
return
0
;
}
...
...
java/common/org/linphone/core/LinphoneChatRoom.java
View file @
b3c08e5d
...
...
@@ -81,4 +81,10 @@ public interface LinphoneChatRoom {
* @param message the message to delete
*/
void
deleteMessage
(
LinphoneChatMessage
message
);
/**
* Update the value stored in the database for the external_body_url field
* @param message to update
*/
void
updateUrl
(
LinphoneChatMessage
message
);
}
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
View file @
b3c08e5d
...
...
@@ -32,6 +32,7 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
private
native
void
deleteHistory
(
long
ptr
);
private
native
void
markAsRead
(
long
ptr
);
private
native
void
deleteMessage
(
long
room
,
long
message
);
private
native
void
updateUrl
(
long
room
,
long
message
);
protected
LinphoneChatRoomImpl
(
long
aNativePtr
)
{
nativePtr
=
aNativePtr
;
...
...
@@ -88,4 +89,9 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
if
(
message
!=
null
)
deleteMessage
(
nativePtr
,
message
.
getNativePtr
());
}
public
void
updateUrl
(
LinphoneChatMessage
message
)
{
if
(
message
!=
null
)
updateUrl
(
nativePtr
,
message
.
getNativePtr
());
}
}
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