mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 05:38:14 +00:00
Handle IMDN negative-delivery.
This commit is contained in:
parent
d1dc223898
commit
dfde23f205
2 changed files with 11 additions and 2 deletions
|
|
@ -548,7 +548,9 @@ LinphoneReason ChatMessagePrivate::receive () {
|
|||
/* Unable to decrypt message */
|
||||
chatRoom->getPrivate()->notifyUndecryptableChatMessageReceived(q->getSharedFromThis());
|
||||
reason = linphone_error_code_to_reason(errorCode);
|
||||
q->sendDeliveryNotification(reason);
|
||||
if (getNegativeDeliveryNotificationRequired()) {
|
||||
q->sendDeliveryNotification(reason);
|
||||
}
|
||||
return reason;
|
||||
} else if (result == ChatMessageModifier::Result::Suspended) {
|
||||
currentRecvStep |= ChatMessagePrivate::Step::Encryption;
|
||||
|
|
@ -632,7 +634,9 @@ LinphoneReason ChatMessagePrivate::receive () {
|
|||
|
||||
if (errorCode > 0) {
|
||||
reason = linphone_error_code_to_reason(errorCode);
|
||||
q->sendDeliveryNotification(reason);
|
||||
if (getNegativeDeliveryNotificationRequired()) {
|
||||
q->sendDeliveryNotification(reason);
|
||||
}
|
||||
return reason;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ ChatMessageModifier::Result CpimChatMessageModifier::encode (const shared_ptr<Ch
|
|||
cpimMessage.addMessageHeader(cpimToHeader);
|
||||
|
||||
if (message->getPrivate()->getPositiveDeliveryNotificationRequired()
|
||||
|| message->getPrivate()->getNegativeDeliveryNotificationRequired()
|
||||
|| message->getPrivate()->getDisplayNotificationRequired()
|
||||
) {
|
||||
const string imdnNamespace = "imdn";
|
||||
|
|
@ -66,6 +67,8 @@ ChatMessageModifier::Result CpimChatMessageModifier::encode (const shared_ptr<Ch
|
|||
vector<string> dispositionNotificationValues;
|
||||
if (message->getPrivate()->getPositiveDeliveryNotificationRequired())
|
||||
dispositionNotificationValues.emplace_back("positive-delivery");
|
||||
if (message->getPrivate()->getNegativeDeliveryNotificationRequired())
|
||||
dispositionNotificationValues.emplace_back("negative-delivery");
|
||||
if (message->getPrivate()->getDisplayNotificationRequired())
|
||||
dispositionNotificationValues.emplace_back("display");
|
||||
dispositionNotificationHeader.setValue(Utils::join(dispositionNotificationValues, ", "));
|
||||
|
|
@ -184,6 +187,8 @@ ChatMessageModifier::Result CpimChatMessageModifier::decode (const shared_ptr<Ch
|
|||
for (const auto &value : values)
|
||||
if (value == "positive-delivery")
|
||||
message->getPrivate()->setPositiveDeliveryNotificationRequired(true);
|
||||
else if (value == "negative-delivery")
|
||||
message->getPrivate()->setNegativeDeliveryNotificationRequired(true);
|
||||
else if (value == "display")
|
||||
message->getPrivate()->setDisplayNotificationRequired(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue