From 2f4d103cac3d0fb637d735f20d1772e4d5357990 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Thu, 5 Sep 2019 13:27:35 +0200 Subject: [PATCH] add is_pEp_user --- src/identity.cc | 8 ++++++++ src/identity.hh | 2 ++ src/pEpmodule.cc | 1 + 3 files changed, 11 insertions(+) diff --git a/src/identity.cc b/src/identity.cc index 1ec6961..6b7f6ac 100644 --- a/src/identity.cc +++ b/src/identity.cc @@ -156,6 +156,14 @@ namespace pEp { _throw_status(status); } + bool Identity::is_pEp_user() + { + bool result; + PEP_STATUS status = ::is_pEp_user(adapter.session(), *this, &result); + _throw_status(status); + return result; + } + Myself::Myself(string address, string username, string user_id, string lang) : Identity(address, username, user_id, "", 0, lang) diff --git a/src/identity.hh b/src/identity.hh index 9301172..ddb0baa 100644 --- a/src/identity.hh +++ b/src/identity.hh @@ -65,6 +65,8 @@ namespace pEp { virtual void update(); void key_reset(string fpr=""); + + bool is_pEp_user(); }; class Myself : public Identity { diff --git a/src/pEpmodule.cc b/src/pEpmodule.cc index d261192..8b0cab8 100644 --- a/src/pEpmodule.cc +++ b/src/pEpmodule.cc @@ -218,6 +218,7 @@ BOOST_PYTHON_MODULE(pEp) "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("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") .def("__copy__", &pEp::PythonAdapter::Identity::copy);