|
|
|
@ -9,6 +9,7 @@ const API_METHOD_CACHE_ENCRYPT_MESSAGE = "cache_encrypt_message";
|
|
|
|
|
const API_METHOD_CACHE_ENCRYPT_MESSAGE_FOR_SELF = "cache_encrypt_message_for_self";
|
|
|
|
|
const API_METHOD_OUTGOING_MESSAGE_RATING = "outgoing_message_rating";
|
|
|
|
|
const API_METHOD_OUTGOING_MESSAGE_RATING_PREVIEW = "outgoing_message_rating_preview";
|
|
|
|
|
const API_METHOD_OUTGOING_MESSAGE_RATING_WPI = "outgoing_message_rating_with_partner_info";
|
|
|
|
|
const API_METHOD_RE_EVALUATE_MESSAGE_RATING = "re_evaluate_message_rating";
|
|
|
|
|
const API_METHOD_IDENTITY_RATING = "identity_rating";
|
|
|
|
|
const API_METHOD_CACHE_MIME_DECODE_MESSAGE = "cache_mime_decode_message";
|
|
|
|
@ -157,7 +158,7 @@ class pEpAdapter {
|
|
|
|
|
|
|
|
|
|
async outgoing_message_rating(message, preview) {
|
|
|
|
|
this.log.info("pEpAdapter.js: outgoing_message_rating()");
|
|
|
|
|
const params = [message, "0"];
|
|
|
|
|
const params = [message, "OUT"];
|
|
|
|
|
return this.delegateCallPepAdapter(
|
|
|
|
|
SERVER_TYPE_CALL_FUNC,
|
|
|
|
|
preview ? API_METHOD_OUTGOING_MESSAGE_RATING_PREVIEW : API_METHOD_OUTGOING_MESSAGE_RATING,
|
|
|
|
@ -174,6 +175,25 @@ class pEpAdapter {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async outgoing_message_rating_with_partner_info(message) {
|
|
|
|
|
this.log.info("pEpAdapter.js: outgoing_message_rating_with_partner_info()");
|
|
|
|
|
const params = [message, "OUT", "OUT"];
|
|
|
|
|
return this.delegateCallPepAdapter(
|
|
|
|
|
SERVER_TYPE_CALL_FUNC,
|
|
|
|
|
API_METHOD_OUTGOING_MESSAGE_RATING_WPI,
|
|
|
|
|
params,
|
|
|
|
|
).then((response) => {
|
|
|
|
|
this.log.debug("pEpAdapter.js: outgoing_message_rating_with_partner_info()", response);
|
|
|
|
|
if (response.result.return.hasOwnProperty("status") && response.result.return.status != PEP_STATUS_OK) {
|
|
|
|
|
this.log.error(`returned status ${response.result.return.status}`);
|
|
|
|
|
}
|
|
|
|
|
return { rating: response.result.outParams[1].rating, onlyPEP: response.result.outParams[0] };
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
this.log.error(err.message);
|
|
|
|
|
throw err;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async re_evaluate_message_rating(message, keyList, oldRating) {
|
|
|
|
|
this.log.info("pEpAdapter.js: re_evaluate_message_rating()");
|
|
|
|
|
const params = [message, keyList, { rating: oldRating }, "OUT"];
|
|
|
|
|