From a8f22003cb08d68cb233b00381a103f352cc1026 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 15 Jan 2025 15:51:05 -0500 Subject: [PATCH] Adapt to new libQuotient API changes postPlainText is gone --- autotests/timelinemessagemodeltest.cpp | 8 ++++++++ src/models/actionsmodel.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/autotests/timelinemessagemodeltest.cpp b/autotests/timelinemessagemodeltest.cpp index bc1f037fb..ef5b419ed 100644 --- a/autotests/timelinemessagemodeltest.cpp +++ b/autotests/timelinemessagemodeltest.cpp @@ -137,7 +137,11 @@ void TimelineMessageModelTest::pendingEvent() model->setRoom(room); QCOMPARE(model->rowCount(), 0); +#if Quotient_VERSION_MINOR > 9 + auto txnId = room->postText("New plain message"_L1); +#else auto txnId = room->postPlainText("New plain message"_L1); +#endif QCOMPARE(model->rowCount(), 1); QCOMPARE(spyInsert.count(), 1); @@ -145,7 +149,11 @@ void TimelineMessageModelTest::pendingEvent() QCOMPARE(model->rowCount(), 0); QCOMPARE(spyRemove.count(), 1); +#if Quotient_VERSION_MINOR > 9 + txnId = room->postText("New plain message"_L1); +#else txnId = room->postPlainText("New plain message"_L1); +#endif QCOMPARE(model->rowCount(), 1); QCOMPARE(spyInsert.count(), 2); diff --git a/src/models/actionsmodel.cpp b/src/models/actionsmodel.cpp index ed440b69a..877387031 100644 --- a/src/models/actionsmodel.cpp +++ b/src/models/actionsmodel.cpp @@ -136,7 +136,11 @@ QList actions{ Action{ u"plain"_s, [](const QString &text, NeoChatRoom *room, ChatBarCache *) { +#if Quotient_VERSION_MINOR > 9 + room->postText(text.toHtmlEscaped()); +#else room->postPlainText(text.toHtmlEscaped()); +#endif return QString(); }, std::nullopt,