From cc2a5a2aa77adb1485cbd7a3b1a420d061704fef Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 6 Jan 2022 00:10:00 +0100 Subject: [PATCH] Feature: Add set_comm_partner_key() --- src/pEp/_pEp/basic_api.cc | 7 +++++++ src/pEp/_pEp/pEpmodule.cc | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/pEp/_pEp/basic_api.cc b/src/pEp/_pEp/basic_api.cc index aee8393..560de3e 100644 --- a/src/pEp/_pEp/basic_api.cc +++ b/src/pEp/_pEp/basic_api.cc @@ -175,5 +175,12 @@ namespace pEp { _throw_status(status); } + void set_comm_partner_key(Identity &ident, string fpr) + { + const char *fpr_c = fpr.c_str(); + PEP_STATUS status = ::set_comm_partner_key(Adapter::session(), ident, fpr_c); + _throw_status(status); + } + } // namespace PythonAdapter } // namespace pEp diff --git a/src/pEp/_pEp/pEpmodule.cc b/src/pEp/_pEp/pEpmodule.cc index 86a8233..5391bf6 100644 --- a/src/pEp/_pEp/pEpmodule.cc +++ b/src/pEp/_pEp/pEpmodule.cc @@ -669,6 +669,15 @@ namespace pEp { "me->address must not be an alias\n" "me->fpr will be ignored and replaced by fpr\n"); + def("set_comm_partner_key", + &set_comm_partner_key, + "set_comm_partner_key(ident, fpr)\n" + "\n" + "Mark a key the default for a comm partner\n" + "\n" + "ident partner identity this key is used for\n" + "fpr fingerprint of the key to set as the identity default\n"); + // message API enum_("rating")