Quick fixes

This commit is contained in:
Valere 2021-12-02 17:48:47 +01:00 committed by Hubert Chathi
parent f647747d27
commit e854c0f907
2 changed files with 10 additions and 2 deletions

View file

@ -501,6 +501,7 @@ public class OlmAccount extends CommonSerializeUtils implements Serializable {
* This should be called once you are reasonably certain that you will not * This should be called once you are reasonably certain that you will not
* receive any more messages that use the old fallback key (e.g. 5 minutes * receive any more messages that use the old fallback key (e.g. 5 minutes
* after the new fallback key has been published). * after the new fallback key has been published).
* @throws OlmException the failure reason
**/ **/
public void forgetFallbackKey() throws OlmException { public void forgetFallbackKey() throws OlmException {
try { try {

View file

@ -577,6 +577,7 @@ JNIEXPORT jbyteArray OLM_ACCOUNT_FUNC_DEF(fallbackKeyJni)(JNIEnv *env, jobject t
**/ **/
JNIEXPORT void OLM_ACCOUNT_FUNC_DEF(forgetFallbackKeyJni)(JNIEnv *env, jobject thiz) JNIEXPORT void OLM_ACCOUNT_FUNC_DEF(forgetFallbackKeyJni)(JNIEnv *env, jobject thiz)
{ {
const char* errorMessage = NULL;
OlmAccount *accountPtr = getAccountInstanceId(env, thiz); OlmAccount *accountPtr = getAccountInstanceId(env, thiz);
if (!accountPtr) if (!accountPtr)
@ -586,8 +587,14 @@ JNIEXPORT void OLM_ACCOUNT_FUNC_DEF(forgetFallbackKeyJni)(JNIEnv *env, jobject t
} }
else else
{ {
olm_account_forget_old_fallback_key(accountPtr) olm_account_forget_old_fallback_key(accountPtr);
} }
if (errorMessage)
{
env->ThrowNew(env->FindClass("java/lang/Exception"), errorMessage);
}
} }
/** /**
@ -643,7 +650,7 @@ JNIEXPORT jbyteArray OLM_ACCOUNT_FUNC_DEF(signMessageJni)(JNIEnv *env, jobject t
else else
{ {
LOGD("## signMessageJni(): success - retCode=%lu signatureLength=%lu", static_cast<long unsigned int>(resultSign), static_cast<long unsigned int>(signatureLength)); LOGD("## signMessageJni(): success - retCode=%lu signatureLength=%lu", static_cast<long unsigned int>(resultSign), static_cast<long unsigned int>(signatureLength));
signedMsgRetValueBuffer = env->NewByteArray(signatureLength); signedMsgRetValueBuffer = env->NewByteArray(signatureLength);
env->SetByteArrayRegion(signedMsgRetValueBuffer, 0 , signatureLength, (jbyte*)signedMsgPtr); env->SetByteArrayRegion(signedMsgRetValueBuffer, 0 , signatureLength, (jbyte*)signedMsgPtr);
} }