Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Chatterino/chatterino2 into danke…
Browse files Browse the repository at this point in the history
…rino
  • Loading branch information
Mm2PL committed Nov 28, 2023
2 parents dd687d8 + 6d02bb7 commit 9503b39
Show file tree
Hide file tree
Showing 133 changed files with 5,984 additions and 3,918 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog-category-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
changelog-category-check:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
id: label-checker
with:
result-encoding: "string"
Expand Down
91 changes: 91 additions & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
name: Test MacOS

on:
pull_request:
workflow_dispatch:
merge_group:

env:
TWITCH_PUBSUB_SERVER_IMAGE: ghcr.io/chatterino/twitch-pubsub-server-test:v1.0.6
QT_QPA_PLATFORM: minimal

concurrency:
group: test-macos-${{ github.ref }}
cancel-in-progress: true

jobs:
test-macos:
name: "Test ${{ matrix.os }}, Qt ${{ matrix.qt-version }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-13]
qt-version: [5.15.2, 6.5.0]
plugins: [false]
fail-fast: false
env:
C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }}
QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }}

steps:
- name: Enable plugin support
if: matrix.plugins
run: |
echo "C2_PLUGINS=ON" >> "$GITHUB_ENV"
- name: Set BUILD_WITH_QT6
if: startsWith(matrix.qt-version, '6.')
run: |
echo "C2_BUILD_WITH_QT6=ON" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # allows for tags access

- name: Install Qt
uses: jurplel/[email protected]
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
modules: ${{ env.QT_MODULES }}
version: ${{ matrix.qt-version }}

- name: Install dependencies
run: |
brew install boost openssl rapidjson p7zip create-dmg cmake tree docker colima
- name: Setup Colima
run: |
colima start
- name: Build
run: |
mkdir build-test
cd build-test
cmake \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTS=On \
-DBUILD_APP=OFF \
-DUSE_PRECOMPILED_HEADERS=OFF \
-DCHATTERINO_PLUGINS="$C2_PLUGINS" \
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
..
make -j"$(sysctl -n hw.logicalcpu)"
- name: Test
timeout-minutes: 30
run: |
docker pull kennethreitz/httpbin
docker pull ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
docker run -p 9051:80 --detach kennethreitz/httpbin
ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering
working-directory: build-test

- name: Post Setup Colima
if: always()
run: |
colima stop
working-directory: build-test
155 changes: 155 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
---
name: Test Windows

on:
pull_request:
workflow_dispatch:
merge_group:

env:
TWITCH_PUBSUB_SERVER_TAG: v1.0.7
QT_QPA_PLATFORM: minimal
# Last known good conan version
# 2.0.3 has a bug on Windows (conan-io/conan#13606)
CONAN_VERSION: 2.0.2

concurrency:
group: test-windows-${{ github.ref }}
cancel-in-progress: true

jobs:
test-windows:
name: "Test ${{ matrix.os }}, Qt ${{ matrix.qt-version }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
qt-version: [5.15.2, 6.5.0]
plugins: [false]
skip-artifact: [false]
skip-crashpad: [false]
fail-fast: false
env:
C2_BUILD_WITH_QT6: ${{ startsWith(matrix.qt-version, '6.') && 'ON' || 'OFF' }}
QT_MODULES: ${{ startsWith(matrix.qt-version, '6.') && 'qt5compat qtimageformats' || '' }}

steps:
- name: Enable plugin support
if: matrix.plugins
run: |
echo "C2_PLUGINS=ON" >> "$Env:GITHUB_ENV"
- name: Set Crashpad
if: matrix.skip-crashpad == false
run: |
echo "C2_ENABLE_CRASHPAD=ON" >> "$Env:GITHUB_ENV"
- name: Set BUILD_WITH_QT6
if: startsWith(matrix.qt-version, '6.')
run: |
echo "C2_BUILD_WITH_QT6=ON" >> "$Env:GITHUB_ENV"
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # allows for tags access

- name: Install Qt
uses: jurplel/[email protected]
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
modules: ${{ env.QT_MODULES }}
version: ${{ matrix.qt-version }}

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

