Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #20 from jezek/xenial_-_failed-MMS-redownload
Browse files Browse the repository at this point in the history
Failed MMS redownload
  • Loading branch information
Flohack74 committed Dec 15, 2021
2 parents ddd6b80 + 95762ae commit 8e5e6bd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void oFonoConnection::addMMSToService(const QString &path, const QVariantMap &pr
bool isRoom = false;
MMSDMessage *msg = new MMSDMessage(path, properties);
mServiceMMSList[servicePath].append(msg);
if (properties["Status"] == "received") {
if (properties["Status"] == "received") {
QString senderNormalizedNumber = PhoneUtils::normalizePhoneNumber(properties["Sender"].toString());
QStringList recipientList = properties["Recipients"].toStringList();
// we use QSet to avoid having duplicate entries
Expand Down
27 changes: 23 additions & 4 deletions ofonotextchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,33 @@ void oFonoTextChannel::mmsReceived(const QString &id, uint handle, const QVarian
Tp::MessagePart header;
header["message-token"] = QDBusVariant(id);
header["message-sender"] = QDBusVariant(handle);
header["message-received"] = QDBusVariant(QDateTime::currentDateTimeUtc().toTime_t());
if (properties["Received"].isNull() == false && properties["Received"].toUInt() > 0) {
header["message-received"] = QDBusVariant(properties["Received"].toUInt());
} else {
header["message-received"] = QDBusVariant(QDateTime::currentDateTimeUtc().toTime_t());
}
header["message-sent"] = QDBusVariant(getSentDate(properties["Date"].toString()).toTime_t());
header["message-type"] = QDBusVariant(Tp::DeliveryStatusDelivered);
header["message-type"] = QDBusVariant(Tp::ChannelTextMessageTypeNormal);
header["x-canonical-mms"] = QDBusVariant(true);
if (!subject.isEmpty())
{
if (!subject.isEmpty()) {
header["subject"] = QDBusVariant(subject);
}
if (properties["Rescued"].isNull() == false && properties["Rescued"].toBool() == true) {
header["rescued"] = QDBusVariant(true);
}
if (properties["Silent"].isNull() == false && properties["Silent"].toBool() == true) {
header["silent"] = QDBusVariant(true);
}
if (properties["Error"].isNull() == false) {
header["delivery-status"] = QDBusVariant(Tp::DeliveryStatusPermanentlyFailed);
if (properties["AllowRedownload"].toBool() == true) {
header["delivery-status"] = QDBusVariant(Tp::DeliveryStatusTemporarilyFailed);
}
header["delivery-error-message"] = QDBusVariant(properties["Error"].toString());
}
if (!properties["DeleteEvent"].toString().isEmpty()) {
header["supersedes"] = QDBusVariant(properties["DeleteEvent"].toString());
}
message << header;
IncomingAttachmentList mmsdAttachments = qdbus_cast<IncomingAttachmentList>(properties["Attachments"]);
Q_FOREACH(const IncomingAttachmentStruct &attachment, mmsdAttachments) {
Expand Down

0 comments on commit 8e5e6bd

Please sign in to comment.