diff options
author | pedroGitt <pedro.contreiras@amdocs.com> | 2016-11-08 11:25:10 +0100 |
---|---|---|
committer | pedroGitt <pedro.contreiras@amdocs.com> | 2016-11-08 11:25:10 +0100 |
commit | d944d5fad70283e4cc095802fd893b87309f341d (patch) | |
tree | 6949edeab0d776cf102ce47e0aea262bb054e924 /java/android/OlmLibSdk/olm-sdk/src | |
parent | 1fd908c72ab5227e7c9d8bfaaba7781ec1067aee (diff) |
Update initInboundSessionWithAccountFrom() return code:
- return code is a basic error code (0 OK, -1 KO)
Remove TODO comments
Diffstat (limited to 'java/android/OlmLibSdk/olm-sdk/src')
-rw-r--r-- | java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java index 38e8c89..6d570d1 100644 --- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java +++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java @@ -267,21 +267,18 @@ public class OlmSession extends CommonSerializeUtils implements Serializable { * @param aAccount the account to associate with this session * @param aTheirIdentityKey the sender identity key * @param aPreKeyMsg PRE KEY message - * @return this if operation succeed, null otherwise - * TODO unit test missing: initInboundSessionWithAccountFrom + * @return 0 if operation succeed, -1 otherwise */ - public OlmSession initInboundSessionWithAccountFrom(OlmAccount aAccount, String aTheirIdentityKey, String aPreKeyMsg) { - OlmSession retObj=null; + public int initInboundSessionWithAccountFrom(OlmAccount aAccount, String aTheirIdentityKey, String aPreKeyMsg) { + int retCode=-1; if((null==aAccount) || TextUtils.isEmpty(aPreKeyMsg)){ Log.e(LOG_TAG, "## initInboundSessionWithAccount(): invalid input parameters"); } else { - if(0 == initInboundSessionFromIdKeyJni(aAccount.getOlmAccountId(), aTheirIdentityKey, aPreKeyMsg)){ - retObj = this; - } + retCode = initInboundSessionFromIdKeyJni(aAccount.getOlmAccountId(), aTheirIdentityKey, aPreKeyMsg); } - return retObj; + return retCode; } private native int initInboundSessionFromIdKeyJni(long aOlmAccountId, String aTheirIdentityKey, String aOneTimeKeyMsg); @@ -305,7 +302,6 @@ public class OlmSession extends CommonSerializeUtils implements Serializable { * Public API for {@link #matchesInboundSessionJni(String)}. * @param aOneTimeKeyMsg PRE KEY message * @return this if operation succeed, null otherwise - * TODO unit test missing: matchesInboundSession */ public boolean matchesInboundSession(String aOneTimeKeyMsg) { boolean retCode = false; @@ -326,7 +322,6 @@ public class OlmSession extends CommonSerializeUtils implements Serializable { * @param aTheirIdentityKey the sender identity key * @param aOneTimeKeyMsg PRE KEY message * @return this if operation succeed, null otherwise - * TODO unit test missing: matchesInboundSessionFrom */ public boolean matchesInboundSessionFrom(String aTheirIdentityKey, String aOneTimeKeyMsg) { boolean retCode = false; |