- name: Setup conan variables
if: startsWith(matrix.os, 'windows')
run: |
"C2_USE_OPENSSL3=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "True" } else { "False" })" >> "$Env:GITHUB_ENV"
"C2_CONAN_CACHE_SUFFIX=$(if ($Env:C2_BUILD_WITH_QT6 -eq "on") { "-QT6" } else { "`" })" >> "$Env:GITHUB_ENV"
- name: Setup sccache
# sccache v0.5.3
uses: nerixyz/ccache-action@9a7e8d00116ede600ee7717350c6594b8af6aaa5
with:
variant: sccache
# only save on the default (master) branch
save: ${{ github.event_name == 'push' }}
key: sccache-test-${{ matrix.os }}-${{ matrix.qt-version }}-${{ matrix.skip-crashpad }}
restore-keys: |
sccache-test-${{ matrix.os }}-${{ matrix.qt-version }}
- name: Cache conan packages
uses: actions/cache@v3
with:
key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.py') }}${{ env.C2_CONAN_CACHE_SUFFIX }}
path: ~/.conan2/

- name: Install Conan
run: |
python3 -c "import site; import sys; print(f'{site.USER_BASE}\\Python{sys.version_info.major}{sys.version_info.minor}\\Scripts')" >> "$Env:GITHUB_PATH"
pip3 install --user "conan==${{ env.CONAN_VERSION }}"
- name: Setup Conan
run: |
conan --version
conan profile detect -f
- name: Install dependencies
run: |
mkdir build-test
cd build-test
conan install .. `
-s build_type=RelWithDebInfo `
-c tools.cmake.cmaketoolchain:generator="NMake Makefiles" `
-b missing `
--output-folder=. `
-o with_openssl3="$Env:C2_USE_OPENSSL3"
- name: Build
run: |
cmake `
-G"NMake Makefiles" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DBUILD_TESTS=On `
-DBUILD_APP=OFF `
-DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" `
-DUSE_PRECOMPILED_HEADERS=On `
-DBUILD_WITH_CRASHPAD="$Env:C2_ENABLE_CRASHPAD" `
-DCHATTERINO_PLUGINS="$Env:C2_PLUGINS" `
-DBUILD_WITH_QT6="$Env:C2_BUILD_WITH_QT6" `
..
set cl=/MP
nmake /S /NOLOGO
working-directory: build-test

- name: Download and extract Twitch PubSub Server Test
run: |
mkdir pubsub-server-test
Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/releases/download/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/server-${{ env.TWITCH_PUBSUB_SERVER_TAG }}-windows-amd64.zip" -outfile "pubsub-server.zip"
Expand-Archive pubsub-server.zip -DestinationPath pubsub-server-test
rm pubsub-server.zip
cd pubsub-server-test
Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.crt" -outfile "server.crt"
Invoke-WebRequest -Uri "https://github.com/Chatterino/twitch-pubsub-server-test/raw/${{ env.TWITCH_PUBSUB_SERVER_TAG }}/cmd/server/server.key" -outfile "server.key"
cd ..
- name: Cargo Install httpbox
run: |
cargo install --git https://github.com/kevinastone/httpbox --rev 89b971f
- name: Test
timeout-minutes: 30
run: |
httpbox --port 9051 &
cd ..\pubsub-server-test
.\server.exe 127.0.0.1:9050 &
cd ..\build-test
ctest --repeat until-pass:4 --output-on-failure --exclude-regex ClassicEmoteNameFiltering
working-directory: build-test

