Post Message Refactor 2

Remove the need for NeoChat to have overloaded functions for posting messages and just use what quotient gives
This commit is contained in:
James Graham
2024-12-01 19:05:31 +00:00
parent d65aacac6f
commit ca81d35936
5 changed files with 42 additions and 117 deletions

View File

@@ -248,7 +248,9 @@ void NotificationsManager::postNotification(NeoChatRoom *room,
connect(replyAction.get(), &KNotificationReplyAction::replied, this, [room, replyEventId](const QString &text) {
TextHandler textHandler;
textHandler.setData(text);
room->postMessage(text, textHandler.handleSendText(), RoomMessageEvent::MsgType::Text, replyEventId, QString());
auto content = std::make_unique<Quotient::EventContent::TextContent>(textHandler.handleSendText(), u"text/html"_s);
EventRelation relatesTo = EventRelation::replyTo(replyEventId);
room->post<Quotient::RoomMessageEvent>(text, MessageEventType::Text, std::move(content), relatesTo);
});
notification->setReplyAction(std::move(replyAction));
}