ENGINE-293: Compiles and runs SOME tests. SQL and myself() fixes.

doc_update_sequoia
Krista Bennett 5 years ago
parent 7c9c55e259
commit 245b6e192e

@ -438,11 +438,13 @@ PEP_STATUS _myself(PEP_SESSION session, pEp_identity * identity, bool do_keygen,
status = get_own_userid(session, &own_id);
assert(EMPTYSTR(identity->user_id) ||
(own_id && strcmp(identity->user_id, own_id) == 0));
(own_id && strcmp(identity->user_id, own_id) == 0) ||
!own_id);
if (!(session && identity && !EMPTYSTR(identity->address) &&
(EMPTYSTR(identity->user_id) ||
(own_id && strcmp(identity->user_id, own_id) == 0))))
(own_id && strcmp(identity->user_id, own_id) == 0) ||
!own_id)))
return ADD_TO_LOG(PEP_ILLEGAL_VALUE);
identity->comm_type = PEP_ct_pEp;

@ -177,14 +177,14 @@ static const char *sql_blacklist_retrieve =
// We only care if it's 0 or non-zero
static const char *sql_own_key_is_listed =
"select count(*) from ("
" select fpr from trust"
" join identity on id = identity.user_id"
" where fpr = upper(replace(?1,' ',''))"
" and identity.is_own = 1;"
" select pgp_keypair_fpr from trust"
" join identity on trust.user_id = identity.user_id"
" where pgp_keypair_fpr = upper(replace(?1,' ',''))"
" and identity.is_own = 1"
");";
static const char *sql_own_identities_retrieve =
"select address, fpr, username, user_id, "
"select address, fpr, username, identity.user_id, "
" lang, identity.flags | pgp_keypair.flags"
" from identity"
" join person on id = identity.user_id"
@ -194,13 +194,13 @@ static const char *sql_own_identities_retrieve =
" where identity.is_own = 1"
" and (identity.flags & ?1) = 0;";
static const char *sql_own_keys_retrieve =
"select fpr from trust"
" join identity on id = identity.user_id"
static const char *sql_own_keys_retrieve =
"select pgp_keypair_fpr from trust"
" join identity on trust.user_id = identity.user_id"
" where identity.is_own = 1";
static const char* sql_get_own_userid =
"select user_id from person"
"select id from person"
" join identity on id = identity.user_id"
" where identity.is_own = 1";
@ -413,8 +413,8 @@ DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
" references pgp_keypair (fpr)\n"
" on delete set null,\n"
" comment text,\n"
" flags integer default 0,"
" is_own integer default 0,"
" flags integer default 0,\n"
" is_own integer default 0,\n"
" primary key (address, user_id)\n"
");\n"
"create table if not exists trust (\n"

Loading…
Cancel
Save