src/message_api.c
changeset 300 55e8daedd030
parent 299 352bd67295d4
child 301 d8b44dc4b0c8
     1.1 --- a/src/message_api.c	Sat May 30 03:11:27 2015 +0200
     1.2 +++ b/src/message_api.c	Sat May 30 12:47:37 2015 +0200
     1.3 @@ -11,6 +11,9 @@
     1.4  #ifndef MIN
     1.5  #define MIN(A, B) ((B) > (A) ? (A) : (B))
     1.6  #endif
     1.7 +#ifndef MAX
     1.8 +#define MAX(A, B) ((B) > (A) ? (B) : (A))
     1.9 +#endif
    1.10  
    1.11  
    1.12  static bool string_equality(const char *s1, const char *s2)
    1.13 @@ -1204,10 +1207,6 @@
    1.14  
    1.15      *color = PEP_rating_undefined;
    1.16  
    1.17 -    assert(msg->from);
    1.18 -    if (msg->from == NULL)
    1.19 -        return PEP_ILLEGAL_VALUE;
    1.20 -
    1.21      status = myself(session, msg->from);
    1.22      if (status != PEP_STATUS_OK)
    1.23          return status;
    1.24 @@ -1233,7 +1232,7 @@
    1.25      if (comm_type_determined == false)
    1.26          *color = PEP_rating_undefined;
    1.27      else
    1.28 -        *color = _rating(max_comm_type);
    1.29 +        *color = MAX(_rating(max_comm_type), PEP_rating_unencrypted);
    1.30  
    1.31      return PEP_STATUS_OK;
    1.32  }