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 Jun 1, 2024
2 parents a3ef8a1 + b6dc5d9 commit 15ce391
Show file tree
Hide file tree
Showing 65 changed files with 882 additions and 528 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Checks: "-*,
-readability-magic-numbers,
-performance-noexcept-move-constructor,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-cppcoreguidelines-non-private-member-variables-in-classes,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
Expand Down
56 changes: 15 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,22 @@ jobs:
include:
# Windows
- os: windows-latest
qt-version: 6.5.0
qt-version: 6.7.1
force-lto: false
plugins: true
skip-artifact: false
skip-crashpad: false
# macOS (ARM)
- os: macos-latest
qt-version: 6.5.0
qt-version: 6.7.1
arch: arm64
force-lto: false
plugins: true
skip-artifact: false
skip-crashpad: false
# macOS (x86)
- os: macos-13
qt-version: 6.5.0
qt-version: 6.7.1
arch: x86_64
force-lto: false
plugins: true
Expand All @@ -146,35 +146,15 @@ jobs:

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

- name: Install Qt 6.5.3 imageformats
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/[email protected]
with:
cache: false
modules: qtimageformats
set-env: false
version: 6.5.3
extra: --noarchives

- name: Find Qt 6.5.3 Path
if: startsWith(matrix.qt-version, '6.') && startsWith(matrix.os, 'windows')
shell: pwsh
id: find-good-imageformats
run: |
cd "$Env:RUNNER_WORKSPACE/Qt/6.5.3"
cd (Get-ChildItem)[0].Name
cd plugins/imageformats
echo "PLUGIN_PATH=$(pwd)" | Out-File -Path "$Env:GITHUB_OUTPUT" -Encoding ASCII
- name: Install Qt6
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down Expand Up @@ -269,12 +249,6 @@ jobs:
cp bin/chatterino.exe Chatterino2/
echo nightly > Chatterino2/modes
- name: Fix Qt6 (windows)
if: startsWith(matrix.qt-version, '6.') && startsWith(matrix.os, 'windows')
working-directory: build
run: |
cp ${{ steps.find-good-imageformats.outputs.PLUGIN_PATH }}/qwebp.dll Chatterino2/imageformats/qwebp.dll
- name: Package (windows)
if: startsWith(matrix.os, 'windows')
working-directory: build
Expand Down Expand Up @@ -363,15 +337,15 @@ jobs:

# Windows
- uses: actions/download-artifact@v4
name: Windows Qt6.5.0
name: Windows Qt6.7.1
with:
name: chatterino-windows-x86-64-Qt-6.5.0.zip
name: chatterino-windows-x86-64-Qt-6.7.1.zip
path: release-artifacts/

- uses: actions/download-artifact@v4
name: Windows Qt6.5.0 symbols
name: Windows Qt6.7.1 symbols
with:
name: chatterino-windows-x86-64-Qt-6.5.0-symbols.pdb.7z
name: chatterino-windows-x86-64-Qt-6.7.1-symbols.pdb.7z
path: release-artifacts/

# Linux
Expand All @@ -389,23 +363,23 @@ jobs:

# macOS
- uses: actions/download-artifact@v4
name: macOS x86_64 Qt6.5.0 x86 dmg
name: macOS x86_64 Qt6.7.1 x86 dmg
with:
name: chatterino-macos-Qt-6.5.0-x86_64.dmg
name: chatterino-macos-Qt-6.7.1-x86_64.dmg
path: release-artifacts/

- uses: actions/download-artifact@v4
name: macOS x86_64 Qt6.5.0 ARM dmg
name: macOS x86_64 Qt6.7.1 ARM dmg
with:
name: chatterino-macos-Qt-6.5.0-arm64.dmg
name: chatterino-macos-Qt-6.7.1-arm64.dmg
path: release-artifacts/

