aboutsummaryrefslogtreecommitdiff
path: root/java/android/OlmLibSdk/olm-sdk/src
diff options
context:
space:
mode:
authorpedroGitt <pedro.contreiras@amdocs.com>2016-10-25 18:14:39 +0200
committerpedroGitt <pedro.contreiras@amdocs.com>2016-10-25 18:14:39 +0200
commita6401c72e6c382b906850d8975331df25439db00 (patch)
treea70e913bf16a22ba7a9f5c8febffcfd297a8d3ce /java/android/OlmLibSdk/olm-sdk/src
parentf3d4789b588bfc8af2135c2b2caafbc7d76d4feb (diff)
Update olm_matches_inbound_session_(from)() return code processing
Diffstat (limited to 'java/android/OlmLibSdk/olm-sdk/src')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp
index c4460b3..a31d48f 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp
@@ -351,7 +351,9 @@ JNIEXPORT jint OLM_SESSION_FUNC_DEF(matchesInboundSessionJni)(JNIEnv *env, jobje
size_t messageLength = (size_t)env->GetStringUTFLength(aOneTimeKeyMsg);
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));
}
else
@@ -411,7 +413,9 @@ JNIEXPORT jint JNICALL OLM_SESSION_FUNC_DEF(matchesInboundSessionFromIdKeyJni)(J
size_t messageLength = (size_t)env->GetStringUTFLength(aOneTimeKeyMsg);
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));
}
else