Skip to content

Commit

Permalink
add getOriginalMsg() api
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s committed May 20, 2024
1 parent f621c65 commit f78a718
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions jni/dc_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,6 +1715,12 @@ JNIEXPORT jlong Java_com_b44t_messenger_DcMsg_getParentCPtr(JNIEnv *env, jobject
}


JNIEXPORT jlong Java_com_b44t_messenger_DcMsg_getOriginalMsgCPtr(JNIEnv *env, jobject obj)
{
return (jlong)dc_msg_get_original_msg(get_dc_msg(env, obj));
}


JNIEXPORT jstring Java_com_b44t_messenger_DcMsg_getError(JNIEnv *env, jobject obj)
{
char* temp = dc_msg_get_error(get_dc_msg(env, obj));
Expand Down
6 changes: 6 additions & 0 deletions src/com/b44t/messenger/DcMsg.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ public DcMsg getParent() {
return cPtr != 0 ? new DcMsg(cPtr) : null;
}

public DcMsg getOriginalMsg() {
long cPtr = getOriginalMsgCPtr();
return cPtr != 0 ? new DcMsg(cPtr) : null;
}

public File getFileAsFile() {
if(getFile()==null)
throw new AssertionError("expected a file to be present.");
Expand Down Expand Up @@ -249,5 +254,6 @@ public boolean isSeen() {
private native void setQuoteCPtr (long quoteCPtr);
private native long getQuotedMsgCPtr ();
private native long getParentCPtr ();
private native long getOriginalMsgCPtr();
private native String getWebxdcInfoJson ();
};

0 comments on commit f78a718

Please sign in to comment.