From 22e4d9b8afa98ef06460597c5edc486f2926288b Mon Sep 17 00:00:00 2001 From: Edouard Tisserant Date: Wed, 9 Aug 2017 10:37:57 -0400 Subject: [PATCH] JNI-44 stripped Identity.me --- src/basic_api.cc | 20 ++++---------------- src/jniutils.cc | 9 --------- src/org/pEp/jniadapter/Identity.java | 8 -------- src/org/pEp/jniadapter/_Identity.java | 7 ------- 4 files changed, 4 insertions(+), 40 deletions(-) diff --git a/src/basic_api.cc b/src/basic_api.cc index 2b4df46..7b055e2 100644 --- a/src/basic_api.cc +++ b/src/basic_api.cc @@ -24,10 +24,7 @@ JNIEXPORT jobject JNICALL Java_org_pEp_jniadapter_Engine_trustwords( size_t wsize; if (_ident->fpr == NULL || _ident->fpr[0] == 0) { - if (_ident->me) - ::myself(session, _ident); - else - ::update_identity(session, _ident); + ::update_identity(session, _ident); } if (_ident->fpr == NULL || _ident->fpr[0] == 0) { @@ -88,10 +85,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_keyMistrusted( pEp_identity *_ident = to_identity(env, ident); if (_ident->fpr == NULL || _ident->fpr[0] == 0) { - if (_ident->me) - ::myself(session, _ident); - else - ::update_identity(session, _ident); + ::update_identity(session, _ident); } if (_ident->fpr == NULL || _ident->fpr[0] == 0) { @@ -112,10 +106,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_keyResetTrust( pEp_identity *_ident = to_identity(env, ident); if (_ident->fpr == NULL || _ident->fpr[0] == 0) { - if (_ident->me) - ::myself(session, _ident); - else - ::update_identity(session, _ident); + ::update_identity(session, _ident); } if (_ident->fpr == NULL || _ident->fpr[0] == 0) { @@ -136,10 +127,7 @@ JNIEXPORT void JNICALL Java_org_pEp_jniadapter_Engine_trustPersonalKey( pEp_identity *_ident = to_identity(env, ident); if (_ident->fpr == NULL || _ident->fpr[0] == 0) { - if (_ident->me) - ::myself(session, _ident); - else - ::update_identity(session, _ident); + ::update_identity(session, _ident); } if (_ident->fpr == NULL || _ident->fpr[0] == 0) { diff --git a/src/jniutils.cc b/src/jniutils.cc index ecae9a6..afc4177 100644 --- a/src/jniutils.cc +++ b/src/jniutils.cc @@ -440,9 +440,6 @@ namespace pEp { _setStringField(env, classname, obj, "lang", ident->lang); - jfieldID me_id = getFieldID(env, classname, "me", "Z"); - env->SetBooleanField(obj, me_id, (jboolean) ident->me); - jfieldID flags_id = getFieldID(env, classname, "flags", "I"); env->SetIntField(obj, flags_id, (jint) (int) ident->flags); } @@ -472,9 +469,6 @@ namespace pEp { _setStringField(env, classname, obj, "lang", ident->lang, identityClass); - jfieldID me_id = getFieldID(env, classname, "me", "Z", identityClass); - env->SetBooleanField(obj, me_id, (jboolean) ident->me); - jfieldID flags_id = getFieldID(env, classname, "flags", "I", identityClass); env->SetIntField(obj, flags_id, (jint) (int) ident->flags); } @@ -517,9 +511,6 @@ namespace pEp { } free(lang); - jfieldID me_id = getFieldID(env, classname, "me", "Z"); - ident->me = (bool) env->GetBooleanField(obj, me_id); - jfieldID flags_id = getFieldID(env, classname, "flags", "I"); ident->flags = (identity_flags_t) (int) env->GetIntField(obj, flags_id); diff --git a/src/org/pEp/jniadapter/Identity.java b/src/org/pEp/jniadapter/Identity.java index 56478a6..f31d8c0 100644 --- a/src/org/pEp/jniadapter/Identity.java +++ b/src/org/pEp/jniadapter/Identity.java @@ -9,16 +9,9 @@ public class Identity implements Serializable{ public String username; public CommType comm_type; public String lang; - public boolean me; public int flags; public Identity() { - this.me = false; - comm_type = CommType.PEP_ct_unknown; - } - - public Identity(boolean me) { - this.me = me; comm_type = CommType.PEP_ct_unknown; } @@ -29,7 +22,6 @@ public class Identity implements Serializable{ username = AbstractEngine.toUTF16(i.username); comm_type = CommType.Management.tag.get(i.comm_type); lang = AbstractEngine.toUTF16(i.lang); - me = i.me; flags = i.flags; } diff --git a/src/org/pEp/jniadapter/_Identity.java b/src/org/pEp/jniadapter/_Identity.java index 28b721a..e9dfe5b 100644 --- a/src/org/pEp/jniadapter/_Identity.java +++ b/src/org/pEp/jniadapter/_Identity.java @@ -7,15 +7,9 @@ public class _Identity { public byte[] username; public int comm_type; public byte[] lang; - public boolean me; public int flags; public _Identity() { - this.me = false; - } - - public _Identity(boolean me) { - this.me = me; } public _Identity(Identity i) { @@ -25,7 +19,6 @@ public class _Identity { username = AbstractEngine.toUTF8(i.username); comm_type = i.comm_type.value; lang = AbstractEngine.toUTF8(i.lang); - me = i.me; flags = i.flags; } }