Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'SevenTV:chatterino7' into chatterino7
Browse files Browse the repository at this point in the history
  • Loading branch information
D3XX3R authored Oct 31, 2021
2 parents f55243a + 8786c24 commit 96ec540
Show file tree
Hide file tree
Showing 74 changed files with 652 additions and 361 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ task:
git submodule update
mkdir build
cd build
qmake RAPIDJSON_SYSTEM=1 QMAKE_CC="cc" QMAKE_CXX="c++" QMAKE_LINK_C="cc" QMAKE_LINK_C_SHLIB="cc" QMAKE_LINK="c++" QMAKE_LINK_SHLIB="c++" QMAKE_CFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " QMAKE_CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " QMAKE_LFLAGS="-fstack-protector-strong" QMAKE_LIBS="" QMAKE_CFLAGS_DEBUG="" QMAKE_CFLAGS_RELEASE="" QMAKE_CXXFLAGS_DEBUG="" QMAKE_CXXFLAGS_RELEASE="" PREFIX="/usr/local" CONFIG+="release" CONFIG-="debug separate_debug_info" -recursive ..
qmake-qt5 RAPIDJSON_SYSTEM=1 QMAKE_CC="cc" QMAKE_CXX="c++" QMAKE_LINK_C="cc" QMAKE_LINK_C_SHLIB="cc" QMAKE_LINK="c++" QMAKE_LINK_SHLIB="c++" QMAKE_CFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " QMAKE_CXXFLAGS="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing " QMAKE_LFLAGS="-fstack-protector-strong" QMAKE_LIBS="" QMAKE_CFLAGS_DEBUG="" QMAKE_CFLAGS_RELEASE="" QMAKE_CXXFLAGS_DEBUG="" QMAKE_CXXFLAGS_RELEASE="" PREFIX="/usr/local" CONFIG+="release" CONFIG-="debug separate_debug_info" -recursive ..
make -j $(getconf _NPROCESSORS_ONLN)
19 changes: 16 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@ jobs:
os: [windows-latest, ubuntu-latest, macos-latest]
qt-version: [5.15.2, 5.12.10]
build-system: [qmake, cmake]
pch: [true]
exclude:
- os: windows-latest
qt-version: 5.12.10
build-system: cmake
pch: true
include:
- os: windows-2016
qt-version: 5.12.10
build-system: cmake
pch: true
- os: ubuntu-latest
qt-version: 5.15.2
build-system: cmake
pch: false
fail-fast: false

steps:
Expand All @@ -38,7 +45,7 @@ jobs:
echo "vs_version=2017" >> $GITHUB_ENV
shell: bash

- uses: actions/[email protected].4
- uses: actions/[email protected].5
with:
submodules: true
fetch-depth: 0 # allows for tags access
Expand Down Expand Up @@ -82,7 +89,7 @@ jobs:
- name: Enable Developer Command Prompt
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1.9.0
uses: ilammy/msvc-dev-cmd@v1.10.0

- name: Build (Windows)
if: startsWith(matrix.os, 'windows') && matrix.build-system == 'qmake'
Expand Down Expand Up @@ -158,7 +165,12 @@ jobs:
run: |
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=appdir/usr/ -DCMAKE_BUILD_TYPE=Release -DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On ..
cmake \
-DCMAKE_INSTALL_PREFIX=appdir/usr/ \
-DCMAKE_BUILD_TYPE=Release \
-DPAJLADA_SETTINGS_USE_BOOST_FILESYSTEM=On \
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
..
make -j8
shell: bash

Expand Down Expand Up @@ -214,6 +226,7 @@ jobs:
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DOPENSSL_ROOT_DIR=/usr/local/opt/openssl \
-DUSE_PRECOMPILED_HEADERS=${{ matrix.pch }} \
..
make -j8
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v2.3.5

# Gives an error if there's no change in the changelog (except using label)
- name: Changelog check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/[email protected].4
- uses: actions/[email protected].5

- name: apt-get update
run: sudo apt-get update
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Publish Homebrew Cask on Release'
on:
push:
tags:
# Should match semver for mainline releases (not including -beta)
- 'v2.[0-9]+.[0-9]+'
# TODO: handle beta and nightly releases
# Need to make those casks manually first
# - v2.[0-9]+.[0-9]+-beta(?:[0-9]+)

env:
# This gets updated later on in the run by a bash script to strip the prefix
C2_CASK_NAME: 'chatterino'
C2_TAGGED_VERSION: '${{ github.ref }}'

jobs:
update_stable_homebrew_cask:
name: 'Update the stable homebrew cask'
runs-on: 'macos-latest'
steps:
# Pulls out the version from the ref (e.g. refs/tags/v2.3.1 -> 2.3.1)
- name: 'Extract version from tag'
run: |
'STRIPPED_VERSION=$("refs/tags/$(C2_TAGGED_VERSION)" | sed "s/refs\/tags\/v//gm")'
'echo "C2_TAGGED_VERSION=$(STRIPPED_VERSION)" >> $GITHUB_ENV'
- name: 'Execute ''brew bump-cask-pr'' with version'
run: 'brew bump-cask-pr --version $(C2_TAGGED_VERSION) $(C2_CASK_NAME)'

