Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into chatterino7
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Aug 12, 2023
2 parents 670fba2 + 1e35391 commit 8650c99
Show file tree
Hide file tree
Showing 59 changed files with 1,567 additions and 541 deletions.
47 changes: 47 additions & 0 deletions .CI/build-installer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
if (-not (Test-Path -PathType Container Chatterino2)) {
Write-Error "Couldn't find a folder called 'Chatterino2' in the current directory.";
exit 1
}

# Check if we're on a tag
$OldErrorActionPref = $ErrorActionPreference;
$ErrorActionPreference = 'Continue';
git describe --exact-match --match 'v*' *> $null;
$isTagged = $?;
$ErrorActionPreference = $OldErrorActionPref;

$defines = $null;
if ($isTagged) {
# This is a release.
# Make sure, any existing `modes` file is overwritten for the user,
# for example when updating from nightly to stable.
Write-Output "" > Chatterino2/modes;
$installerBaseName = "Chatterino.Installer";
}
else {
Write-Output nightly > Chatterino2/modes;
$defines = "/DIS_NIGHTLY=1";
$installerBaseName = "Chatterino.Nightly.Installer";
}

if ($Env:GITHUB_OUTPUT) {
# This is used in CI when creating the artifact
"C2_INSTALLER_BASE_NAME=$installerBaseName" >> "$Env:GITHUB_OUTPUT"
}

# Copy vc_redist.x64.exe
if ($null -eq $Env:VCToolsRedistDir) {
Write-Error "VCToolsRedistDir is not set. Forgot to set Visual Studio environment variables?";
exit 1
}
Copy-Item "$Env:VCToolsRedistDir\vc_redist.x64.exe" .;

