From 8317d743ea4d5f1e45de878dbaa3358f0988f673 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Wed, 3 Nov 2021 11:19:26 +0100 Subject: [PATCH] strip unwanted HTML header from HTML e-mails of gmail --- src/librssguard/services/gmail/gmailnetworkfactory.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/librssguard/services/gmail/gmailnetworkfactory.cpp b/src/librssguard/services/gmail/gmailnetworkfactory.cpp index 8aefcf374..4f83f3f09 100644 --- a/src/librssguard/services/gmail/gmailnetworkfactory.cpp +++ b/src/librssguard/services/gmail/gmailnetworkfactory.cpp @@ -528,6 +528,15 @@ bool GmailNetworkFactory::fillFullMessage(Message& msg, const QJsonObject& json, if (msg.m_contents.isEmpty()) { if (mime.contains(QL1S("text/html"))) { msg.m_contents = QByteArray::fromBase64(body[QSL("data")].toString().toUtf8(), QByteArray::Base64Option::Base64UrlEncoding); + + if (msg.m_contents.contains(QSL(""))) { + int strt = msg.m_contents.indexOf(QSL("")); + int end = msg.m_contents.indexOf(QSL("")); + + if (strt > 0 && end > strt) { + msg.m_contents = msg.m_contents.mid(strt + 6, end - strt - 6); + } + } } else if (backup_contents.isEmpty()) { backup_contents = QByteArray::fromBase64(body[QSL("data")].toString().toUtf8(), QByteArray::Base64Option::Base64UrlEncoding);