- name: Clean Conan cache
run: conan cache clean --source --build --download "*"
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get -y install \
libbenchmark-dev \
cmake \
rapidjson-dev \
libssl-dev \
Expand Down Expand Up @@ -84,6 +85,7 @@ jobs:
run: |
cmake \
-DBUILD_TESTS=On \
-DBUILD_BENCHMARKS=On \
-DBUILD_APP=OFF \
-DBUILD_WITH_QT6="$C2_BUILD_WITH_QT6" \
..
Expand All @@ -99,6 +101,6 @@ jobs:
docker pull ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
docker run --network=host --detach ${{ env.TWITCH_PUBSUB_SERVER_IMAGE }}
docker run -p 9051:80 --detach kennethreitz/httpbin
ctest --repeat until-pass:4
ctest --repeat until-pass:4 --output-on-failure
working-directory: build-test
shell: bash
28 changes: 26 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@
- Minor: The account switcher is now styled to match your theme. (#4817)
- Minor: Add an invisible resize handle to the bottom of frameless user info popups and reply thread popups. (#4795)
- Minor: The installer now checks for the VC Runtime version and shows more info when it's outdated. (#4847)
- Minor: Allow running `/ban`, `/timeout`, `/unban`, and `/untimeout` on User IDs by using the `id:123` syntax (e.g. `/timeout id:22484632 1m stop winning`). (#4945, #4956, #4957)
- Minor: The `/usercard` command now accepts user ids. (#4934)
- Minor: Add menu actions to reply directly to a message or the original thread root. (#4923)
- Minor: The `/reply` command now replies to the latest message of the user. (#4919)
- Minor: All sound capabilities can now be disabled by setting your "Sound backend" setting to "Null" and restarting Chatterino. (#4978)
- Minor: Add an option to use new experimental smarter emote completion. (#4987)
- Bugfix: Fixed an issue where certain emojis did not send to Twitch chat correctly. (#4840)
- Bugfix: Fixed capitalized channel names in log inclusion list not being logged. (#4848)
- Bugfix: Trimmed custom streamlink paths on all platforms making sure you don't accidentally add spaces at the beginning or end of its path. (#4834)
- Bugfix: Fixed a performance issue when displaying replies to certain messages. (#4807)
- Bugfix: Fixed an issue where certain parts of the split input wouldn't focus the split when clicked. (#4958)
- Bugfix: Fixed a data race when disconnecting from Twitch PubSub. (#4771)
- Bugfix: Fixed `/shoutout` command not working with usernames starting with @'s (e.g. `/shoutout @forsen`). (#4800)
- Bugfix: Fixed Usercard popup not floating on tiling WMs on Linux when "Automatically close user popup when it loses focus" setting is enabled. (#3511)
Expand All @@ -27,11 +34,22 @@
- Bugfix: Fixed an issue where the setting `Only search for emote autocompletion at the start of emote names` wouldn't disable if it was enabled when the client started. (#4855)
- Bugfix: Fixed empty page being added when showing out of bounds dialog. (#4849)
- Bugfix: Fixed issue on Windows preventing the title bar from being dragged in the top left corner. (#4873)
- Bugfix: Fixed an issue where reply context didn't render correctly if an emoji was touching text. (#4875)
- Bugfix: Fixed an issue where reply context didn't render correctly if an emoji was touching text. (#4875, #4977)
- Bugfix: Fixed the input completion popup from disappearing when clicking on it on Windows and macOS. (#4876)
- Bugfix: Fixed double-click text selection moving its position with each new message. (#4898)
- Bugfix: Fixed an issue where notifications on Windows would contain no or an old avatar. (#4899)
- Bugfix: Fixed headers of tables in the settings switching to bold text when selected. (#4913)
- Bugfix: Fixed tooltips appearing too large and/or away from the cursor. (#4920)
- Bugfix: Fixed a crash when clicking `More messages below` button in a usercard and closing it quickly. (#4933)
- Bugfix: Fixed thread popup window missing messages for nested threads. (#4923)
- Bugfix: Fixed an occasional crash for channel point redemptions with text input. (#4949)
- Bugfix: Fixed triple click on message also selecting moderation buttons. (#4961)
- Bugfix: Fixed a freeze from a bad regex in _Ignores_. (#4965)
- Bugfix: Fixed some emotes not appearing when using _Ignores_. (#4965)
- Bugfix: Fixed lookahead/-behind not working in _Ignores_. (#4965)
- Bugfix: Fixed Image Uploader accidentally deleting images with some hosts when link resolver was enabled. (#4971)
- Bugfix: Fixed rare crash with Image Uploader when closing a split right after starting an upload. (#4971)
- Dev: Run miniaudio in a separate thread, and simplify it to not manage the device ourselves. There's a chance the simplification is a bad idea. (#4978)
- Dev: Change clang-format from v14 to v16. (#4929)
- Dev: Fixed UTF16 encoding of `modes` file for the installer. (#4791)
- Dev: Temporarily disable High DPI scaling on Qt6 builds on Windows. (#4767)
Expand All @@ -50,13 +68,19 @@
- Dev: Add a compile-time flag `USE_SYSTEM_MINIAUDIO` which can be turned on to use the system miniaudio. (#4867)
- Dev: Update vcpkg to use Qt6. (#4872)
- Dev: Replace `boost::optional` with `std::optional`. (#4877)
- Dev: Improve performance by reducing repaints caused by selections. (#4889)
- Dev: Improve performance of selecting text. (#4889, #4911)
- Dev: Removed direct dependency on Qt 5 compatibility module. (#4906)
- Dev: Refactor `Emoji`'s EmojiMap into a vector. (#4980)
- Dev: Refactor `DebugCount` and add copy button to debug popup. (#4921)
- Dev: Refactor `common/Credentials`. (#4979)
- Dev: Changed lifetime of context menus. (#4924)
- Dev: Refactor `ChannelView`, removing a bunch of clang-tidy warnings. (#4926)
- Dev: Refactor `IrcMessageHandler`, removing a bunch of clang-tidy warnings & changing its public API. (#4927)
- Dev: `Details` file properties tab is now populated on Windows. (#4912)
- Dev: Removed `Outcome` from network requests. (#4959)
- Dev: Added Tests for Windows and MacOS in CI. (#4970)
- Dev: Refactored the Image Uploader feature. (#4971)
- Dev: Fixed deadlock and use-after-free in tests. (#4981)

## 2.4.6

Expand Down
17 changes: 14 additions & 3 deletions benchmarks/src/Emojis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,20 @@ static void BM_EmojiParsing(benchmark::State &state)
};

const auto &emojiMap = emojis.getEmojis();
std::shared_ptr<EmojiData> penguin;
emojiMap.tryGet("1F427", penguin);
auto penguinEmoji = penguin->emote;
auto getEmoji = [&](auto code) {
std::shared_ptr<EmojiData> emoji;
for (const auto &e : emojis.getEmojis())
{
if (e->unifiedCode == code)
{
emoji = e;
break;
}
}
return emoji->emote;
};
auto penguinEmoji = getEmoji("1F427");
assert(penguinEmoji.get() != nullptr);

std::vector<TestCase> tests{
{
Expand Down
16 changes: 16 additions & 0 deletions mocks/include/mocks/EmptyApplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,26 @@ class EmptyApplication : public IApplication
return nullptr;
}

ISoundController *getSound() override
{
assert(!"getSound was called without being initialized");
return nullptr;
}

ITwitchLiveController *getTwitchLiveController() override
{
return nullptr;
}

ImageUploader *getImageUploader() override
{
return nullptr;
}

SeventvAPI *getSeventvAPI() override
{
return nullptr;
}
};

} // namespace chatterino::mock
File renamed without changes
File renamed without changes
Loading

0 comments on commit 9503b39

Please sign in to comment.