mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-08-22 10:40:02 +00:00
Use local receive time for incoming message timestamps
This commit is contained in:
@@ -314,10 +314,14 @@ void LXMFManager::processIncoming(const uint8_t* data, size_t len, const RNS::By
|
||||
if (destHash.size() > 0) {
|
||||
msg.destHash = destHash;
|
||||
}
|
||||
// Stamp with receiver's local time if sender's timestamp is missing/invalid
|
||||
if (msg.timestamp < 1700000000) {
|
||||
// Use local receive time for incoming messages so all timestamps in
|
||||
// the conversation reflect THIS device's clock, not the sender's.
|
||||
// Prevents confusing display when a peer's clock is wrong/unsynced.
|
||||
{
|
||||
time_t now = time(nullptr);
|
||||
if (now > 1700000000) msg.timestamp = (double)now;
|
||||
if (now > 1700000000) {
|
||||
msg.timestamp = (double)now;
|
||||
}
|
||||
}
|
||||
Serial.printf("[LXMF] Message from %s (%d bytes) content_len=%d\n",
|
||||
msg.sourceHash.toHex().substr(0, 8).c_str(), (int)len, (int)msg.content.size());
|
||||
|
||||
Reference in New Issue
Block a user