From df9836f59e287c71c3fa14544de7c6e5e59e36d6 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 13 Feb 2023 20:11:48 +0100 Subject: [PATCH 1/8] Automatically update `nightly-build` tag every nightly release (#4374) This is done by CI force pushing the `nightly-build` tag - the `nightly-build` tag should never be relied on other than for GitHub releases. --- .CI/CreateUbuntuDeb.sh | 2 +- .github/workflows/build.yml | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.CI/CreateUbuntuDeb.sh b/.CI/CreateUbuntuDeb.sh index e8929783b..e13af8282 100755 --- a/.CI/CreateUbuntuDeb.sh +++ b/.CI/CreateUbuntuDeb.sh @@ -42,7 +42,7 @@ fi chatterino_version=$(git describe 2>/dev/null | cut -c 2-) || true if [ -z "$chatterino_version" ]; then - # Fall back to this in case the build happened outside of a git repo + # Fall back to this in case the build happened outside of a git repo or a repo without tags chatterino_version="0.0.0-dev" fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 167b23078..8e2c143db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -311,6 +311,9 @@ jobs: if: (github.event_name == 'push' && github.ref == 'refs/heads/master') steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # allows for tags access - uses: actions/download-artifact@v3 with: name: chatterino-windows-x86-64-5.15.2.zip @@ -352,3 +355,9 @@ jobs: prerelease: true name: Nightly Release tag: nightly-build + + - name: Update nightly-build tag + run: | + git tag -f nightly-build + git push -f origin nightly-build + shell: bash From bb0b563a87c23f045b085321b98c3a2aea68b099 Mon Sep 17 00:00:00 2001 From: nerix Date: Mon, 13 Feb 2023 21:45:58 +0100 Subject: [PATCH 2/8] Use `qintptr` in `QWidget::nativeEvent` on Qt 6 (#4376) --- CHANGELOG.md | 1 + src/widgets/BaseWindow.cpp | 13 +++++++++++++ src/widgets/BaseWindow.hpp | 16 +++++++++++++--- src/widgets/FramelessEmbedWindow.cpp | 5 +++++ src/widgets/FramelessEmbedWindow.hpp | 7 +++++++ 5 files changed, 39 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62def8459..14e408c9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ - Dev: Disabled ImageExpirationPool in tests. (#4363) - Dev: Don't rely on undocumented registry keys to find the default browser on Windows. (#4362) - Dev: Use `QEnterEvent` for `QWidget::enterEvent` on Qt 6. (#4365) +- Dev: Use `qintptr` in `QWidget::nativeEvent` on Qt 6. (#4376) ## 2.4.0 diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index 2c7da463b..60365081e 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -631,8 +631,13 @@ void BaseWindow::moveIntoDesktopRect(QPoint point) this->move(point); } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message, + qintptr *result) +#else bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) +#endif { #ifdef USEWINSDK MSG *msg = reinterpret_cast(message); @@ -830,7 +835,11 @@ bool BaseWindow::handleSHOWWINDOW(MSG *msg) #endif } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +bool BaseWindow::handleNCCALCSIZE(MSG *msg, qintptr *result) +#else bool BaseWindow::handleNCCALCSIZE(MSG *msg, long *result) +#endif { #ifdef USEWINSDK if (this->hasCustomWindowFrame()) @@ -914,7 +923,11 @@ bool BaseWindow::handleMOVE(MSG *msg) return false; } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +bool BaseWindow::handleNCHITTEST(MSG *msg, qintptr *result) +#else bool BaseWindow::handleNCHITTEST(MSG *msg, long *result) +#endif { #ifdef USEWINSDK const LONG border_width = 8; // in pixels diff --git a/src/widgets/BaseWindow.hpp b/src/widgets/BaseWindow.hpp index 3f99bc398..106cc1a3e 100644 --- a/src/widgets/BaseWindow.hpp +++ b/src/widgets/BaseWindow.hpp @@ -67,8 +67,13 @@ public: static bool supportsCustomWindowFrame(); protected: - virtual bool nativeEvent(const QByteArray &eventType, void *message, - long *result) override; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + bool nativeEvent(const QByteArray &eventType, void *message, + qintptr *result) override; +#else + bool nativeEvent(const QByteArray &eventType, void *message, + long *result) override; +#endif virtual void scaleChangedEvent(float) override; virtual void paintEvent(QPaintEvent *) override; @@ -103,10 +108,15 @@ private: bool handleDPICHANGED(MSG *msg); bool handleSHOWWINDOW(MSG *msg); - bool handleNCCALCSIZE(MSG *msg, long *result); bool handleSIZE(MSG *msg); bool handleMOVE(MSG *msg); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + bool handleNCCALCSIZE(MSG *msg, qintptr *result); + bool handleNCHITTEST(MSG *msg, qintptr *result); +#else + bool handleNCCALCSIZE(MSG *msg, long *result); bool handleNCHITTEST(MSG *msg, long *result); +#endif bool enableCustomFrame_; ActionOnFocusLoss actionOnFocusLoss_ = Nothing; diff --git a/src/widgets/FramelessEmbedWindow.cpp b/src/widgets/FramelessEmbedWindow.cpp index 9633e241d..c710e6e34 100644 --- a/src/widgets/FramelessEmbedWindow.cpp +++ b/src/widgets/FramelessEmbedWindow.cpp @@ -27,8 +27,13 @@ FramelessEmbedWindow::FramelessEmbedWindow() } #ifdef USEWINSDK +# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +bool FramelessEmbedWindow::nativeEvent(const QByteArray &eventType, + void *message, qintptr *result) +# else bool FramelessEmbedWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) +# endif { MSG *msg = reinterpret_cast(message); diff --git a/src/widgets/FramelessEmbedWindow.hpp b/src/widgets/FramelessEmbedWindow.hpp index 9d371afc6..3c37f07ae 100644 --- a/src/widgets/FramelessEmbedWindow.hpp +++ b/src/widgets/FramelessEmbedWindow.hpp @@ -13,8 +13,15 @@ public: protected: #ifdef USEWINSDK + +# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + bool nativeEvent(const QByteArray &eventType, void *message, + qintptr *result) override; +# else bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; +# endif + void showEvent(QShowEvent *event) override; #endif From 4cb8403491b2ab0d79f0875d691c335e62d75885 Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Mon, 13 Feb 2023 22:39:59 +0100 Subject: [PATCH 3/8] Handle non-versioned annotated tags gracefully when building a Ubuntu .deb package (#4375) --- .CI/CreateUbuntuDeb.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.CI/CreateUbuntuDeb.sh b/.CI/CreateUbuntuDeb.sh index e13af8282..9b89fddb8 100755 --- a/.CI/CreateUbuntuDeb.sh +++ b/.CI/CreateUbuntuDeb.sh @@ -40,9 +40,10 @@ if [ ! -f ./bin/chatterino ] || [ ! -x ./bin/chatterino ]; then exit 1 fi -chatterino_version=$(git describe 2>/dev/null | cut -c 2-) || true -if [ -z "$chatterino_version" ]; then - # Fall back to this in case the build happened outside of a git repo or a repo without tags +chatterino_version=$(git describe 2>/dev/null) || true +if [ "$(echo "$chatterino_version" | cut -c1-1)" = 'v' ]; then + chatterino_version="$(echo "$chatterino_version" | cut -c2-)" +else chatterino_version="0.0.0-dev" fi From a3189baf948dc108170a3b81b2d04351f2c28daa Mon Sep 17 00:00:00 2001 From: askepticaldreamer <106888785+askepticaldreamer@users.noreply.github.com> Date: Mon, 13 Feb 2023 15:00:46 -0800 Subject: [PATCH 4/8] Add channel name to Mentions chat logs (#4371) --- CHANGELOG.md | 1 + src/singletons/helper/LoggingChannel.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14e408c9c..16609e949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Minor: Added support for HTTP and Socks5 proxies through environment variables. (#4321) - Minor: Remove sending part of the multipart emoji workaround (#4361) - Minor: Added crashpad to capture crashes on Windows locally. See PR for build/crash analysis instructions. (#4351) +- Minor: Added channel name to /mentions log entries (#4371) - Bugfix: Fixed crash that would occur when performing certain actions after removing all tabs. (#4271) - Bugfix: Fixed highlight sounds not reloading on change properly. (#4194) - Bugfix: Fixed CTRL + C not working in reply thread popups. (#4209) diff --git a/src/singletons/helper/LoggingChannel.cpp b/src/singletons/helper/LoggingChannel.cpp index 78120496c..24da8d203 100644 --- a/src/singletons/helper/LoggingChannel.cpp +++ b/src/singletons/helper/LoggingChannel.cpp @@ -95,6 +95,11 @@ void LoggingChannel::addMessage(MessagePtr message) } QString str; + if (channelName.startsWith("/mentions")) + { + str.append("#" + message->channelName + " "); + } + str.append('['); str.append(now.toString("HH:mm:ss")); str.append("] "); From f317d4c99b0095ef17114322a3a65d6c1fc79b43 Mon Sep 17 00:00:00 2001 From: pajlada Date: Tue, 14 Feb 2023 21:59:23 +0100 Subject: [PATCH 5/8] Fix User Card moderation actions not using Helix (#4378) --- CHANGELOG.md | 1 + src/widgets/dialogs/UserInfoPopup.cpp | 29 ++++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16609e949..575e78c42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - Minor: Remove sending part of the multipart emoji workaround (#4361) - Minor: Added crashpad to capture crashes on Windows locally. See PR for build/crash analysis instructions. (#4351) - Minor: Added channel name to /mentions log entries (#4371) +- Bugfix: Fixed User Card moderation actions not working after Twitch IRC chat command deprecation. (#4378) - Bugfix: Fixed crash that would occur when performing certain actions after removing all tabs. (#4271) - Bugfix: Fixed highlight sounds not reloading on change properly. (#4194) - Bugfix: Fixed CTRL + C not working in reply thread popups. (#4209) diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index de3586870..ed002225a 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -5,6 +5,7 @@ #include "common/NetworkRequest.hpp" #include "common/QLogging.hpp" #include "controllers/accounts/AccountController.hpp" +#include "controllers/commands/CommandController.hpp" #include "controllers/highlights/HighlightBlacklistUser.hpp" #include "controllers/hotkeys/HotkeyController.hpp" #include "messages/Message.hpp" @@ -223,6 +224,10 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent, .arg(this->userName_) .arg(calculateTimeoutDuration(button)); } + + msg = getApp()->commands->execCommand( + msg, this->underlyingChannel_, false); + this->underlyingChannel_->sendMessage(msg); return ""; }}, @@ -478,25 +483,35 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent, case TimeoutWidget::Ban: { if (this->underlyingChannel_) { - this->underlyingChannel_->sendMessage("/ban " + - this->userName_); + QString value = "/ban " + this->userName_; + value = getApp()->commands->execCommand( + value, this->underlyingChannel_, false); + + this->underlyingChannel_->sendMessage(value); } } break; case TimeoutWidget::Unban: { if (this->underlyingChannel_) { - this->underlyingChannel_->sendMessage("/unban " + - this->userName_); + QString value = "/unban " + this->userName_; + value = getApp()->commands->execCommand( + value, this->underlyingChannel_, false); + + this->underlyingChannel_->sendMessage(value); } } break; case TimeoutWidget::Timeout: { if (this->underlyingChannel_) { - this->underlyingChannel_->sendMessage( - "/timeout " + this->userName_ + " " + - QString::number(arg)); + QString value = "/timeout " + this->userName_ + " " + + QString::number(arg); + + value = getApp()->commands->execCommand( + value, this->underlyingChannel_, false); + + this->underlyingChannel_->sendMessage(value); } } break; From ff53b7cc977cca1db9fb4ff4311d48fac11d6b3a Mon Sep 17 00:00:00 2001 From: Lucas K Date: Tue, 14 Feb 2023 22:27:33 +0100 Subject: [PATCH 6/8] Fix inconsistent separator usage in command failure messages (#4379) --- src/controllers/commands/CommandController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/commands/CommandController.cpp b/src/controllers/commands/CommandController.cpp index d8d766f0b..06feedd96 100644 --- a/src/controllers/commands/CommandController.cpp +++ b/src/controllers/commands/CommandController.cpp @@ -955,7 +955,7 @@ void CommandController::initialize(Settings &, Paths &paths) QString message) { using Error = HelixGetChattersError; - QString errorMessage = QString("Failed to get chatter count: "); + QString errorMessage = QString("Failed to get chatter count - "); switch (error) { @@ -1063,7 +1063,7 @@ void CommandController::initialize(Settings &, Paths &paths) auto formatModsError = [](HelixGetModeratorsError error, QString message) { using Error = HelixGetModeratorsError; - QString errorMessage = QString("Failed to get moderators: "); + QString errorMessage = QString("Failed to get moderators - "); switch (error) { From 998cfbaf67dfd843a1e012ef46e46f6833783ed1 Mon Sep 17 00:00:00 2001 From: Felanbird <41973452+Felanbird@users.noreply.github.com> Date: Wed, 15 Feb 2023 14:31:01 -0500 Subject: [PATCH 7/8] Clean up changelog in preparation of v2.4.1 (#4381) --- CHANGELOG.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 575e78c42..f9ea71777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,20 +2,20 @@ ## Unversioned -- Major: Added live emote updates for BTTV (#4147) -- Minor: Added option to highlight your own messages in Highlights page under Users tab. (#3833) -- Minor: Change the highlight order to prioritize Message highlights over User highlights. (#4303) -- Minor: Added ability to negate search options by prefixing it with an exclamation mark (e.g. `!badge:mod` to search for messages where the author does not have the moderator badge). (#4207) -- Minor: Search window input will automatically use currently selected text if present. (#4178) -- Minor: Cleared up highlight sound settings (#4194) -- Minor: Tables in settings window will now scroll to newly added rows. (#4216) -- Minor: Added link to streamlink docs for easier user setup. (#4217) +- Major: Added live emote updates for BTTV. (#4147) - Minor: Added setting to turn off rendering of reply context. (#4224) +- Minor: Changed the highlight order to prioritize Message highlights over User highlights. (#4303) +- Minor: Added a setting to highlight your own messages in `Highlights -> Users`. (#3833) +- Minor: Added the ability to negate search options by prefixing it with an exclamation mark (e.g. `!badge:mod` to search for messages where the author does not have the moderator badge). (#4207) +- Minor: Search window input will automatically use currently selected text if present. (#4178) +- Minor: Grouped highlight sound columns together and improved wording for the default sound setting. (#4194) +- Minor: Tables in settings window will now scroll to newly added rows. (#4216) - Minor: Added setting to select which channels to log. (#4302) +- Minor: Added channel name to /mentions log entries. (#4371) +- Minor: Added link to streamlink docs for easier user setup. (#4217) - Minor: Added support for HTTP and Socks5 proxies through environment variables. (#4321) -- Minor: Remove sending part of the multipart emoji workaround (#4361) +- Minor: Removed sending part of the multipart emoji workaround. (#4361) - Minor: Added crashpad to capture crashes on Windows locally. See PR for build/crash analysis instructions. (#4351) -- Minor: Added channel name to /mentions log entries (#4371) - Bugfix: Fixed User Card moderation actions not working after Twitch IRC chat command deprecation. (#4378) - Bugfix: Fixed crash that would occur when performing certain actions after removing all tabs. (#4271) - Bugfix: Fixed highlight sounds not reloading on change properly. (#4194) @@ -35,7 +35,7 @@ - Bugfix: Fixed an issue where beta versions wouldn't update to stable versions correctly. (#4329) - Bugfix: Avoided crash that could occur when receiving channel point reward information. (#4360) - Dev: Changed sound backend from Qt to miniaudio. (#4334) -- Dev: Remove protocol from QApplication's Organization Domain (so changed from `https://www.chatterino.com` to `chatterino.com`). (#4256) +- Dev: Removed protocol from QApplication's Organization Domain (so changed from `https://www.chatterino.com` to `chatterino.com`). (#4256) - Dev: Ignore `WM_SHOWWINDOW` hide events, causing fewer attempted rescales. (#4198) - Dev: Migrated to C++ 20 (#4252, #4257) - Dev: Enable LTO for main branch builds. (#4258, #4260) From 4c8ad850746fbe329de01c98b91e765a8a0cf37c Mon Sep 17 00:00:00 2001 From: Wissididom <30803034+Wissididom@users.noreply.github.com> Date: Wed, 15 Feb 2023 23:52:28 +0100 Subject: [PATCH 8/8] Improve Linux build instructions (#4382) Removed QtMultimedia and GStreamer dependencies from build documentations. These are no longer required ever since miniaudio replaced them for highlight sounds. --- BUILDING_ON_LINUX.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BUILDING_ON_LINUX.md b/BUILDING_ON_LINUX.md index eb5e44223..5f80b2d39 100644 --- a/BUILDING_ON_LINUX.md +++ b/BUILDING_ON_LINUX.md @@ -8,11 +8,11 @@ Note on Qt version compatibility: If you are installing Qt from a package manage _Most likely works the same for other Debian-like distros_ -Install all of the dependencies using `sudo apt install qttools5-dev qtmultimedia5-dev qt5-image-formats-plugins libqt5svg5-dev libboost-dev libssl-dev libboost-system-dev libboost-filesystem-dev cmake g++` +Install all of the dependencies using `sudo apt install qttools5-dev qt5-image-formats-plugins libqt5svg5-dev libboost-dev libssl-dev libboost-system-dev libboost-filesystem-dev cmake g++` ### Arch Linux -Install all of the dependencies using `sudo pacman -S --needed qt5-base qt5-multimedia qt5-imageformats qt5-svg qt5-tools gst-plugins-ugly gst-plugins-good boost rapidjson pkgconf openssl cmake` +Install all of the dependencies using `sudo pacman -S --needed qt5-base qt5-imageformats qt5-svg qt5-tools boost rapidjson pkgconf openssl cmake` Alternatively you can use the [chatterino2-git](https://aur.archlinux.org/packages/chatterino2-git/) package to build and install Chatterino for you. @@ -20,7 +20,7 @@ Alternatively you can use the [chatterino2-git](https://aur.archlinux.org/packag _Most likely works the same for other Red Hat-like distros. Substitute `dnf` with `yum`._ -Install all of the dependencies using `sudo dnf install qt5-qtbase-devel qt5-qtmultimedia-devel qt5-imageformats qt5-qtsvg-devel qt5-linguist libsecret-devel openssl-devel boost-devel cmake` +Install all of the dependencies using `sudo dnf install qt5-qtbase-devel qt5-imageformats qt5-qtsvg-devel qt5-linguist libsecret-devel openssl-devel boost-devel cmake` ### NixOS 18.09+