]> sjero.net Git - linphone/commitdiff
Added GetTime method to LinphoneChatMessage java impl
authorSylvain Berfini <sylvain.berfini@linphone.org>
Thu, 11 Apr 2013 12:34:04 +0000 (14:34 +0200)
committerSylvain Berfini <sylvain.berfini@linphone.org>
Thu, 11 Apr 2013 12:34:04 +0000 (14:34 +0200)
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneChatMessage.java
java/impl/org/linphone/core/LinphoneChatMessageImpl.java

index ddc26f657146565bb40605b052a63e85650b41fe..5046d83bbdc917cfd3e5b8d9eb66b9dc2732c390 100644 (file)
@@ -1871,6 +1871,12 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatMessageImpl_getPeerAddress(J
        return (jlong) linphone_chat_message_get_peer_address((LinphoneChatMessage*)ptr);
 }
 
+extern "C" jlong Java_org_linphone_core_LinphoneChatMessageImpl_getTime(JNIEnv*  env
+                                                                                                                                               ,jobject  thiz
+                                                                                                                                               ,jlong ptr) {
+       return (jlong) linphone_chat_message_get_time((LinphoneChatMessage*)ptr);
+}
+
 extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendMessage(JNIEnv*  env
                                                                                                                                                ,jobject  thiz
                                                                                                                                                ,jlong ptr
index 3a2a4571813edd40c1564708a78e7717853be018..b6b6c30ec3c59026b07041e44984b251f88802aa 100644 (file)
@@ -106,4 +106,10 @@ public interface LinphoneChatMessage {
         * @return the value of the header, or null if not found.
         */
        String  getCustomHeader(String name);
+       
+       /**
+        * Gets the time at which the message was sent
+        * @return the time in milliseconds
+        */
+       long getTime();
 }
index 1373708ca07508a846dc290e1dbe7d71bdeb8260..2a256f2f5d3fe2db0580f2f1c7645f758a029261 100644 (file)
@@ -8,6 +8,7 @@ public class LinphoneChatMessageImpl implements LinphoneChatMessage {
        private native String getExternalBodyUrl(long ptr);
        private native void setExternalBodyUrl(long ptr, String url);
        private native long getFrom(long ptr);
+       private native long getTime(long ptr);
        
        protected LinphoneChatMessageImpl(long aNativePtr)  {
                nativePtr = aNativePtr;
@@ -64,4 +65,8 @@ public class LinphoneChatMessageImpl implements LinphoneChatMessage {
        public String getCustomHeader(String name) {
                return getCustomHeader(nativePtr,name);
        }
+       
+       public long getTime() {
+               return getTime(nativePtr);
+       }
 }