Commit 28e77ff2 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added ChatMessageModifiers chain in reception

parent 61d1cdd8
......@@ -904,6 +904,11 @@ LinphoneReason ChatMessagePrivate::receive() {
// Start of message modification
// ---------------------------------------
if (ContentType::isCPIM(getContentType())) {
CpimChatMessageModifier ccmm;
ccmm.decode(this);
}
EncryptionChatMessageModifier ecmm;
int retval = 0;
retval = ecmm.decode(this);
......@@ -914,8 +919,11 @@ LinphoneReason ChatMessagePrivate::receive() {
q->sendDeliveryNotification(reason);
/* Return LinphoneReasonNone to avoid flexisip resending us a message we can't decrypt */
reason = LinphoneReasonNone;
goto end;
return reason;
}
MultipartChatMessageModifier mcmm;
mcmm.decode(this);
// ---------------------------------------
// End of message modification
......@@ -929,7 +937,7 @@ LinphoneReason ChatMessagePrivate::receive() {
if (retval > 0) {
reason = linphone_error_code_to_reason(retval);
q->sendDeliveryNotification(reason);
goto end;
return reason;
}
if (ContentType::isFileTransfer(getContentType())) {
......@@ -943,7 +951,6 @@ LinphoneReason ChatMessagePrivate::receive() {
q->store();
}
end:
return reason;
}
......
......@@ -152,4 +152,8 @@ bool ContentType::isText (const string &contentType) {
return contentType == "text/plain";
}
bool ContentType::isCPIM(const string &contentType) {
return contentType == "Message/CPIM";
}
LINPHONE_END_NAMESPACE
......@@ -59,6 +59,7 @@ public:
static bool isImIsComposing (const std::string &contentType);
static bool isImdn (const std::string &contentType);
static bool isText (const std::string &contentType);
static bool isCPIM (const std::string &contentType);
private:
L_DECLARE_PRIVATE(ContentType);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment