From 6daf1af6c387674ae7565b7ab087e2678ca834d8 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Fri, 12 Aug 2016 14:38:20 +0200 Subject: [PATCH] adding color_from_rating() --- src/message_api.cc | 5 +++++ src/message_api.hh | 1 + src/pEpmodule.cc | 1 + 3 files changed, 7 insertions(+) diff --git a/src/message_api.cc b/src/message_api.cc index 3d0e150..d5b59c2 100644 --- a/src/message_api.cc +++ b/src/message_api.cc @@ -55,6 +55,11 @@ namespace pEp { Message dst(_dst); return make_tuple(dst, keylist, rating, flags); } + + int color_from_rating(int rating) + { + return (int) ::color_from_rating((PEP_rating) rating); + } } } diff --git a/src/message_api.hh b/src/message_api.hh index 40247c4..0d69a4c 100644 --- a/src/message_api.hh +++ b/src/message_api.hh @@ -7,6 +7,7 @@ namespace pEp { Message encrypt_message(Message src, list extra = list(), int enc_format = 4, int flags = 0); tuple decrypt_message(Message src); + int color_from_rating(int rating); } } diff --git a/src/pEpmodule.cc b/src/pEpmodule.cc index 04fdc3a..6f6e42d 100644 --- a/src/pEpmodule.cc +++ b/src/pEpmodule.cc @@ -193,6 +193,7 @@ BOOST_PYTHON_MODULE(pEp) def("encrypt_message", &encrypt_message, "encrypt message in memory"); def("decrypt_message", &decrypt_message, "decrypt message in memory"); + def("color_from_rating", &color_from_rating, "calculate color value"); // key sync API