Mark own events as read again after sending

master
Nicolas Werner 4 years ago
parent 36e4405f25
commit 046b3f4da6
  1. 15
      src/timeline/EventStore.cpp
  2. 2
      src/timeline/EventStore.h

@ -91,7 +91,7 @@ EventStore::EventStore(std::string room_id, QObject *)
room_id_,
txn_id,
e.content,
[this, txn_id](const mtx::responses::EventId &,
[this, txn_id](const mtx::responses::EventId &event_id,
mtx::http::RequestErr err) {
if (err) {
const int status_code =
@ -104,7 +104,7 @@ EventStore::EventStore(std::string room_id, QObject *)
emit messageFailed(txn_id);
return;
}
emit messageSent(txn_id);
emit messageSent(txn_id, event_id.event_id.to_string());
});
},
event->data);
@ -135,8 +135,17 @@ EventStore::EventStore(std::string room_id, QObject *)
this,
&EventStore::messageSent,
this,
[this](std::string txn_id) {
[this](std::string txn_id, std::string event_id) {
nhlog::ui()->debug("sent {}", txn_id);
http::client()->read_event(
room_id_, event_id, [this, event_id](mtx::http::RequestErr err) {
if (err) {
nhlog::net()->warn(
"failed to read_event ({}, {})", room_id_, event_id);
}
});
cache::client()->removePendingStatus(room_id_, txn_id);
this->current_txn = "";
this->current_txn_error_count = 0;

@ -91,7 +91,7 @@ signals:
void fetchedMore();
void processPending();
void messageSent(std::string txn_id);
void messageSent(std::string txn_id, std::string event_id);
void messageFailed(std::string txn_id);
public slots:

Loading…
Cancel
Save