only use markup in pushover if the app has markup enabled
This commit is contained in:
parent
6177e89670
commit
2133691899
|
@ -42,9 +42,20 @@ void Pushover::slotNotify(Notification notification)
|
||||||
title.setBody(notification.title().toUtf8().constData());
|
title.setBody(notification.title().toUtf8().constData());
|
||||||
mp->append(title);
|
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;
|
QHttpPart text;
|
||||||
text.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"message\""));
|
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;
|
snoreDebug(SNORE_DEBUG) << "Message" << textString;
|
||||||
text.setBody(textString.toUtf8().constData());
|
text.setBody(textString.toUtf8().constData());
|
||||||
mp->append(text);
|
mp->append(text);
|
||||||
|
@ -80,11 +91,6 @@ void Pushover::slotNotify(Notification notification)
|
||||||
user.setBody(key.toUtf8().constData());
|
user.setBody(key.toUtf8().constData());
|
||||||
mp->append(user);
|
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);
|
QNetworkReply *reply = m_manager.post(request, mp);
|
||||||
mp->setParent(reply);
|
mp->setParent(reply);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue