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.
This commit is contained in:
Konstantinos Sideris 2017-04-13 04:11:22 +03:00
parent 718562737c
commit 27f7142cd8
10 changed files with 245 additions and 49 deletions

View file

@ -44,6 +44,7 @@ public:
void fetchOwnAvatar(const QUrl &avatar_url);
inline QString getHomeServer();
inline int transactionId();
inline void incrementTransactionId();
void reset() noexcept;
@ -73,7 +74,7 @@ signals:
void initialSyncCompleted(const SyncResponse &response);
void syncCompleted(const SyncResponse &response);
void syncFailed(const QString &msg);
void messageSent(const QString &event_id, const int txn_id);
void messageSent(const QString &event_id, const QString &roomid, const int txn_id);
private slots:
void onResponse(QNetworkReply *reply);
@ -126,6 +127,11 @@ inline QString MatrixClient::getHomeServer()
return server_;
}
inline int MatrixClient::transactionId()
{
return txn_id_;
}
inline void MatrixClient::setServer(const QString &server)
{
server_ = "https://" + server;