@ -64,6 +64,40 @@ std::string getBinaryPath()
}
bool has_non_pEp_user ( PEP_SESSION session , const identity_list * il )
{
for ( ; il ! = nullptr ; il = il - > next )
{
if ( ( il - > ident - > comm_type | PEP_ct_confirmed ) < PEP_ct_pEp )
return true ;
}
return false ;
}
PEP_STATUS outgoing_message_rating_with_partner_info ( PEP_SESSION session , message * msg , PEP_rating * rating , bool * only_pEp_partners )
{
// Nota bene: outgoing_message_rating calls update_identity() on every recipient,
// but these changes in their identities are not given back to the JSON-RPC clients.
PEP_STATUS status = outgoing_message_rating ( session , msg , rating ) ;
if ( * rating < PEP_rating_reliable )
{
// if mail would be sent unencrypted, we also cannot encrypt/protect the subject,
// so handle it the same way as if there were non-pEp recipients.
* only_pEp_partners = false ;
} else {
if ( has_non_pEp_user ( session , msg - > to )
| | has_non_pEp_user ( session , msg - > cc ) )
{
* only_pEp_partners = false ;
} else {
* only_pEp_partners = true ;
}
}
return status ;
}
// these are the pEp functions that are callable by the client
const FunctionMap functions = {
@ -116,6 +150,7 @@ const FunctionMap functions = {
FP ( " mark_as_comprimized " , new FuncPC < PEP_STATUS , In_Pep_Session , In < c_string > > ( & mark_as_compromized ) ) ,
FP ( " identity_rating " , new FuncPC < PEP_STATUS , In_Pep_Session , In < pEp_identity * > , Out < PEP_rating > > ( & identity_rating ) ) ,
FP ( " outgoing_message_rating " , new FuncPC < PEP_STATUS , In_Pep_Session , In < message * > , Out < PEP_rating > > ( & outgoing_message_rating ) ) ,
FP ( " outgoing_message_rating_with_partner_info " , new FuncPC < PEP_STATUS , In_Pep_Session , In < message * > , Out < PEP_rating > , Out < bool > > ( & outgoing_message_rating_with_partner_info ) ) ,
FP ( " outgoing_message_rating_preview " , new FuncPC < PEP_STATUS , In_Pep_Session , In < message * > , Out < PEP_rating > > ( & outgoing_message_rating_preview ) ) ,
FP ( " set_identity_flags " , new FuncPC < PEP_STATUS , In_Pep_Session , InOut < pEp_identity * > , In < identity_flags_t > > ( & set_identity_flags ) ) ,
FP ( " unset_identity_flags " , new FuncPC < PEP_STATUS , In_Pep_Session , InOut < pEp_identity * > , In < identity_flags_t > > ( & unset_identity_flags ) ) ,