From 8f93104ebee1eb94b7c79a5153b5b5fcd055dce6 Mon Sep 17 00:00:00 2001 From: heck Date: Wed, 11 Mar 2020 16:41:25 +0100 Subject: [PATCH] Identity.color now returns PEP_color instead of int Message.outgoing_color returns PEP_color instead of int pEp.color(rating) now returns PEP_color) instead of int --- src/identity.cc | 2 +- src/identity.hh | 3 ++- src/message.cc | 2 +- src/message.hh | 3 ++- src/pEpmodule.cc | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/identity.cc b/src/identity.cc index b7ec03c..a941a6a 100644 --- a/src/identity.cc +++ b/src/identity.cc @@ -125,7 +125,7 @@ namespace pEp { return (int) rating; } - int Identity::color() + PEP_color Identity::color() { return _color(rating()); } diff --git a/src/identity.hh b/src/identity.hh index 0690831..cb423bf 100644 --- a/src/identity.hh +++ b/src/identity.hh @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -57,7 +58,7 @@ namespace pEp { void flags(identity_flags_t flags) { _ident->flags = flags; } int rating(); - int color(); + PEP_color color(); Identity copy(); Identity deepcopy(dict& memo); diff --git a/src/message.cc b/src/message.cc index 9f4e5dc..92cbb95 100644 --- a/src/message.cc +++ b/src/message.cc @@ -333,7 +333,7 @@ namespace pEp { return (int) rating; } - int Message::outgoing_color() + PEP_color Message::outgoing_color() { return _color(outgoing_rating()); } diff --git a/src/message.hh b/src/message.hh index 7dec7bf..56dc67a 100644 --- a/src/message.hh +++ b/src/message.hh @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "str_attr.hh" #include "identity.hh" @@ -132,7 +133,7 @@ namespace pEp { boost::python::tuple decrypt(int flags=0); int outgoing_rating(); - int outgoing_color(); + PEP_color outgoing_color(); Message deepcopy(dict& memo); Message copy(); }; diff --git a/src/pEpmodule.cc b/src/pEpmodule.cc index 53777e3..32b89c1 100644 --- a/src/pEpmodule.cc +++ b/src/pEpmodule.cc @@ -241,7 +241,7 @@ BOOST_PYTHON_MODULE(pEp) (void(pEp::PythonAdapter::Identity::*)(identity_flags_t)) &pEp::PythonAdapter::Identity::flags, "flags (p≡p internal)") .add_property("rating", &pEp::PythonAdapter::Identity::rating, "rating of Identity") - .add_property("color", &pEp::PythonAdapter::Identity::color, "color of Identity") + .add_property("color", &pEp::PythonAdapter::Identity::color, "color of Identity as PEP_color") .add_property("is_pEp_user", &pEp::PythonAdapter::Identity::is_pEp_user, "True if this is an identity of a pEp user") .def("__deepcopy__", &pEp::PythonAdapter::Identity::deepcopy) .def("update", &pEp::PythonAdapter::Identity::update, "update Identity") @@ -391,7 +391,7 @@ BOOST_PYTHON_MODULE(pEp) " flags flags set while decryption\n" ) .add_property("outgoing_rating", &Message::outgoing_rating, "rating outgoing message will have") - .add_property("outgoing_color", &Message::outgoing_color, "color outgoing message will have") + .add_property("outgoing_color", &Message::outgoing_color, "color outgoing message will have as PEP_color") .def("__deepcopy__", &Message::deepcopy) .def("__copy__", &Message::copy); @@ -497,7 +497,7 @@ BOOST_PYTHON_MODULE(pEp) def("color", &_color, "c = color(rating)\n" "\n" - "calculate color value out of rating" + "calculate color value out of rating. Returns PEP_color" ); def("trustwords", &_trustwords, "text = trustwords(ident_own, ident_partner)\n"