- name: Rename artifacts
run: |
ls -l
# Rename the macos build to indicate that it's for macOS 12.0 users
mv chatterino-macos-Qt-6.5.0-x86_64.dmg Chatterino-macOS-12.0-x86_64.dmg
mv chatterino-macos-Qt-6.5.0-arm64.dmg Chatterino-macOS-12.0-arm64.dmg
mv chatterino-macos-Qt-6.7.1-x86_64.dmg Chatterino-macOS-12.0-x86_64.dmg
mv chatterino-macos-Qt-6.7.1-arm64.dmg Chatterino-macOS-12.0-arm64.dmg
working-directory: release-artifacts
shell: bash

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- name: Install Qt6
if: startsWith(matrix.qt-version, '6.')
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/create-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
qt-version: [6.5.0]
qt-version: ["6.7.1"]
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -147,10 +147,10 @@ jobs:
mv Chatterino-x86_64-Qt-6.6.1.AppImage Chatterino-x86_64-Qt6.AppImage
mv chatterino-windows-x86-64-Qt-6.5.0-symbols.pdb.7z Chatterino-Windows-debug-symbols.pdb.7z
mv chatterino-windows-x86-64-Qt-6.7.1-symbols.pdb.7z Chatterino-Windows-debug-symbols.pdb.7z
mv chatterino-macos-Qt-6.5.0-x86_64.dmg Chatterino-x86_64.dmg
mv chatterino-macos-Qt-6.5.0-arm64.dmg Chatterino-arm64.dmg
mv chatterino-macos-Qt-6.7.1-x86_64.dmg Chatterino-x86_64.dmg
mv chatterino-macos-Qt-6.7.1-arm64.dmg Chatterino-arm64.dmg
- name: Hash files
working-directory: build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
fetch-depth: 0 # allows for tags access

- name: Install Qt
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
qt-version: [5.15.2, 6.5.0]
qt-version: [5.15.2, 6.7.1]
plugins: [false]
skip-artifact: [false]
skip-crashpad: [false]
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
fetch-depth: 0 # allows for tags access

