src/pEpEngine.c
changeset 1508 ab010a3b7894
parent 1507 cee84fad7f33
child 1513 e7f7e42385b5
     1.1 --- a/src/pEpEngine.c	Wed Dec 21 02:02:11 2016 +0100
     1.2 +++ b/src/pEpEngine.c	Wed Dec 21 10:47:27 2016 +0100
     1.3 @@ -386,8 +386,12 @@
     1.4                          "and pgp_keypair_fpr = upper(replace(?2,' ','')) ;";
     1.5  
     1.6          sql_greater_trust_keys = "select pgp_keypair_fpr from trust"
     1.7 -                                 "    where user_id = ?1"
     1.8 -                                 "      and comm_type > ?2;";
     1.9 +                                 "  where user_id = ?1"
    1.10 +                                 "    and comm_type > ?2"
    1.11 +                                 "    and (select count(*) from identity"
    1.12 +                                 "           where user_id = identity.user_id"
    1.13 +                                 "             and pgp_keypair_fpr = identity.main_key_id"
    1.14 +                                 "        ) = 0;";
    1.15  
    1.16          sql_least_trust = "select min(comm_type) from trust where pgp_keypair_fpr = upper(replace(?1,' ','')) ;";
    1.17