Browse Source

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
PYADPT-55
heck 2 years ago
parent
commit
8f93104ebe
5 changed files with 9 additions and 7 deletions
  1. +1
    -1
      src/identity.cc
  2. +2
    -1
      src/identity.hh
  3. +1
    -1
      src/message.cc
  4. +2
    -1
      src/message.hh
  5. +3
    -3
      src/pEpmodule.cc

+ 1
- 1
src/identity.cc View File

@ -125,7 +125,7 @@ namespace pEp {
return (int) rating;
}
int Identity::color()
PEP_color Identity::color()
{
return _color(rating());
}


+ 2
- 1
src/identity.hh View File

@ -5,6 +5,7 @@
#include <boost/python.hpp>
#include <pEp/pEpEngine.h>
#include <pEp/message_api.h>
#include <string>
#include <memory>
#include <cstddef>
@ -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);


+ 1
- 1
src/message.cc View File

@ -333,7 +333,7 @@ namespace pEp {
return (int) rating;
}
int Message::outgoing_color()
PEP_color Message::outgoing_color()
{
return _color(outgoing_rating());
}


+ 2
- 1
src/message.hh View File

@ -6,6 +6,7 @@
#include <boost/python.hpp>
#include <boost/lexical_cast.hpp>
#include <pEp/message.h>
#include <pEp/message_api.h>
#include <string>
#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();
};


+ 3
- 3
src/pEpmodule.cc View File

@ -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"


Loading…
Cancel
Save