only use markup in pushover if the app has markup enabled

This commit is contained in:
Patrick von Reth 2015-06-27 15:18:19 +02:00
parent 6177e89670
commit 2133691899
1 changed files with 12 additions and 6 deletions

View File

@ -42,9 +42,20 @@ void Pushover::slotNotify(Notification notification)
title.setBody(notification.title().toUtf8().constData());
mp->append(title);
QString textString;
if(notification.application().constHints().value("use-markup")){
textString = notification.text(Utils::HREF | Utils::BOLD | Utils::UNDERLINE | Utils::FONT | Utils::ITALIC);
QHttpPart html;
html.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"html\""));
html.setBody("1");
mp->append(html);
} else {
textString = notification.text();
}
QHttpPart text;
text.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"message\""));
QString textString = notification.text(Utils::HREF | Utils::BOLD | Utils::UNDERLINE | Utils::FONT | Utils::ITALIC);
snoreDebug(SNORE_DEBUG) << "Message" << textString;
text.setBody(textString.toUtf8().constData());
mp->append(text);
@ -80,11 +91,6 @@ void Pushover::slotNotify(Notification notification)
user.setBody(key.toUtf8().constData());
mp->append(user);
QHttpPart html;
html.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"html\""));
html.setBody("1");
mp->append(html);
QNetworkReply *reply = m_manager.post(request, mp);
mp->setParent(reply);