telepathy-qt: Message::text(): Omit parts with non-empty 'interface' key value
Alexandr Akulich
kaffeine at kemper.freedesktop.org
Mon Sep 2 18:00:10 UTC 2019
Module: telepathy-qt
Branch: master
Commit: 0c98675c97cd0d4e48293d7281f7150ecdf7f93d
URL: http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=0c98675c97cd0d4e48293d7281f7150ecdf7f93d
Author: Alexander Akulich <akulichalexander at gmail.com>
Date: Sat May 5 01:59:04 2018 +0300
Message::text(): Omit parts with non-empty 'interface' key value
The specification says that parts with a specified, but unsupported
interface should be ignored. This is needed to let a CM to specify
a preferred text/plain alternative for a specially-formatted text,
such as quotes.
---
TelepathyQt/message.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/TelepathyQt/message.cpp b/TelepathyQt/message.cpp
index 6994028c..a10fcac6 100644
--- a/TelepathyQt/message.cpp
+++ b/TelepathyQt/message.cpp
@@ -379,6 +379,10 @@ QString Message::text() const
const QString contentType = stringOrEmptyFromPart(mPriv->parts, i, "content-type");
if (contentType == QLatin1String("text/plain")) {
+ const QString interface = valueFromPart(mPriv->parts, i, "interface").toString();
+ if (!interface.isEmpty()) {
+ continue;
+ }
const QString altGroup = stringOrEmptyFromPart(mPriv->parts, i, "alternative");
if (!altGroup.isEmpty()) {
if (altGroupsUsed.contains(altGroup)) {
More information about the telepathy-commits
mailing list