Miniaudio now runs everything in a separate audio thread - this uses boost::asio's io_context.
Our miniaudio implementation is now also much simplified - it does not use its own resource manager or device. This might end up being stupid if sounds don't work after changing output device or locking or w/e
I've made the sound controller into an interface, meaning we can support multiple sound backends in Chatterino. I've added a Null sound backend that disables all sound. A QMediaPlayer or QSoundEffect or Qt backend could be added.
Miniaudio might idle & disable the device now too, not sure
I've added some unrelated changes in the form of a new setting type, and a new setting page helper function for it, which will hopefully make adding new enum settings easier in the future.
This setting stores its value as a string instead of an int, and uses magic_enum to convert between that string value and its enum value.
Use full path in includes
Sort includes
Move anon namespace out of chatterino namespace
Use auto * where possible
Disable convert-member-function-to-static check for all member functions
Don't use else after return
Removed empty constructor
Replace use of `boost::variant` with `std::variant`
Co-authored-by: nerix <nerixdev@outlook.de>
If we also have a subscriber emote set for a channel, then don't treat
a follower emote set as local to that channel.
Co-authored-by: iProdigy <8106344+iProdigy@users.noreply.github.com>
* Moved implementation of the methods to the `cpp` file.
* Added `DebugCount::Flag(s)` and `DebugCount::configure(name, flags)`.
* Moved from `QMap` to `std::map` (order is important here).
* Used `QStringBuilder` for concatenations.
* Used `QLocale` for formatting (adds separators).
* Added `DebugCount::Flag::DataSize` for data sizes in bytes (and fixed language to English).
* Used `DataSize` for image sizes (maybe this should be moved somewhere else?).
* Added copy button to popup.
* Fixed Image usage reporting being eight times too large (could be another PR, but honestly it's four characters).
* Fixes a bug where avatars weren't loaded on fresh installations of Chatterino.
* Avatars now update every two weeks.
* Removes misleading `DownlaodManager` (now part of `Toasts.cpp`).
* Refactors usage of WinToast to be easier to read.
* Added version to AUMI.
* Removes manual `QString` → `std::wstring` conversions.
* Removes uses of implicit ASCII casts in `Toasts.cpp`, meaning it can be compiled with `QT_NO_CAST_FROM_ASCII`.
The rendering of selections was not aligned to the actual selection that took place for newlines at the end of messages, if they were the only part that was selected of that message.
In addition to that fix, we've already refactored the MessageLayoutContainer to try to make it a little bit more sane to work with in the future.
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
* Tests: Fix InputCompletion tests in Qt6
This is achieved by not checking exact order for certain completion tests
* Tests: Use Ubuntu 22.04 for all tests
This allows us to be a bit more loose and use more C++20 features in
tests
* Update dockerfiles
This code has been sitting behind a define since 2018 (de3a490). I'm not opposed to this code coming back however in this state, it feels better to remove it.
* Remove restriction on go to message on system messages
Fixes#4608
* changelog
* Change the changelog entry from a bugfix to minor
---------
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
* Split log line generation from message search text
* changelog
* remove empty space at the beginning of usernames
* Move changelog entry
---------
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
* feat: build installer in CI
Co-authored-by: 8thony <114905842+8thony@users.noreply.github.com>
* fix: use inno-setup from PATH
* fix: only match `v*` tags
* fix: don't add to release
* fix: only run on master
---------
Co-authored-by: 8thony <114905842+8thony@users.noreply.github.com>
* Fix tooltip & popup positioning
This tries to ensure the tooltip & popups are created on the correct
monitor
* Add changelog entry
* Clean up debug output
* Use the full frame geometry to figure out screen bound movements
* Remove the now-unused `setStayInScreenRect` function
* Change the UserInfoPopup offset to be based on its width & height
instead
* Remove more debug output
* Fixed tab completion rarely completing the wrong word.
Fixes: #3101
* Use QSignalBlocker instead of janky bool, add comment about hidden logic
* copypasteo
* feat: more hype chat
* Add `std::chrono::seconds` overload to formatTime
* Move & rename it to HypeChat + some other mini things
* Add changelog entry
* fix formattime test
---------
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
* refactor: remove singletons from message rendering
* chore: add changelog entry
* Disable the `cppcoreguidelines-avoid-const-or-ref-data-members` clang-tidy check
* auto *app
* Selection is a struct, not a class
* Use ChannelView's `signalHolder_` instead of `channelConnections_`
* Remove `applySettings` step, instead just connect & set each setting individually
* rename & constify some context values
* Handle empty "last message color" setting value better (as it was
originally in this pr before I removed that change :-)
* unrelated mini refactor cleanup
* let painSelection handle size_t instead of int
* Add some more comments to the MessageLayoutContext structs
---------
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This fixes a crash that could occur when closing a split before the
display name had a chance to update
The reason I found this was because the LiveController change I made
updated display names more regularly
Additionally, we now make sure to not send duplicate `displayNameUpdated` signals
upon each request for channels with CJK characters in their display name
* Default-initialize the `actualDisplayName` with the user's login name to not send an initial display name update if the display name is the same casing as the login name
* Specifically, this adds a caller to the network request, which makes the
success or failure callback not fire.
This has the unintended consequence of the block list not reloading if
the usercard is closed, but it's not a big concern.
* Add unrelated `-DUSE_ALTERNATE_LINKER` cmake option
From 0517d99b46/CMakeLists.txt (L87-L103)
`/debug-force-image-gc` will force garbage collection on all unused images
`/debug-force-image-unload` will force unload all images
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
Available test channels:
- `$$$` - Fill up scrollback (1000 messages), then add a new message every 500ms
- `$$$:e` - Add a new message every 500ms
- `$$$$` - Fill up scrollback (1000 messages), then add a new message every 250ms
- `$$$$:e` - Add a new message every 250ms
- `$$$$$` - Fill up scrollback (1000 messages), then add a new message every 100ms
- `$$$$$:e` - Add a new message every 100ms
- `$$$$$$` - Fill up scrollback (1000 messages), then add a new message every 50ms
- `$$$$$$:e` - Add a new message every 50ms
- `$$$$$$$` - Fill up scrollback (1000 messages), then add a new message every 25ms
- `$$$$$$$:e` - Add a new message every 25ms
Themes are loaded from the Themes directory (under the Chatterino directory, so %APPDATA%/Chatterino2/Themes).
Themes are json files (see the built in themes as an example).
After importing a theme, you must restart Chatterino for it to show up in the settings
Fixes a bug where we don't check if the sound device is active before trying to play a sound to it
We fix this by checking its state before every sound we try to play, and if the device is not in the started state we try to restart it.
The scripting capabilities is locked behind a cmake flag, and is not enabled by default.
Co-authored-by: nerix <nerixdev@outlook.de>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
The `SettingsPage::onShow` handler that sets up the block
list is only called when the application settings dialog
has already been shown once before. This caused the blocked
user list to appear empty until the second time it was opened.
Correct this by explicitly regenerating the block list in the
constructor of `IgnoresPage`.
* Update `CMakeLists.txt`
* Update `resources/com.chatterino.chatterino.appdata.xml`
* Update `src/common/Version.hpp`
* Update `CHANGELOG.md`
This includes changelog re-ordering changes that would normally be in a seperate PR, but this release will be an exception to that rule
This change also adds a new environment variable used while building: `CHATTERINO_REQUIRE_CLEAN_GIT` which, if set, will error out during your build's GIT stage.
This is used in CI to ensure we don't accidentally introduce a change that would result in builds showing up as "modified" again.
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
* feat: crashpad on windows
* feat: inline it
* feat: more crashpad
* chore: remove qBreakpad
* fix: add mention to crashpad
* refactor: version string
* feat: add crashpad module
* refactor: build crashpad from source
* fix: minor adjustments
* chore: add changelog entry
* fix: formatting and include
* fix: format
* build: use flags similar to release profile
* ci: build with crashpad on windows
* ci: recurse submodules
* ci: always include crashpad
* fix: try 7z
for some reason zstd just doesn't run
* fix: wrong path for symbols
* fix: copy
pls don't build
* ci: use new cache key
* fix: missing pragma
* ci: add workflow without crashpad
* docs: elevate changelog entry
* fix: add link to cmake issue
* fix: windows include issue
Someone (crashpad) includes Windows.h before winsock2.h
* fix: working directory
* fix: another working directory
* Removed magic numbers when checking rowIndex
* Swap from static ints to enum
* Referred enum members by enum name
* Fixed formatting
* Added highlight option for self messages
* Update CHANGELOG.md
* Made disabled by default
* Moved setting from Messages tab to Users tab
* Moved checks to HighlightController
* Set row index to 0
sillE silly me
* Update CHANGELOG.md
* Moved check outside of loop
* Improved naming and documentation on variables
* Fixed formatting
* Fix compile errors
* Update ColorProvider self message highlight color when it's changed
Use the ColorProvider self message highlight color instead of rolling
our own non-updating color
* Update changelog entry
* Remove unused `customColor` from user highlights builder
* Use explicit lambda capture
* Update comment for the color provider color
* HighlightModelHpp: Future-proof custom row enum B)
* Document UserHighlightModel color changes
* Update colorprovider comment
* Update enabled, show in mentions & color setting paths
* Rename settings from `selfMessagesHighlight` to `selfMessageHighlight`
---------
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
Thanks Greenlandicsmiley, Nerixyz, Yoitsu, and helmak for helping debug & test this
* Remove QMediaPlayer includes
* Prefer local path when generating the sound path
* Update changelog entry number
* Disable pitch & spatialization control
This feature is enabled by default and can be disabled in settings with the "Enable BTTV live emotes updates" setting.
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
* Pass link as argument instead of in command string when opening incognito links
* Update CHANGELOG.md
* Make changelog message more user facing
* Remove now unused argument for getCommand
* ci: format yaml and json files with prettier
* chore: add changelog entry
* fix: format everything
* ci: run pretter on all files
* ci: rename prettier step
* Add checkbox for custom logging and table with channels to log on Logs page
* Add checkbox to enable and disable logging per channel
* Return from addMessage before logging if custom logging enabled and channel does not have logging enabled
* Use clang-format to fix formatting
* Add CHANGELOG.md entry
* Resolve PR comments
* Remove toggle for channels so any channel listed will be logged
* Move Only log channels listed below checkbox to just above table
* Fix formatting
* Re-order changelog
* ChannelLog constructor: Copy & move instead of const ref & copy
* ChannelLog::createEmpty: Curly brace initialize instead of repeating
name
* ChannelLog toString & createEmpty: nodiscard
* Use COUNT paradigm in model column
* Remove ChanneLoggingModel source file comments
* Use Column::Channel in getRowFromItem
* Rename `getItemFromRow` parameter and mark it as unused
* Curly brace initialize ChannelLog
* private & friend class the model
* Filter out channels to log using a set instead of iterating over a vector every time a message comes in
* Rename `ChannelLog::channel` member to `ChannelLog::channelName`
Also made it private
* mini comment on ChannelLog
Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
* Add `<functional>` include to QStringHash.hpp
This ensures the base `std::hash` template is declared before this
specialization
* Add missing includes to `src/providers/twitch/TwitchAccountManager.hpp`
* Move explicit HelixChatters constructor to the source file
* Remove unused includes & add used includes to NicknamesModel.hpp
* NicknamesModel.hpp: Remove `virtual` when `override` is used
* Add missing QStringHash include to TwitchEmotes.cpp
* Add missing includes to various files
* Print Qt version in cmake step
Technically unrelated, but I'm sneaking it in
* Add changelog entry
* Fix crash that could occur when a channel is closed
Ensure we copy the QString in case the channel goes out of scope and
we're referring to nothing
* Add changelog entry
* Fix crash that could occur when closing down splits
Specifically, if a split was closed after the request for a thumbnail
had been made, but before the request had finished, we'd run into a
use-after-free issue
* Add changelog entry
* fix: remove unused includes
* fix: bad includes
* fix: top include
* fix: streamer mode includes
* fix: missing include
* fix: remove `#else`
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
* feat: c++ 20
* fix: c++ 20 deprecations
* fix(msvc): warnings
* chore: add changelog entry
* fix: formatting
* Update websocketpp to the `develop` branch
* Specify other template type in FlagsEnum != operator
* Remove the user of simple template ids in our websocketpp template class
Also standardizes the file a bit by using nested namespaces, using
pragma once
* fix: turn `MAGIC_MESSAGE_SUFFIX` into a `QString`
* hacky unhacky hacky const char hack
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
When you start Chatterino, you get two warnings from libpng: libpng warning: iCCP: known incorrect sRGB profile.
This is because two resources shipped by Chatterino have this incorrect profile. This PR fixes that (essentially just convert file.png file.png).
* Fix potential out-of-range access of at when stripping reply mention if
the message contained nothing other than the username
* Update changelog entry
* feat(helix): create response model for VIP listing
* feat(helix): stub out channel/vips request + handler
* feat(helix): parse VIPs list from data and pass to callback
* feat(helix): handle errors when getting VIP list then pass to callback
* feat(command): add barebones handler for helix-based /vips
* feat(command): provide better /vips output when user is not broadcaster
* chore(format): bulk reformat with clang-format
* chore(changelog): add entry for /vips Helix migration
* fix(helix): use correct method when calling VIP list endpoint
* fix(helix): use correct VIP list endpoint
* chore(tidy): please clang-tidy by marking parameter as unused
* feat(command): display unsorted VIP list returned from Helix API
* feat(settings): clone raid timegate settings for /vips
* feat(command): check /vips timegate setting before execution
* feat(command): handle 0 VIPs from Helix response
* feat(command): sort users alphabetically from Helix VIPs response
* fix(command): highlight users in Helix /vips output to match IRC
* fix(command): replace dynamic /vips error message with hardcoded string
* chore(comment): remove TODO comment that was DONE
* chore(format): bulk reformat using clang-format
* fix(command): send 0 VIP message after creation
* chore: apply suggestions from Felanbird
* fix(helix): change mention of user ban to VIPs in VIP list error message
* feat(helix): distinguish non-broadcaster auth error when getting VIPs
* chore(command): move handling of non-broadcaster /vips usage to API response
* chore(format): re-indent multiline string to get away from 80 char limit
* reformat
* fix tests
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
* Add initial support for finding hotkey display key sequences
* Make neededArguments work
* Implement displaying key combos in SplitHeader main menu
* Make Settings search text dynamic
* Make tab hide notice use a custom hotkeys key sequence
* Make Notebook menus use custom hotkeys key combo lookup for hiding tabs
* shut up changelog ci
* Make NotebookTab menus show custom hotkeys. SCUFFED:
this does not update dynamically!
* Scuffed: Make the show prefs button setting show the key bind
* Scuffed: Make the R9K description refer to hotkeys
* @pajlada, is something like this ok?
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
For commands affected by the timegating, they will continue to use their IRC command equivalent until the 11th of February, 2023.
This is one week before the actual migration is supposed to start. The wording of the date is shaky, so we start a bit before to be sure.
Any highly affected commands will have a temporary setting at the bottom of the General settings page to override the timegating functionality.
Any commands that are affected will also have their changelog entry updated to notify of the timegating. As of this commit, this is only active for /raid