client: Fix duplicated query quit messages
authorShane Synan <digitalcircuit36939@gmail.com>
Tue, 7 Aug 2018 17:01:39 +0000 (12:01 -0500)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 28 Aug 2018 19:55:21 +0000 (21:55 +0200)
Replace the .contains() check with std::binary_search on message
timestamps, passing a custom comparator that provides +/- 1000 ms of
fuzzy matching.  If a quit message is received and doesn't exist
within this time range, it gets forwarded to the query, otherwise
discarded.

Remove the QMultiHash method that tracked quit nicknames.  Each query
gets a unique MessageFilter, so there's no need to store and filter
that.  This will need modified if e.g. adding an option for quit
messages in the Chat Monitor.

This fixes an existing bug made much worse with millisecond timestamp
precision.  Before the 64-bit time changes, quit messages would only
be duplicated if they got split over the turn of a second, a rare
occurrence.  Afterwards, they'd get duplicated if split over the turn
of a millisecond, a much more common occurrence.

Fixes regression from commit 6a63070246d89aa2a2474e3a9a1035fa889ad77e


No differences found