From 93876f06b6a1929dc757595ba4410b742402b7ab Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Mon, 25 Feb 2019 11:27:24 +0900 Subject: Room::postHtmlMessage: default message type to m.text postHtmlText becomes just a synonym for 2-arg postHtmlMessage (hopefully at least this doesn't confuse QML that is generally terrible at resolving overloads). --- lib/room.cpp | 4 ++-- lib/room.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/room.cpp b/lib/room.cpp index 7e7d8505..c7723832 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -1525,7 +1525,7 @@ QString Room::postPlainText(const QString& plainText) } QString Room::postHtmlMessage(const QString& plainText, const QString& html, - MessageEventType type) + MessageEventType type) { return d->sendEvent(plainText, type, new EventContent::TextContent(html, QStringLiteral("text/html"))); @@ -1533,7 +1533,7 @@ QString Room::postHtmlMessage(const QString& plainText, const QString& html, QString Room::postHtmlText(const QString& plainText, const QString& html) { - return postHtmlMessage(plainText, html, MessageEventType::Text); + return postHtmlMessage(plainText, html); } QString Room::postFile(const QString& plainText, const QUrl& localPath, diff --git a/lib/room.h b/lib/room.h index 808c6074..a9341bd2 100644 --- a/lib/room.h +++ b/lib/room.h @@ -385,7 +385,8 @@ namespace QMatrixClient QString postMessage(const QString& plainText, MessageEventType type); QString postPlainText(const QString& plainText); QString postHtmlMessage(const QString& plainText, - const QString& html, MessageEventType type); + const QString& html, + MessageEventType type = MessageEventType::Text); QString postHtmlText(const QString& plainText, const QString& html); QString postFile(const QString& plainText, const QUrl& localPath, bool asGenericFile = false); -- cgit v1.2.3