Update olm_matches_inbound_session_(from)() return code processing
This commit is contained in:
parent
f3d4789b58
commit
a6401c72e6
1 changed files with 6 additions and 2 deletions
|
@ -351,7 +351,9 @@ JNIEXPORT jint OLM_SESSION_FUNC_DEF(matchesInboundSessionJni)(JNIEnv *env, jobje
|
||||||
size_t messageLength = (size_t)env->GetStringUTFLength(aOneTimeKeyMsg);
|
size_t messageLength = (size_t)env->GetStringUTFLength(aOneTimeKeyMsg);
|
||||||
|
|
||||||
size_t matchResult = olm_matches_inbound_session(sessionPtr, (void*)messagePtr , messageLength);
|
size_t matchResult = olm_matches_inbound_session(sessionPtr, (void*)messagePtr , messageLength);
|
||||||
if(matchResult == olm_error()) {
|
//if(matchResult == olm_error()) {
|
||||||
|
// for now olm_matches_inbound_session() returns 1 when it succeeds, otherwise 1- or 0
|
||||||
|
if(matchResult != 1) {
|
||||||
LOGE("## matchesInboundSessionJni(): failure - no match Msg=%s",(const char *)olm_session_last_error(sessionPtr));
|
LOGE("## matchesInboundSessionJni(): failure - no match Msg=%s",(const char *)olm_session_last_error(sessionPtr));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -411,7 +413,9 @@ JNIEXPORT jint JNICALL OLM_SESSION_FUNC_DEF(matchesInboundSessionFromIdKeyJni)(J
|
||||||
size_t messageLength = (size_t)env->GetStringUTFLength(aOneTimeKeyMsg);
|
size_t messageLength = (size_t)env->GetStringUTFLength(aOneTimeKeyMsg);
|
||||||
|
|
||||||
size_t matchResult = olm_matches_inbound_session_from(sessionPtr, (void const *)theirIdentityKeyPtr, identityKeyLength, (void*)messagePtr , messageLength);
|
size_t matchResult = olm_matches_inbound_session_from(sessionPtr, (void const *)theirIdentityKeyPtr, identityKeyLength, (void*)messagePtr , messageLength);
|
||||||
if(matchResult == olm_error()) {
|
//if(matchResult == olm_error()) {
|
||||||
|
// for now olm_matches_inbound_session() returns 1 when it succeeds, otherwise 1- or 0
|
||||||
|
if(matchResult != 1) {
|
||||||
LOGE("## matchesInboundSessionFromIdKeyJni(): failure - no match Msg=%s",(const char *)olm_session_last_error(sessionPtr));
|
LOGE("## matchesInboundSessionFromIdKeyJni(): failure - no match Msg=%s",(const char *)olm_session_last_error(sessionPtr));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue