From 27f7142cd86a46d1b13d99a6b86c126892fa86ca Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Thu, 13 Apr 2017 04:11:22 +0300 Subject: Initial implementation for local echo Each HistoryView maintains a list of pending events. Each pending message is validated from the homeserver with either the returned EventId or the body of the message. Currently there is no support to remove invalid messages. Also some small refactoring: - ChatPage doesn't know about the message being sent. The message delivery is solely handled by HistoryViewManager. - Nick coloring function moved to HistoryViewManager. --- src/MatrixClient.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/MatrixClient.cc') diff --git a/src/MatrixClient.cc b/src/MatrixClient.cc index 7b45646c..9299c7eb 100644 --- a/src/MatrixClient.cc +++ b/src/MatrixClient.cc @@ -258,9 +258,8 @@ void MatrixClient::onSendTextMessageResponse(QNetworkReply *reply) } emit messageSent(object.value("event_id").toString(), + reply->property("roomid").toString(), reply->property("txn_id").toInt()); - - incrementTransactionId(); } void MatrixClient::onRoomAvatarResponse(QNetworkReply *reply) @@ -446,6 +445,9 @@ void MatrixClient::sendTextMessage(const QString &roomid, const QString &msg) no reply->setProperty("endpoint", Endpoint::SendTextMessage); reply->setProperty("txn_id", txn_id_); + reply->setProperty("roomid", roomid); + + incrementTransactionId(); } void MatrixClient::initialSync() noexcept -- cgit 1.5.1