BUGFIX: always preview
authorVolker Birk <vb@pep.foundation>
Fri, 07 Sep 2018 11:38:15 +0200
changeset 293005a79c61fc56
parent 2929 133ea04d3ea3
child 2931 2bd3cfab7934
child 2932 c4c1667c756a
BUGFIX: always preview
src/message_api.c
     1.1 --- a/src/message_api.c	Fri Sep 07 11:12:28 2018 +0200
     1.2 +++ b/src/message_api.c	Fri Sep 07 11:38:15 2018 +0200
     1.3 @@ -3613,8 +3613,7 @@
     1.4  static void _max_comm_type_from_identity_list_preview(
     1.5          identity_list *identities,
     1.6          PEP_SESSION session,
     1.7 -        PEP_comm_type *max_comm_type,
     1.8 -        bool *comm_type_determined
     1.9 +        PEP_comm_type *max_comm_type
    1.10      )
    1.11  {
    1.12      identity_list * il;
    1.13 @@ -3678,7 +3677,6 @@
    1.14      )
    1.15  {
    1.16      PEP_comm_type max_comm_type = PEP_ct_pEp;
    1.17 -    bool comm_type_determined = false;
    1.18  
    1.19      assert(session);
    1.20      assert(msg);
    1.21 @@ -3694,22 +3692,16 @@
    1.22      *rating = PEP_rating_undefined;
    1.23  
    1.24      _max_comm_type_from_identity_list_preview(msg->to, session,
    1.25 -                                      &max_comm_type, &comm_type_determined);
    1.26 +            &max_comm_type);
    1.27  
    1.28      _max_comm_type_from_identity_list_preview(msg->cc, session,
    1.29 -                                      &max_comm_type, &comm_type_determined);
    1.30 +            &max_comm_type);
    1.31  
    1.32      _max_comm_type_from_identity_list_preview(msg->bcc, session,
    1.33 -                                      &max_comm_type, &comm_type_determined);
    1.34 -
    1.35 -    if (comm_type_determined == false) {
    1.36 -        // likely means there was a massive screwup with no sender or recipient
    1.37 -        // keys
    1.38 -        *rating = PEP_rating_undefined;
    1.39 -    }
    1.40 -    else
    1.41 -        *rating = _MAX(_rating(max_comm_type, PEP_rating_undefined),
    1.42 -                               PEP_rating_unencrypted);
    1.43 +            &max_comm_type);
    1.44 +
    1.45 +    *rating = _MAX(_rating(max_comm_type, PEP_rating_undefined),
    1.46 +            PEP_rating_unencrypted);
    1.47  
    1.48      return PEP_STATUS_OK;
    1.49  }