mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-03-29 05:19:50 +00:00
Persist only contacts to flash, mark on send/receive
Only destinations that have exchanged messages are written to SPIFFS. UIManager marks destinations as persistent on send_message() and on_message_received(). Reduces persist time from 40-50s to <1s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -593,6 +593,9 @@ void UIManager::send_message(const Bytes& dest_hash, const String& content) {
|
||||
std::string msg = "Sending message to " + hash_hex + "...";
|
||||
INFO(msg.c_str());
|
||||
|
||||
// Mark recipient as a persistent contact (survives reboot)
|
||||
Identity::mark_persistent(dest_hash);
|
||||
|
||||
// Get our source destination (needed for signing)
|
||||
Destination source = _router.delivery_destination();
|
||||
|
||||
@@ -645,6 +648,9 @@ void UIManager::on_message_received(::LXMF::LXMessage& message) {
|
||||
std::string msg = "Message received from " + source_hex + "...";
|
||||
INFO(msg.c_str());
|
||||
|
||||
// Mark sender as a persistent contact (survives reboot)
|
||||
RNS::Identity::mark_persistent(message.source_hash());
|
||||
|
||||
// Save to store
|
||||
_store.save_message(message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user