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
2c5d6910
Commit
2c5d6910
authored
Jan 31, 2017
by
Erwan Croze
👋🏻
Browse files
Add Lime JNI method
parent
d2654ce5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
15 deletions
+28
-15
coreapi/linphonecore_jni.cc
coreapi/linphonecore_jni.cc
+3
-1
java/common/org/linphone/core/LinphoneChatRoom.java
java/common/org/linphone/core/LinphoneChatRoom.java
+14
-9
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
+11
-5
No files found.
coreapi/linphonecore_jni.cc
View file @
2c5d6910
...
...
@@ -4317,7 +4317,9 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createFileTransferM
return
(
jlong
)
message
;
}
extern
"C"
jboolean
Java_org_linphone_core_LinphoneChatRoomImpl_islimeAvailable
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
)
{
return
(
jboolean
)
linphone_chat_room_lime_available
((
LinphoneChatRoom
*
)
ptr
);
}
extern
"C"
void
Java_org_linphone_core_LinphoneChatMessageImpl_cancelFileTransfer
(
JNIEnv
*
env
,
jobject
thiz
,
jlong
ptr
)
{
linphone_chat_message_cancel_file_transfer
((
LinphoneChatMessage
*
)
ptr
);
...
...
java/common/org/linphone/core/LinphoneChatRoom.java
View file @
2c5d6910
...
...
@@ -33,13 +33,13 @@ public interface LinphoneChatRoom {
* @return LinphoneAddress peer address
*/
LinphoneAddress
getPeerAddress
();
/**
* send a message to peer member of this chat room.
* @param message to be sent
*/
void
sendMessage
(
String
message
);
/**
* Send a message to peer member of this chat room.
* @param message chat message
...
...
@@ -120,26 +120,26 @@ public interface LinphoneChatRoom {
* @return LinphoneChatMessage object
*/
LinphoneChatMessage
createLinphoneChatMessage
(
String
message
,
String
url
,
State
state
,
long
timestamp
,
boolean
isRead
,
boolean
isIncoming
);
/**
* Returns a back pointer to the core managing the chat room.
* @return the LinphoneCore
*/
LinphoneCore
getCore
();
/**
* Create a message attached to a dedicated chat room with a particular content.
* @param content LinphoneContent initial content.
* @return a new LinphoneChatMessage
*/
LinphoneChatMessage
createFileTransferMessage
(
LinphoneContent
content
);
/**
*
*
* @param message
*/
void
sendChatMessage
(
LinphoneChatMessage
message
);
/**
* get Curent Call associated to this chatroom if any
* To commit a message, use #linphone_chat_room_send_message
...
...
@@ -152,6 +152,11 @@ public interface LinphoneChatRoom {
* @return RFC 4103/T.140 char
*/
long
getChar
();
/**
* Return if lime is available in this room
* @param cr: chat room
* @return
*/
boolean
islimeAvailable
();
}
java/impl/org/linphone/core/LinphoneChatRoomImpl.java
View file @
2c5d6910
...
...
@@ -44,14 +44,15 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
boolean
isIncoming
);
private
native
void
sendChatMessage
(
long
ptr
,
Object
message
,
long
messagePtr
);
private
native
void
finalize
(
long
nativePtr
);
private
native
boolean
islimeAvailable
(
long
nativePtr
);
protected
void
finalize
()
throws
Throwable
{
if
(
nativePtr
!=
0
)
{
finalize
(
nativePtr
);
}
super
.
finalize
();
}
protected
LinphoneChatRoomImpl
(
long
aNativePtr
)
{
nativePtr
=
aNativePtr
;
}
...
...
@@ -160,7 +161,7 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
private
LinphoneChatMessage
[]
getHistoryPrivate
(
Object
[]
typesPtr
)
{
return
(
LinphoneChatMessage
[])
typesPtr
;
}
private
native
long
createFileTransferMessage
(
long
ptr
,
String
name
,
String
type
,
String
subtype
,
int
size
);
@Override
public
LinphoneChatMessage
createFileTransferMessage
(
LinphoneContent
content
)
{
...
...
@@ -172,16 +173,21 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
public
void
sendChatMessage
(
LinphoneChatMessage
message
)
{
sendChatMessage
(
nativePtr
,
message
,
((
LinphoneChatMessageImpl
)
message
).
getNativePtr
());
}
private
native
Object
getCall
(
long
nativePtr
);
@Override
public
LinphoneCall
getCall
()
{
return
(
LinphoneCall
)
getCall
(
nativePtr
);
}
private
native
long
getChar
(
long
nativePtr
);
@Override
public
long
getChar
()
{
return
getChar
(
nativePtr
);
}
@Override
public
boolean
islimeAvailable
()
{
return
islimeAvailable
(
nativePtr
);
}
}
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