- name: Install Qt
uses: jurplel/install-qt-action@v3.3.0
uses: jurplel/install-qt-action@v4.0.0
with:
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-v2
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@
- Minor: Add option to customise Moderation buttons with images. (#5369)
- Minor: Colored usernames now update on the fly when changing the "Color @usernames" setting. (#5300)
- Minor: Added `flags.action` filter variable, allowing you to filter on `/me` messages. (#5397)
- Minor: The size of the emote popup is now saved. (#5415)
- Minor: Added the ability to duplicate tabs. (#5277)
- Bugfix: Fixed tab move animation occasionally failing to start after closing a tab. (#5426)
- Bugfix: If a network request errors with 200 OK, Qt's error code is now reported instead of the HTTP status. (#5378)
- Bugfix: Fixed restricted users usernames not being clickable. (#5405)
- Bugfix: Fixed a crash that could occur when logging was enabled in IRC servers that were removed. (#5419)
- Dev: Update Windows build from Qt 6.5.0 to Qt 6.7.1. (#5420)
- Dev: Update vcpkg build Qt from 6.5.0 to 6.7.0, boost from 1.83.0 to 1.85.0, openssl from 3.1.3 to 3.3.0. (#5422)
- Dev: Use Qt's high DPI scaling. (#4868, #5400)
- Dev: Add doxygen build target. (#5377)
- Dev: Make printing of strings in tests easier. (#5379)
- Dev: Refactor and document `Scrollbar`. (#5334, #5393)
- Dev: Reduced the amount of scale events. (#5404)
- Dev: Refactor `TwitchIrcServer`, making it abstracted. (#5421)
- Dev: Reduced the amount of scale events. (#5404, #5406)
- Dev: Removed unused timegate settings. (#5361)
- Dev: All Lua globals now show in the `c2` global in the LuaLS metadata. (#5385)

## 2.5.1

Expand Down
58 changes: 29 additions & 29 deletions docs/plugin-meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ c2.EventType = {}

---@class CommandContext
---@field words string[] The words typed when executing the command. For example `/foo bar baz` will result in `{"/foo", "bar", "baz"}`.
---@field channel Channel The channel the command was executed in.
---@field channel c2.Channel The channel the command was executed in.

---@class CompletionList
---@field values string[] The completions
Expand All @@ -30,98 +30,98 @@ c2.EventType = {}

-- Begin src/common/Channel.hpp

---@alias ChannelType integer
---@type { None: ChannelType, Direct: ChannelType, Twitch: ChannelType, TwitchWhispers: ChannelType, TwitchWatching: ChannelType, TwitchMentions: ChannelType, TwitchLive: ChannelType, TwitchAutomod: ChannelType, TwitchEnd: ChannelType, Irc: ChannelType, Misc: ChannelType }
ChannelType = {}
---@alias c2.ChannelType integer
---@type { None: c2.ChannelType, Direct: c2.ChannelType, Twitch: c2.ChannelType, TwitchWhispers: c2.ChannelType, TwitchWatching: c2.ChannelType, TwitchMentions: c2.ChannelType, TwitchLive: c2.ChannelType, TwitchAutomod: c2.ChannelType, TwitchEnd: c2.ChannelType, Irc: c2.ChannelType, Misc: c2.ChannelType }
c2.ChannelType = {}

-- End src/common/Channel.hpp

-- Begin src/controllers/plugins/api/ChannelRef.hpp

---@alias Platform integer
---@alias c2.Platform integer
--- This enum describes a platform for the purpose of searching for a channel.
--- Currently only Twitch is supported because identifying IRC channels is tricky.
---@type { Twitch: Platform }
Platform = {}
---@type { Twitch: c2.Platform }
c2.Platform = {}

---@class Channel
Channel = {}
---@class c2.Channel
c2.Channel = {}

--- Returns true if the channel this object points to is valid.
--- If the object expired, returns false
--- If given a non-Channel object, it errors.
---
---@return boolean success
function Channel:is_valid() end
function c2.Channel:is_valid() end

--- Gets the channel's name. This is the lowercase login name.
---
---@return string name
function Channel:get_name() end
function c2.Channel:get_name() end

--- Gets the channel's type
---
---@return ChannelType
function Channel:get_type() end
---@return c2.ChannelType
function c2.Channel:get_type() end

--- Get the channel owner's display name. This may contain non-lowercase ascii characters.
---
---@return string name
function Channel:get_display_name() end
function c2.Channel:get_display_name() end

--- Sends a message to the target channel.
--- Note that this does not execute client-commands.
---
---@param message string
---@param execute_commands boolean Should commands be run on the text?
function Channel:send_message(message, execute_commands) end
function c2.Channel:send_message(message, execute_commands) end

--- Adds a system message client-side
---
---@param message string
function Channel:add_system_message(message) end
function c2.Channel:add_system_message(message) end

--- Returns true for twitch channels.
--- Compares the channel Type. Note that enum values aren't guaranteed, just
--- that they are equal to the exposed enum.
---
---@return boolean
function Channel:is_twitch_channel() end
function c2.Channel:is_twitch_channel() end

--- Returns a copy of the channel mode settings (subscriber only, r9k etc.)
---
---@return RoomModes
function Channel:get_room_modes() end
function c2.Channel:get_room_modes() end

--- Returns a copy of the stream status.
---
---@return StreamStatus
function Channel:get_stream_status() end
function c2.Channel:get_stream_status() end

--- Returns the Twitch user ID of the owner of the channel.
---
---@return string
function Channel:get_twitch_id() end
function c2.Channel:get_twitch_id() end

--- Returns true if the channel is a Twitch channel and the user owns it
---
---@return boolean
function Channel:is_broadcaster() end
function c2.Channel:is_broadcaster() end

--- Returns true if the channel is a Twitch channel and the user is a moderator in the channel
--- Returns false for broadcaster.
---
---@return boolean
function Channel:is_mod() end
function c2.Channel:is_mod() end

--- Returns true if the channel is a Twitch channel and the user is a VIP in the channel
--- Returns false for broadcaster.
---
---@return boolean
function Channel:is_vip() end
function c2.Channel:is_vip() end

---@return string
function Channel:__tostring() end
function c2.Channel:__tostring() end

--- Finds a channel by name.
--- Misc channels are marked as Twitch:
Expand All @@ -132,15 +132,15 @@ function Channel:__tostring() end
--- - /automod
---
---@param name string Which channel are you looking for?
---@param platform Platform Where to search for the channel?
---@return Channel?
function Channel.by_name(name, platform) end
---@param platform c2.Platform Where to search for the channel?
---@return c2.Channel?
function c2.Channel.by_name(name, platform) end

--- Finds a channel by the Twitch user ID of its owner.
---
---@param id string ID of the owner of the channel.
---@return Channel?
function Channel.by_twitch_id(id) end
---@return c2.Channel?
function c2.Channel.by_twitch_id(id) end

---@class RoomModes
---@field unique_chat boolean You might know this as r9kbeta or robot9000.
Expand Down
2 changes: 1 addition & 1 deletion lib/settings
7 changes: 7 additions & 0 deletions mocks/include/mocks/EmptyApplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ class EmptyApplication : public IApplication
return nullptr;
}

IAbstractIrcServer *getTwitchAbstract() override
{
assert(false && "EmptyApplication::getTwitchAbstract was called "
"without being initialized");
return nullptr;
}

PubSub *getTwitchPubSub() override
{
assert(false && "getTwitchPubSub was called without being initialized");
Expand Down
Loading

0 comments on commit 15ce391

Please sign in to comment.