Browse Source

Merge branch 'JSON-183'

JSON-128^2 Release_2.1.0-RC18
Jorg Knobloch 1 year ago
parent
commit
b33a924668
4 changed files with 47 additions and 79 deletions
  1. +0
    -71
      .hgignore
  2. +8
    -6
      server/Makefile.conf-old
  3. +35
    -0
      server/ev_server.cc
  4. +4
    -2
      server/server_version.cc

+ 0
- 71
.hgignore View File

@ -1,71 +0,0 @@
syntax: glob
.DS_Store
*.o
*.Po
*.Plo
*.pc
*~
libevent-*-stable/Makefile
libevent-*-stable/config.h
libevent-*-stable/config.log
libevent-*-stable/config.status
libevent-*-stable/include/Makefile
libevent-*-stable/libtool
libevent-*-stable/sample/Makefile
libevent-*-stable/stamp-h1
libevent-*-stable/test/Makefile
libevent-*-stable/**/.libs/
libevent-*-stable/*.lo
libevent-*-stable/*.la
libevent-*-stable/autom4te.cache/
libevent-*-stable/include/event2/event-config.h
libevent-*-stable/sample/dns-example
libevent-*-stable/sample/event-test
libevent-*-stable/sample/hello-world
libevent-*-stable/sample/http-server
libevent-*-stable/sample/le-proxy
libevent-*-stable/sample/signal-test
libevent-*-stable/sample/time-test
libevent-*-stable/test/bench
libevent-*-stable/test/bench_cascade
libevent-*-stable/test/bench_http
libevent-*-stable/test/bench_httpclient
libevent-*-stable/test/regress
libevent-*-stable/test/rpcgen-attempted
libevent-*-stable/test/test-changelist
libevent-*-stable/test/test-eof
libevent-*-stable/test/test-init
libevent-*-stable/test/test-ratelim
libevent-*-stable/test/test-time
libevent-*-stable/test/test-weof
libevent-*-stable/build/
server/pep-json-server
server/servertest
server/unittests
server/*.a
server/prefix-config.cc
server/local.conf
server/*.d
server/json_spirit/*.d
build/
*.vcxproj.user
*.obj
*.exe
*.lib
build-windows/libevent/Release/*
build-windows/libevent/Debug/*
build-windows/pEpJSONServerAdapter/Release/*
build-windows/pEpJSONServerAdapter/Debug/*
server/pEp-mini-json-adapter
*.d.*
.??*.swp
tags

+ 8
- 6
server/Makefile.conf-old View File

@ -103,12 +103,6 @@ endif
CXXFLAGS+= -Ijson_spirit $(BOOST_INC) $(ENGINE_INC) $(ETPAN_INC) $(GPGME_INC) $(UUID_INC)
LDFLAGS+= $(BOOST_LIB) $(ENGINE_LIB) $(ETPAN_LIB) $(GPGME_LIB) $(UUID_LIB)
ifeq ($(BUILD_FOR),Linux)
LDLIBS+= -lpEpEngine -lpEpAdapter -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lboost_regex
GTEST_DIR=/usr/src/googletest/googletest/
else ifeq ($(BUILD_FOR),Darwin)
LDLIBS+= -lpEpEngine -lpEpAdapter -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lboost_regex-mt
endif
LDLIBS+=$(WEBSERVER_LIB)
@ -120,6 +114,14 @@ else
$(error "You must set MIME_LIB to 'etpan' or 'pEpMIME'!" )
endif
ifeq ($(BUILD_FOR),Linux)
LDLIBS+= -lpEpEngine -lpEpAdapter -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lboost_regex
GTEST_DIR=/usr/src/googletest/googletest/
else ifeq ($(BUILD_FOR),Darwin)
LDLIBS+= -lpEpEngine -lpEpAdapter -lboost_system-mt -lboost_filesystem-mt -lboost_program_options-mt -lboost_thread-mt -lboost_regex-mt
endif
######### Google Test #########
#GTEST_DIR=


+ 35
- 0
server/ev_server.cc View File

@ -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) ),


+ 4
- 2
server/server_version.cc View File

@ -78,7 +78,8 @@ static const std::string VersionName =
// "(44) Neudietendorf"; // replace my own sync thread code by libpEpAdapter's implementation.
// "(45) Kreuz Erfurt"; // fix of context-saved function parameters that would cause trouble when >1 request is processed in parallel.
// "(46) Erfurt-West"; // JSON-156: delete client cached values after timeout.
"(47a) Erfurt-Ost"; // JSON-160, JSON-172, JSON-179.
// "(47a) Erfurt-Ost"; // JSON-160, JSON-172, JSON-179.
"(47b) Erfurt-Vieselbach"; // JSON-183: "Provide an API for pEp4Tb to communicate whether the message subject should be hidden (replaced with pEp)"
} // end of anonymous namespace
////////////////////////////////////////////////////////////////////////////
@ -115,7 +116,8 @@ const ServerVersion& server_version()
//static const ServerVersion sv(0,20,1); // JSON-153: passphrase support
//static const ServerVersion sv(0,21,0); // import_key() expects binary data, so they are always base64-encoded!
//static const ServerVersion sv(0,21,1); // wrap _all_ Engine functions with passphrase_cache.api(), except config_*() functions.
static const ServerVersion sv(0,21,2); // JSON-165 the msg param of re_evaluate_message_rating() is now "inout" and not "in" any more
//static const ServerVersion sv(0,21,2); // JSON-165 the msg param of re_evaluate_message_rating() is now "inout" and not "in" any more
static const ServerVersion sv(0,22,0); // JSON-183 "Provide an API for pEp4Tb to communicate whether the message subject should be hidden (replaced with pEp)"
return sv;
}


Loading…
Cancel
Save