implementing mistrust vs. under_attack
authorVolker Birk <vb@pep-project.org>
Wed, 02 Mar 2016 09:26:45 +0100
changeset 48505643db87f77
parent 484 b0cc1e606128
child 486 82210e6ef7f7
implementing mistrust vs. under_attack
src/message_api.c
     1.1 --- a/src/message_api.c	Tue Mar 01 21:27:23 2016 +0100
     1.2 +++ b/src/message_api.c	Wed Mar 02 09:26:45 2016 +0100
     1.3 @@ -767,8 +767,8 @@
     1.4          PEP_STATUS status;
     1.5  
     1.6          color = key_color(session, _kl->value);
     1.7 -        if (color == PEP_rating_under_attack)
     1.8 -            return PEP_rating_under_attack;
     1.9 +        if (color <= PEP_rating_mistrust)
    1.10 +            return color;
    1.11  
    1.12          if (color >= PEP_rating_reliable) {
    1.13              status = least_trust(session, _kl->value, &ct);
    1.14 @@ -1257,17 +1257,14 @@
    1.15          
    1.16          *color = decrypt_color(decrypt_status);
    1.17          
    1.18 -        if (*color != PEP_rating_under_attack) {
    1.19 +        if (*color > PEP_rating_mistrust) {
    1.20              PEP_color kl_color = PEP_rating_undefined;
    1.21              
    1.22              if (_keylist)
    1.23                  kl_color = keylist_color(session, _keylist);
    1.24              
    1.25 -            if (kl_color == PEP_rating_under_attack) {
    1.26 -                *color = PEP_rating_under_attack;
    1.27 -            }
    1.28 -            else if (kl_color == PEP_rating_mistrust) {
    1.29 -                *color = PEP_rating_mistrust;
    1.30 +            if (kl_color <= PEP_rating_mistrust) {
    1.31 +                *color = kl_color;
    1.32              }
    1.33              else if (*color >= PEP_rating_reliable &&
    1.34                       kl_color < PEP_rating_reliable) {