Stop two servers taking turns claiming a contact's last sighting

A contact on two servers at once was marked seen by each in turn: a sighting
announced a contact change, every connection re-applied its contacts, and
each re-application recorded the contact on its own server — another change,
round and round, rewriting contacts.txt every time. Re-applying now only marks
a contact that was never seen; the last sighting moves when the client appears.

Sightings no longer write the file on their own either: they reach it in one
save half a minute later, or with the next edit's save, and are flushed when
the client closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-30 16:08:36 +00:00
parent 1dda20d1b2
commit 9f2e5087ce
4 changed files with 62 additions and 7 deletions

View File

@@ -766,6 +766,7 @@ public final class MainFrame extends JFrame implements ServerTabPane.Listener {
// Already shutting down (hook itself is running); nothing to remove.
}
sessions.shutdown();
contacts.flush();
soundPlayer.shutdown();
hotkeys.dispose();
if (tray != null) tray.dispose();