# Build the installer
ISCC `
/DWORKING_DIR="$($pwd.Path)\" `
/DINSTALLER_BASE_NAME="$installerBaseName" `
$defines `
/O. `
"$PSScriptRoot\chatterino-installer.iss";

Move-Item "$installerBaseName.exe" "$installerBaseName$($Env:VARIANT_SUFFIX).exe"
87 changes: 87 additions & 0 deletions .CI/chatterino-installer.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Chatterino"
#define MyAppVersion "2.4.4"
#define MyAppPublisher "Chatterino Team"
#define MyAppURL "https://www.chatterino.com"
#define MyAppExeName "chatterino.exe"

; used in build-installer.ps1
; if set, must end in a backslash
#ifndef WORKING_DIR
#define WORKING_DIR ""
#endif

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{F5FE6614-04D4-4D32-8600-0ABA0AC113A4}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
VersionInfoVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
ArchitecturesInstallIn64BitMode=x64
;Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=out
; This is defined by the build-installer.ps1 script,
; but kept optional for regular use.
#ifdef INSTALLER_BASE_NAME
OutputBaseFilename={#INSTALLER_BASE_NAME}
#else
OutputBaseFilename=Chatterino.Installer
#endif
Compression=lzma
SolidCompression=yes
WizardStyle=modern
UsePreviousTasks=no
UninstallDisplayIcon={app}\{#MyAppExeName}
RestartIfNeededByRun=no

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

#ifdef IS_NIGHTLY
[Messages]
SetupAppTitle=Setup (Nightly)
SetupWindowTitle=Setup - %1 (Nightly)
#endif

[Tasks]
Name: "vcredist"; Description: "Install the required Visual C++ 2015/2017/2019/2022 Redistributable";
; GroupDescription: "{cm:AdditionalIcons}";
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; Flags: unchecked
Name: "freshinstall"; Description: "Fresh install (delete old settings/logs)"; Flags: unchecked

[Files]
Source: "{#WORKING_DIR}Chatterino2\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#WORKING_DIR}vc_redist.x64.exe"; DestDir: "{tmp}"; Tasks: vcredist;
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
; VC++ redistributable
Filename: {tmp}\vc_redist.x64.exe; Parameters: "/install /passive /norestart"; StatusMsg: "Installing 64-bit Windows Universal Runtime..."; Flags: waituntilterminated; Tasks: vcredist
; Run chatterino
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[InstallDelete]
; Delete cache on install
Type: filesandordirs; Name: "{userappdata}\Chatterino2\Cache"
; Delete %appdata%\Chatterino2 on freshinstall
Type: filesandordirs; Name: "{userappdata}\Chatterino2"; Tasks: freshinstall

[UninstallDelete]
; Delete cache on uninstall
Type: filesandordirs; Name: "{userappdata}\Chatterino2\Cache"
14 changes: 14 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# If a commit modifies a ton of files and doesn't really contribute to the
# output of git-blame, please add it here
#
# Don't add commits from the same PR you are creating. We squash PRs into a
# single commit, so references to those commits will be lost
#
# 2018 - changed to 80 max column
f71ff08e686ae76c3dd4084d0f05f27ba9b3fdcb
#
# 2018 - added brace wrapping after if and for
e259b9e39f46f3cb0e4838c988d4f320a03dfaa4
#
# 2019 - Normalize line endings in already existing files
b06eb9df835c25154899fbcf43e9b37addcea1b1
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ jobs:

- name: Install Qt5
if: startsWith(matrix.qt-version, '5.')
uses: jurplel/install-qt-action@v3.2.1
uses: jurplel/install-qt-action@v3.3.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
version: ${{ matrix.qt-version }}

- name: Install Qt6
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/install-qt-action@v3.2.1
uses: jurplel/install-qt-action@v3.3.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down Expand Up @@ -284,7 +284,7 @@ jobs:

- name: clang-tidy review
if: matrix.clang-tidy-review && github.event_name == 'pull_request'
uses: ZedThree/[email protected].2
uses: ZedThree/[email protected].3
with:
build_dir: build-clang-tidy
config_file: ".clang-tidy"
Expand All @@ -311,7 +311,7 @@ jobs:
- name: clang-tidy-review upload
if: matrix.clang-tidy-review && github.event_name == 'pull_request'
uses: ZedThree/clang-tidy-review/[email protected].2
uses: ZedThree/clang-tidy-review/[email protected].3

- name: Package - AppImage (Ubuntu)
if: startsWith(matrix.os, 'ubuntu-22.04') && !matrix.skip-artifact
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/create-installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Create installer

on:
workflow_run:
workflows: ["Build"]
types: [completed]
# make sure this only runs on the default branch
branches: [master]
workflow_dispatch:

jobs:
create-installer:
runs-on: windows-latest
# Only run manually or when a build succeeds
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
qt-version: [5.15.2, 6.5.0]
env:
VARIANT_SUFFIX: ${{ startsWith(matrix.qt-version, '6.') && '.EXPERIMENTAL-Qt6' || '' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # allows for tags access

- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: build.yml
name: chatterino-windows-x86-64-Qt-${{ matrix.qt-version }}.zip
path: build/

- name: Unzip
run: 7z e -spf chatterino-windows-x86-64-Qt-${{ matrix.qt-version }}.zip
working-directory: build

- name: Install InnoSetup
run: choco install innosetup

- name: Add InnoSetup to path
run: echo "C:\Program Files (x86)\Inno Setup 6\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Enable Developer Command Prompt
uses: ilammy/[email protected]

- name: Build installer
id: build-installer
working-directory: build
run: ..\.CI\build-installer.ps1
shell: powershell

- name: Upload installer
uses: actions/upload-artifact@v3
with:
path: build/${{ steps.build-installer.outputs.C2_INSTALLER_BASE_NAME }}${{ env.VARIANT_SUFFIX }}.exe
name: ${{ steps.build-installer.outputs.C2_INSTALLER_BASE_NAME }}${{ env.VARIANT_SUFFIX }}.exe
2 changes: 1 addition & 1 deletion .github/workflows/post-clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: ZedThree/clang-tidy-review/[email protected].2
- uses: ZedThree/clang-tidy-review/[email protected].3
with:
lgtm_comment_body: ""
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
submodules: recursive

- name: Install Qt
uses: jurplel/install-qt-action@v3.2.1
uses: jurplel/install-qt-action@v3.3.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down
1 change: 0 additions & 1 deletion BUILDING_ON_WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Notes:
2. Unfold the top most tree element (latest stable Qt version, e.g. `Qt 5.15.2`)
3. Under this version, select the following entries:
- `MSVC 2019 64-bit` (or alternative version if you are using that)
- `Qt WebEngine` (optional)
4. Under the "Tools" tree element (at the bottom), ensure that `Qt Creator X.X.X` and `Debugging Tools for Windows` are selected. (they should be checked by default)
5. Continue through the installer and let the installer finish installing Qt.

Expand Down
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

## Unversioned

- Major: AutoMod term management messages (e.g. testaccount added "noob" as a blocked term on AutoMod.) are now hidden in Streamer Mode if you have the "Hide moderation actions" setting enabled. (#4758)
- Minor: Message input is now focused when clicking on emotes. (#4719)
- Minor: Changed viewer list to chatter list to more match Twitch's terminology. (#4732)
- Minor: Nicknames are now taken into consideration when searching for messages. (#4663)
- Minor: Nicknames are now taken into consideration when searching for messages. (#4663, #4742)
- Minor: Add an icon showing when streamer mode is enabled (#4410, #4690)
- Minor: Added `/shoutout <username>` commands to shoutout specified user. (#4638)
- Minor: Improved editing hotkeys. (#4628)
Expand All @@ -18,6 +19,14 @@
- Minor: 7TV badges now automatically update upon changing. (#4512)
- Minor: Stream status requests are now batched. (#4713)
- Minor: Added `/c2-theme-autoreload` command to automatically reload a custom theme. This is useful for when you're developing your own theme. (#4718)
- Minor: Remove restriction on Go To Message on system messages from search. (#4614)
- Minor: Highlights loaded from message history will now correctly appear in the /mentions tab. (#4475)
- Minor: All channels opened in browser tabs are synced when using the extension for quicker switching between tabs. (#4741)
- Minor: Show channel point redemptions without messages in usercard. (#4557)
- Minor: Allow for customizing the behavior of `Right Click`ing of usernames. (#4622, #4751)
- Minor: Added support for opening incognito links in firefox-esr and chromium. (#4745)
- Minor: Added support for opening incognito links under Linux/BSD using XDG. (#4745)
- Minor: Add missing hotkey Action for Open Player in Browser. (#4756)
- Bugfix: Increased amount of blocked users loaded from 100 to 1,000. (#4721)
- Bugfix: Fixed generation of crashdumps by the browser-extension process when the browser was closed. (#4667)
- Bugfix: Fix spacing issue with mentions inside RTL text. (#4677)
Expand All @@ -26,11 +35,13 @@
- Bugfix: Fix visual glitches with smooth scrolling. (#4501)
- Bugfix: Fixed pings firing for the "Your username" highlight when not signed in. (#4698)
- Bugfix: Fixed partially broken filters on Qt 6 builds. (#4702)
- Bugfix: Fixed tooltips & popups sometimes showing up on the wrong monitor. (#4740)
- Bugfix: Fixed some network errors having `0` as their HTTP status. (#4704)
- Bugfix: Fixed crash that could occurr when closing the usercard too quickly after blocking or unblocking a user. (#4711)
- Bugfix: Fixed highlights sometimes not working after changing sound device, or switching users in your operating system. (#4729)
- Bugfix: Fixed key bindings not showing in context menus on Mac. (#4722)
- Bugfix: Fixed tab completion rarely completing the wrong word. (#4735)
- Bugfix: Fixed an issue where Subscriptions & Announcements that contained ignored phrases would still appear if the Block option was enabled. (#4748)
- Dev: Added command to set Qt's logging filter/rules at runtime (`/c2-set-logging-rules`). (#4637)
- Dev: Added the ability to see & load custom themes from the Themes directory. No stable promises are made of this feature, changes might be made that breaks custom themes without notice. (#4570)
- Dev: Added test cases for emote and tab completion. (#4644)
Expand All @@ -41,19 +52,22 @@
- Dev: Replace our QObjectRef class with Qt's QPointer class. (#4666)
- Dev: Fixed warnings about QWidgets already having a QLayout. (#4672)
- Dev: Fixed undefined behavior when loading non-existant credentials. (#4673)
- Dev: Small refactor of the recent-messages API, splitting its internal API and its internal implementation up into separate files. (#4763)
- Dev: Added support for compiling with `sccache`. (#4678)
- Dev: Added `sccache` in Windows CI. (#4678)
- Dev: Moved preprocessor Git and date definitions to executables only. (#4681)
- Dev: Refactored tests to be able to use `ctest` and run in debug builds. (#4700)
- Dev: Added the ability to use an alternate linker using the `-DUSE_ALTERNATE_LINKER=...` CMake parameter. (#4711)
- Dev: The Windows installer is now built in CI. (#4408)
- Dev: Removed `getApp` and `getSettings` calls from message rendering. (#4535)
- Dev: Get the default browser executable instead of the entire command line when opening incognito links. (#4745)
- Dev: Removed unused code hidden behind the USEWEBENGINE define (#4757)

## 2.4.4

- Minor: Added a Send button in the input box so you can click to send a message. This is disabled by default and can be enabled with the "Show send message button" setting. (#4607)
- Minor: Improved error messages when the updater fails a download. (#4594)
- Minor: Added `/shield` and `/shieldoff` commands to toggle shield mode. (#4580)
- Minor: Allow for customizing the behavior of `Right Click`ing of usernames. (#4622)
- Bugfix: Fixed the menu warping on macOS on Qt6. (#4595)
- Bugfix: Fixed link tooltips not showing unless the thumbnail setting was enabled. (#4597)
- Bugfix: Domains starting with `http` are now parsed as links again. (#4598)
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ git submodule update --init --recursive

[Building on FreeBSD](../master/BUILDING_ON_FREEBSD.md)

## Git blame

This project has big commits in the history which for example update all line
endings. To improve the output of git-blame, consider setting:

```
git config blame.ignoreRevsFile .git-blame-ignore-revs
```

This will ignore all revisions mentioned in the [`.git-blame-ignore-revs`
file](./.git-blame-ignore-revs). GitHub does this by default.

## Code style

The code is formatted using clang format in Qt Creator. [.clang-format](src/.clang-format) contains the style file for clang format.
Expand Down
1 change: 1 addition & 0 deletions docs/make-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
This can only be "whole versions", so if you're releasing `2.4.0-beta` you'll need to condense it to `2.4.0`
- [ ] Updated version code in `resources/com.chatterino.chatterino.appdata.xml`
This cannot use dash to denote a pre-release identifier, you have to use a tilde instead.
- [ ] Updated version code in `.CI/chatterino-installer.iss`
- [ ] Update the changelog `## Unreleased` section to the new version `CHANGELOG.md`
Make sure to leave the `## Unreleased` line unchanged for easier merges
- [ ] Push directly to master :tf:
6 changes: 6 additions & 0 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,12 @@ void Application::initPubSub()

this->twitch->pubsub->signals_.moderation.automodUserMessage.connect(
[&](const auto &action) {
// This condition has been set up to execute isInStreamerMode() as the last thing
// as it could end up being expensive.
if (getSettings()->streamerModeHideModActions && isInStreamerMode())
{
return;
}
auto chan = this->twitch->getChannelOrEmptyByID(action.roomID);

if (chan->isEmpty())
Expand Down
Loading

0 comments on commit 8650c99

Please sign in to comment.