2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected].4
- uses: actions/[email protected].5

- name: Lint Markdown files
uses: actionsx/prettier@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false

steps:
- uses: actions/[email protected].4
- uses: actions/[email protected].5
with:
submodules: recursive

Expand Down
2 changes: 1 addition & 1 deletion BUILDING_ON_WINDOWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Notes:
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 `Qt Creator X.X.X CDB Debugger Support` are selected. (they should be checked by default)
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.

Note: This installation will take about 2 GB of disk space.
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,31 @@

## Unversioned

- Minor: Added new search predicate to filter for messages matching a regex (#3282)
- Minor: Add `{channel.name}`, `{channel.id}`, `{stream.game}`, `{stream.title}`, `{my.id}`, `{my.name}` placeholders for commands (#3155)
- Minor: Remove TwitchEmotes.com attribution and the open/copy options when right-clicking a Twitch Emote. (#2214, #3136)
- Minor: Strip leading @ and trailing , from username in /user and /usercard commands. (#3143)
- Minor: Display a system message when reloading subscription emotes to match BTTV/FFZ behavior (#3135)
- Minor: Allow resub messages to show in `/mentions` tab (#3148)
- Minor: Added a setting to hide similar messages by any user. (#2716)
- Minor: Duplicate spaces now count towards the display message length. (#3002)
- Minor: Commands are now backed up. (#3168)
- Minor: Subcategories in settings are now searchable. (#3157)
- Minor: Added the ability to open an entire tab as a popup. (#3082)
- Minor: Added optional parameter to /usercard command for opening a usercard in a different channel context. (#3172)
- Minor: Added regex option to Nicknames. (#3146)
- Minor: Highlight usernames in /mods and /vips messages (#3187)
- Minor: Added `/raw` command. (#3189)
- Minor: Colorizing usernames on IRC, originally made for Mm2PL/dankerino (#3206)
- Minor: Fixed `/streamlink` command not stripping leading @'s or #'s (#3215)
- Minor: Strip leading @ and trailing , from username in `/popout` command. (#3217)
- Minor: Added `flags.reward_message` filter variable (#3231)
- Minor: Added chatter count to viewer list popout (#3261)
- Minor: Added highlights for first messages (#3267)
- Minor: Ignore out of bounds check for tiling wms (#3270)
- Minor: Added `flags.first_message` filter variable (#3292)
- Minor: Removed duplicate setting for toggling `Channel Point Redeemed Message` highlights (#3296)
- Minor: Clean up chat messages of special line characters prior to sending. (#3312)
- Bugfix: Fixed colored usernames sometimes not working. (#3170)
- Bugfix: Restored ability to send duplicate `/me` messages. (#3166)
- Bugfix: Notifications for moderators about other moderators deleting messages can now be disabled. (#3121)
Expand All @@ -22,6 +35,16 @@
- Bugfix: Allow starting Streamlink from Chatterino when running as a Flatpak. (#3178)
- Bugfix: Fixed own IRC messages not having metadata and a link to a usercard. (#3203)
- Bugfix: Fixed some channels still not loading in rare cases. (#3219)
- Bugfix: Fixed a bug with usernames or emotes completing from the wrong position. (#3229)
- Bugfix: Fixed a bug that caused zero-width emotes to be misaligned when the "Remove spaces between emotes" setting is on. (#3249)
- Bugfix: Fixed second chatterino icon appearing in the dock when restarting on a crash in macOS. (#3268)
- Bugfix: Fixed the "Change channel" popup showing a wrong window title (#3273)
- Bugfix: Fixed built-in Chatterino commands not working in whispers and mentions special channels (#3288)
- Bugfix: Fixed `QCharRef with an index pointing outside the valid range of a QString` warning that was emitted on every Tab press. (#3234)
- Bugfix: Fixed being unable to disable `First Message` highlights (#3293)
- Bugfix: Fixed `First Message` custom sound not persisting through restart. (#3303)
- Bugfix: Fixed `First Message` scrollbar highlights not being disabled. (#3325)
- Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327)
- Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103)
- Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038)

Expand Down
5 changes: 1 addition & 4 deletions chatterino.pro
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ SOURCES += \
src/controllers/notifications/NotificationController.cpp \
src/controllers/notifications/NotificationModel.cpp \
src/controllers/pings/MutedChannelModel.cpp \
src/controllers/taggedusers/TaggedUser.cpp \
src/controllers/taggedusers/TaggedUsersModel.cpp \
src/debug/Benchmark.cpp \
src/main.cpp \
src/messages/Emote.cpp \
Expand All @@ -187,6 +185,7 @@ SOURCES += \
src/messages/search/ChannelPredicate.cpp \
src/messages/search/LinkPredicate.cpp \
src/messages/search/MessageFlagsPredicate.cpp \
src/messages/search/RegexPredicate.cpp \
src/messages/search/SubstringPredicate.cpp \
src/messages/SharedMessageBuilder.cpp \
src/providers/bttv/BttvEmotes.cpp \
Expand Down Expand Up @@ -403,8 +402,6 @@ HEADERS += \
src/controllers/notifications/NotificationController.hpp \
src/controllers/notifications/NotificationModel.hpp \
src/controllers/pings/MutedChannelModel.hpp \
src/controllers/taggedusers/TaggedUser.hpp \
src/controllers/taggedusers/TaggedUsersModel.hpp \
src/debug/AssertInGuiThread.hpp \
src/debug/Benchmark.hpp \
src/ForwardDecl.hpp \
Expand Down
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ set(SOURCE_FILES
controllers/pings/MutedChannelModel.cpp
controllers/pings/MutedChannelModel.hpp

controllers/taggedusers/TaggedUser.cpp
controllers/taggedusers/TaggedUser.hpp
controllers/taggedusers/TaggedUsersModel.cpp
controllers/taggedusers/TaggedUsersModel.hpp

debug/Benchmark.cpp
debug/Benchmark.hpp

Expand Down Expand Up @@ -154,6 +149,8 @@ set(SOURCE_FILES
messages/search/LinkPredicate.hpp
messages/search/MessageFlagsPredicate.cpp
messages/search/MessageFlagsPredicate.hpp
messages/search/RegexPredicate.cpp
messages/search/RegexPredicate.hpp
messages/search/SubstringPredicate.cpp
messages/search/SubstringPredicate.hpp

Expand Down Expand Up @@ -564,7 +561,10 @@ if (BUILD_APP)
endif ()

if (USE_PRECOMPILED_HEADERS)
message(STATUS "Building with precompiled headers")
target_precompile_headers(${LIBRARY_PROJECT} PRIVATE PrecompiledHeader.hpp)
else ()
message(STATUS "Building without precompiled headers")
endif ()

# Enable autogeneration of Qts MOC/RCC/UIC
Expand Down
27 changes: 26 additions & 1 deletion src/RunGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
# include <QBreakpadHandler.h>
#endif

#ifdef Q_OS_MAC
# include "corefoundation/CFBundle.h"
#endif

namespace chatterino {
namespace {
void installCustomPalette()
Expand Down Expand Up @@ -122,15 +126,36 @@ namespace {
std::chrono::steady_clock::now() - signalsInitTime > 30s)
{
QProcess proc;

#ifdef Q_OS_MAC
// On macOS, programs are bundled into ".app" Application bundles,
// when restarting Chatterino that bundle should be opened with the "open"
// terminal command instead of directly starting the underlying executable,
// as those are 2 different things for the OS and i.e. do not use
// the same dock icon (resulting in a second Chatterino icon on restarting)
CFURLRef appUrlRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFStringRef macPath =
CFURLCopyFileSystemPath(appUrlRef, kCFURLPOSIXPathStyle);
const char *pathPtr =
CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding());

proc.setProgram("open");
proc.setArguments({pathPtr, "-n", "--args", "--crash-recovery"});

CFRelease(appUrlRef);
CFRelease(macPath);
#else
proc.setProgram(QApplication::applicationFilePath());
proc.setArguments({"--crash-recovery"});
#endif

proc.startDetached();
}

_exit(signum);
}

// We want to restart chatterino when it crashes and the setting is set to
// We want to restart Chatterino when it crashes and the setting is set to
// true.
void initSignalHandler()
{
Expand Down
3 changes: 2 additions & 1 deletion src/common/Args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QDebug>
#include <QRegularExpression>
#include <QStringList>
#include <QUuid>

Expand Down Expand Up @@ -48,7 +49,7 @@ Args::Args(const QApplication &app)
parser.addOption(QCommandLineOption(
{"c", "channels"},
"Joins only supplied channels on startup. Use letters with colons to "
"specify platform. Only twitch channels are supported at the moment.\n"
"specify platform. Only Twitch channels are supported at the moment.\n"
"If platform isn't specified, default is Twitch.",
"t:channel1;t:channel2;..."));

Expand Down
1 change: 1 addition & 0 deletions src/common/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <QWidget>
#include <boost/optional.hpp>
#include <boost/preprocessor.hpp>
#include <memory>
#include <string>

#include "common/Aliases.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/common/WindowDescriptors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace chatterino {
enum class WindowType;

struct SplitDescriptor {
// twitch or mentions or watching or whispers or irc
// Twitch or mentions or watching or whispers or IRC
QString type_;

// Twitch Channel name or IRC channel name
Expand Down
Loading

0 comments on commit 96ec540

Please sign in to comment.