Browse Source

JNI-58 Expose enc_format parameter on encrypt_message instead of force PEP_enc_PEP

android-1.0.101
Hussein Kasem 8 years ago
parent
commit
545ebdc862
  1. 2
      src/gen_cpp_Engine.ysl2
  2. 11
      src/jniutils.cc
  3. 3
      src/jniutils.hh
  4. 2
      src/pEp.yml2

2
src/gen_cpp_Engine.ysl2

@ -198,6 +198,8 @@ tstylesheet {
choose {
when "$type = 'message'"
| message *_«$name» = (message *) callLongMethod(env, «$name», "getHandle");
when "$type='EncFormat'"
| √$type _«$name» = to_«$type»(env, «$name»);
when "$type='bool'"
| bool _«$name» = (bool) «$name»;
when "$type='int'"

11
src/jniutils.cc

@ -649,6 +649,17 @@ namespace pEp {
return bl;
}
PEP_enc_format to_EncFormat(JNIEnv *env, jobject obj)
{
static const char *classname = "org/pEp/jniadapter/Message$EncFormat";
jclass clazz_enc_format = findClass(env, classname);
jfieldID field_value = env->GetFieldID(clazz_enc_format, "value", "I");
assert(field_value);
env->DeleteLocalRef(clazz_enc_format);
return (PEP_enc_format) env->GetIntField(obj, field_value);
}
};
};

3
src/jniutils.hh

@ -7,6 +7,7 @@
#include <pEp/stringpair.h>
#include <pEp/identity_list.h>
#include <pEp/bloblist.h>
#include <pEp/message.h>
#if 0 // Enable if log needed
#include <android/log.h>
@ -171,6 +172,8 @@ namespace pEp {
jobject from_bloblist(JNIEnv *env, bloblist_t *bl);
bloblist_t *to_bloblist(JNIEnv *env, jobject obj);
PEP_enc_format to_EncFormat(JNIEnv *env, jobject obj);
};
};

2
src/pEp.yml2

@ -141,7 +141,7 @@ namespace pEp {
in message src,
in stringlist extra,
creates message dst,
Cconst PEP_enc_format encformat "PEP_enc_PEP",
in EncFormat format,
Cconst PEP_encrypt_flags flags "0"
);

Loading…
Cancel
Save