mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-10-15 14:09:52 +00:00
Fix TCP messaging, LoRa status reversion, and message ordering (v1.5.8)
- TCPClientInterface overrides needs_transport_headers() so hops==1 packets get HEADER_2 wrapping through the hub - Track savedCounter in LXMFMessage and use direct filename lookup for status updates, fixing LoRa uptime-timestamp precision loss that caused SENT status to revert to QUEUED on reload - Remove timestamp-based re-sort in loadConversation() which broke chronological order when mixing LoRa (uptime) and TCP (epoch) timestamps; counter-based filenames already provide correct order
This commit is contained in:
@@ -30,7 +30,9 @@ void LXMFManager::loop() {
|
||||
|
||||
// Persist updated status to disk so reloads don't revert to QUEUED
|
||||
std::string peerHex = msg.destHash.toHex();
|
||||
if (_store) {
|
||||
if (_store && msg.savedCounter > 0) {
|
||||
_store->updateMessageStatusByCounter(peerHex, msg.savedCounter, false, msg.status);
|
||||
} else if (_store) {
|
||||
_store->updateMessageStatus(peerHex, msg.timestamp, false, msg.status);
|
||||
}
|
||||
|
||||
@@ -60,7 +62,8 @@ bool LXMFManager::sendMessage(const RNS::Bytes& destHash, const std::string& con
|
||||
if ((int)_outQueue.size() >= RATDECK_MAX_OUTQUEUE) { _outQueue.pop_front(); }
|
||||
_outQueue.push_back(msg);
|
||||
// Immediately save with QUEUED status so it appears in getMessages() right away
|
||||
if (_store) { _store->saveMessage(msg); }
|
||||
// Save the queue copy so savedCounter propagates back to the queued message
|
||||
if (_store) { _store->saveMessage(_outQueue.back()); }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user