* All non-phrase highlights can now trigger on messages from self
New state:
Allows self highlights: Subscription, Whisper, User, Badge
Does not allow self highlights: Message
* Add changelog entry
* fix PR number in changelog
* Use circular buffer for LimitedQueue
* Reduce copying of snapshot
* Small optimizations
* Remove unneeded lock statements
* Add LimitedQueue tests
* Fix includes for limited queue benchmark
* Update CHANGELOG.md
* Use correct boost version iterators
* Use a shared_mutex to clarify reads and writes
* Update `find`/`rfind` to return the result as a boost::optional
* Use `[[nodiscard]]` where applicable
* Update comments
* Add a couple more doc comments
* Replace size with get
get is a safe (locked & checked) version of at
* Use std::vector in LimitedQueueSnapshot
* Update LimitedQueue benchmarks
* Add mutex guard to buffer accessors
We do not know whether T is an atomic type or not
so we can't safely say that we can copy the value
at a certain address of the buffer.
See https://stackoverflow.com/a/2252478
* Update doc comments, add first/last getters
* Make limit_ const
* Omit `else` if the if-case always returns
* Title case category comments
* Remove `at`
* Fix `get` comment
* Privatize/comment/lock property accessors
- `limit` is now private
- `space` is now private
- `full` has been removed
- `empty` now locks
* Remove `front` function
* Remove `back` method
* Add comment to `first`
* Add comment to `last`
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
* Add basic benchmark
* Add basic documentation for how to run and add tests/benchmarks
* Update benchmark example output
* Add changelog entry
Co-authored-by: zneix <zneix@zneix.eu>
Also changes the way timeouts happen, since right now if a timeout was met (which it mostly wasn't), it would run the error callback twice causing potentially undefined behaviour
* Add missing includes
We would normally have these included in another file already, or even
the precompiled headers, but having the files included here too makes
testing single parts easier.
* Modify the regex building of highlight phrases for non-regex phrases
For phrases like !test, the word boundary checking we did before was not
enough, so we now check for either a word boundary, a whitespace
character, or the line start/end.
* Add tests for ensuring I haven't fully broken the highlight system
* Add changelog entry
How to build test:
mkdir build_test
cd build_test
cmake -DBUILD_TESTS=ON ..
make -j
Then to run the tests, use either:
make test
ctest
./chatterino-test