Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Chatterino/chatterino2 into chatt…
Browse files Browse the repository at this point in the history
…erino7
  • Loading branch information
AnatoleAM committed Mar 7, 2022
2 parents 33a8bd4 + 778afc2 commit 530dcc3
Show file tree
Hide file tree
Showing 38 changed files with 619 additions and 541 deletions.
55 changes: 33 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
- name: Set environment variables for windows-latest
if: matrix.os == 'windows-latest'
run: |
echo "vs_version=2019" >> $GITHUB_ENV
echo "vs_version=2022" >> $GITHUB_ENV
shell: bash

- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0 # allows for tags access
Expand All @@ -39,8 +39,8 @@ jobs:
id: cache-qt
uses: actions/cache@v2.1.7
with:
path: ../Qt
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-20210109
path: "${{ github.workspace }}/qt/"
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}

# LINUX
- name: Install p7zip (Ubuntu)
Expand All @@ -50,17 +50,23 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
aqtversion: '==1.1.1'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
extra: --external 7z
version: ${{ matrix.qt-version }}
dir: "${{ github.workspace }}/qt/"

# WINDOWS
- name: Cache conan packages
- name: Cache conan packages part 1
if: startsWith(matrix.os, 'windows')
uses: actions/cache@v2.1.7
with:
key: ${{ runner.os }}-conan-${{ hashFiles('**/conanfile.txt') }}-20210412
key: ${{ runner.os }}-conan-user-${{ hashFiles('**/conanfile.txt') }}
path: ~/.conan/

- name: Cache conan packages part 2
if: startsWith(matrix.os, 'windows')
uses: actions/cache@v2.1.7
with:
key: ${{ runner.os }}-conan-root-${{ hashFiles('**/conanfile.txt') }}
path: C:/.conan/

- name: Add Conan to path
Expand All @@ -81,7 +87,7 @@ jobs:
run: |
mkdir build
cd build
conan install ..
conan install .. -b missing
qmake ..
set cl=/MP
nmake /S /NOLOGO
Expand All @@ -95,7 +101,7 @@ jobs:
run: |
mkdir build
cd build
conan install ..
conan install .. -b missing
cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DUSE_CONAN=ON ..
set cl=/MP
nmake /S /NOLOGO
Expand All @@ -106,11 +112,16 @@ jobs:
- name: Upload artifact (Windows)
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v2.3.1
uses: actions/upload-artifact@v3
with:
name: chatterino-windows-x86-64-${{ matrix.qt-version }}-${{ matrix.build-system }}.zip
path: build/chatterino-windows-x86-64.zip

- name: Clean Conan pkgs
if: startsWith(matrix.os, 'windows')
run: conan remove "*" -fsb
shell: bash

# LINUX
- name: Install dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
Expand Down Expand Up @@ -175,14 +186,14 @@ jobs:

- name: Upload artifact - AppImage (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v2.3.1
uses: actions/upload-artifact@v3
with:
name: Chatterino-x86_64-${{ matrix.qt-version }}-${{ matrix.build-system }}.AppImage
path: build/Chatterino-x86_64.AppImage

- name: Upload artifact - .deb (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v2.3.1
uses: actions/upload-artifact@v3
with:
name: Chatterino-${{ matrix.qt-version }}-${{ matrix.build-system }}.deb
path: build/Chatterino.deb
Expand Down Expand Up @@ -228,7 +239,7 @@ jobs:

- name: Upload artifact (MacOS)
if: startsWith(matrix.os, 'macos')
uses: actions/upload-artifact@v2.3.1
uses: actions/upload-artifact@v3
with:
name: chatterino-osx-${{ matrix.qt-version }}-${{ matrix.build-system }}.dmg
path: build/chatterino-osx.dmg
Expand All @@ -252,42 +263,42 @@ jobs:
Nightly Build
prerelease: true

- uses: actions/download-artifact@v2.1.0
- uses: actions/download-artifact@v3
with:
name: chatterino-windows-x86-64-5.15.2-qmake.zip
path: windows/

- uses: actions/download-artifact@v2.1.0
- uses: actions/download-artifact@v3
with:
name: chatterino-windows-x86-64-5.15.2-cmake.zip
path: windows-cmake/

- uses: actions/download-artifact@v2.1.0
- uses: actions/download-artifact@v3
with:
name: Chatterino-x86_64-5.15.2-qmake.AppImage
path: linux/

- uses: actions/download-artifact@v2.1.0
- uses: actions/download-artifact@v3
with:
name: Chatterino-x86_64-5.15.2-cmake.AppImage
path: linux-cmake/

- uses: actions/download-artifact@v2.1.0
- uses: actions/download-artifact@v3
with:
name: Chatterino-5.15.2-qmake.deb
path: ubuntu/

- uses: actions/download-artifact@v2.1.0
- uses: actions/download-artifact@v3
with:
name: Chatterino-5.15.2-cmake.deb
path: ubuntu-cmake/

- uses: actions/download-artifact@v2.1.0
- uses: actions/download-artifact@v3
with:
name: chatterino-osx-5.15.2-qmake.dmg
path: macos/

- uses: actions/download-artifact@v2.1.0
- uses: actions/download-artifact@v3
with:
name: chatterino-osx-5.15.2-cmake.dmg
path: macos-cmake/
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/checkout@v2.4.0
- uses: actions/checkout@v3

- name: apt-get update
run: sudo apt-get update
Expand Down
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/checkout@v2.4.0
- uses: actions/checkout@v3

- 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/checkout@v2.4.0
- uses: actions/checkout@v3
with:
submodules: recursive

Expand Down
4 changes: 2 additions & 2 deletions BUILDING_ON_LINUX.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Note on Qt version compatibility: If you are installing Qt from a package manager, please ensure the version you are installing is at least **Qt 5.12 or newer**.

## Ubuntu 18.04
## Ubuntu 20.04

_Most likely works the same for other Debian-like distros_

Expand Down Expand Up @@ -35,7 +35,7 @@ _Most likely works the same for other Debian-like distros_

### Manually

1. Install all of the dependencies using `sudo pacman -S qt5-base qt5-multimedia qt5-imageformats qt5-svg qt5-tools gst-plugins-ugly gst-plugins-good boost rapidjson pkgconf openssl cmake`
1. 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`
1. Go into the project directory
1. Create a build folder and go into it (`mkdir build && cd build`)
1. Use one of the options below to compile it
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,18 @@
- Minor: Messages can now be highlighted by subscriber or founder badges. (#3445)
- Minor: User timeout buttons can now be triggered using hotkeys. (#3483)
- Minor: Add workaround for multipart emoji as described in [the RFC](https://mm2pl.github.io/emoji_rfc.pdf). (#3469)
- Minor: Added a way to open channel popup by right-clicking the avatar in a usercard. (#3486)
- Minor: Add feedback when using the whisper command `/w` incorrectly. (#3439)
- Minor: Add feedback when writing a non-command message in the `/whispers` split. (#3439)
- Minor: Opening streamlink through hotkeys and/or split header menu matches `/streamlink` command and shows feedback in chat as well. (#3510)
- Minor: Removed timestamp from AutoMod messages. (#3503)
- Minor: Added ability to copy message ID with `Shift + Right Click`. (#3481)
- Minor: Added /popup command to open currently focused split or supplied channel in a new window. (#3529)
- Minor: Colorize the entire split header when focused. (#3379)
- Minor: Added incremental search to channel search. (#3544)
- Minor: Show right click context menu anywhere within a message's line. (#3566)
- Minor: Make Tab Layout setting only accept predefined values (#3564)
- Minor: Added librewolf, icecat, and waterfox incognito support. (#3588)
- Bugfix: Fix Split Input hotkeys not being available when input is hidden (#3362)
- Bugfix: Fixed colored usernames sometimes not working. (#3170)
- Bugfix: Restored ability to send duplicate `/me` messages. (#3166)
Expand Down Expand Up @@ -95,6 +101,7 @@
- Bugfix: Usercards no longer close when the originating window (e.g. a search popup) is closed. (#3518)
- Bugfix: Disabled /popout and /streamlink from working in non-twitch channels (e.g. /whispers) when supplied no arguments. (#3541)
- Bugfix: Fixed automod and unban messages showing when moderation actions were disabled (#3548)
- Bugfix: Fixed crash when rendering a highlight inside of a sub message, with sub message highlights themselves turned off. (#3556)
- Dev: Batch checking live status for channels with live notifications that aren't connected. (#3442)
- 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)
Expand Down
2 changes: 0 additions & 2 deletions chatterino.pro
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ SOURCES += \
src/providers/seventv/SeventvEmotes.cpp \
src/providers/seventv/SeventvWebSocket.cpp \
src/providers/twitch/api/Helix.cpp \
src/providers/twitch/api/Kraken.cpp \
src/providers/twitch/ChannelPointReward.cpp \
src/providers/twitch/IrcMessageHandler.cpp \
src/providers/twitch/PubsubActions.cpp \
Expand Down Expand Up @@ -461,7 +460,6 @@ HEADERS += \
src/providers/seventv/SeventvEmotes.hpp \
src/providers/seventv/SeventvWebSocket.hpp \
src/providers/twitch/api/Helix.hpp \
src/providers/twitch/api/Kraken.hpp \
src/providers/twitch/ChannelPointReward.hpp \
src/providers/twitch/ChatterinoWebSocketppLogger.hpp \
src/providers/twitch/EmoteValue.hpp \
Expand Down
4 changes: 2 additions & 2 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[requires]
openssl/1.1.1k
boost/1.76.0
openssl/1.1.1m
boost/1.78.0

[generators]
qmake
Expand Down
Binary file added resources/avatars/karlpolice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ALazyMeme | https://github.com/alazymeme | :/avatars/alazymeme.png | Contributor
xHeaveny_ | https://github.com/xHeaveny | :/avatars/xheaveny.png | Contributor
1xelerate | https://github.com/1xelerate | :/avatars/_1xelerate.png | Contributor
acdvs | https://github.com/acdvs | | Contributor
karl-police | https://github.com/karl-police | :/avatars/karlpolice.png | Contributor

# If you are a contributor add yourself above this line

Expand Down
1 change: 1 addition & 0 deletions resources/resources_autogenerated.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<file>avatars/alazymeme.png</file>
<file>avatars/fourtf.png</file>
<file>avatars/kararty.png</file>
<file>avatars/karlpolice.png</file>
<file>avatars/matthewde.jpg</file>
<file>avatars/mm2pl.png</file>
<file>avatars/pajlada.png</file>
Expand Down
2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ set(SOURCE_FILES

providers/twitch/api/Helix.cpp
providers/twitch/api/Helix.hpp
providers/twitch/api/Kraken.cpp
providers/twitch/api/Kraken.hpp

singletons/Badges.cpp
singletons/Badges.hpp
Expand Down
1 change: 1 addition & 0 deletions src/autogenerated/ResourcesAutogen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Resources2::Resources2()
this->avatars.alazymeme = QPixmap(":/avatars/alazymeme.png");
this->avatars.fourtf = QPixmap(":/avatars/fourtf.png");
this->avatars.kararty = QPixmap(":/avatars/kararty.png");
this->avatars.karlpolice = QPixmap(":/avatars/karl-police.png");
this->avatars.mm2pl = QPixmap(":/avatars/mm2pl.png");
this->avatars.pajlada = QPixmap(":/avatars/pajlada.png");
this->avatars.slch = QPixmap(":/avatars/slch.png");
Expand Down
1 change: 1 addition & 0 deletions src/autogenerated/ResourcesAutogen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class Resources2 : public Singleton
QPixmap alazymeme;
QPixmap fourtf;
QPixmap kararty;
QPixmap karlpolice;
QPixmap mm2pl;
QPixmap pajlada;
QPixmap slch;
Expand Down
71 changes: 45 additions & 26 deletions src/controllers/commands/CommandController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,6 @@
namespace {
using namespace chatterino;

// stripUserName removes any @ prefix or , suffix to make it more suitable for command use
void stripUserName(QString &userName)
{
if (userName.startsWith('@'))
{
userName.remove(0, 1);
}
if (userName.endsWith(','))
{
userName.chop(1);
}
}

// stripChannelName removes any @ prefix or , suffix to make it more suitable for command use
void stripChannelName(QString &channelName)
{
if (channelName.startsWith('@') || channelName.startsWith('#'))
{
channelName.remove(0, 1);
}
if (channelName.endsWith(','))
{
channelName.chop(1);
}
}

void sendWhisperMessage(const QString &text)
{
// (hemirt) pajlada: "we should not be sending whispers through jtv, but
Expand Down Expand Up @@ -711,6 +685,51 @@ void CommandController::initialize(Settings &, Paths &paths)
return "";
});

this->registerCommand("/popup", [](const QStringList &words,
ChannelPtr channel) {
static const auto *usageMessage =
"Usage: /popup [channel]. Open specified Twitch channel in "
"a new window. If no channel argument is specified, open "
"the currently selected split instead.";

QString target(words.value(1));
stripChannelName(target);

if (target.isEmpty())
{
auto *currentPage =
dynamic_cast<SplitContainer *>(getApp()
->windows->getMainWindow()
.getNotebook()
.getSelectedPage());
if (currentPage != nullptr)
{
auto *currentSplit = currentPage->getSelectedSplit();
if (currentSplit != nullptr)
{
currentSplit->popup();

return "";
}
}

channel->addMessage(makeSystemMessage(usageMessage));
return "";
}

auto *app = getApp();
Window &window = app->windows->createWindow(WindowType::Popup, true);

auto *split = new Split(static_cast<SplitContainer *>(
window.getNotebook().getOrAddSelectedPage()));

split->setChannel(app->twitch.server->getOrAddChannel(target));

window.getNotebook().getOrAddSelectedPage()->appendSplit(split);

return "";
});

this->registerCommand("/clearmessages", [](const auto & /*words*/,
ChannelPtr channel) {
auto *currentPage = dynamic_cast<SplitContainer *>(
Expand Down
Loading

0 comments on commit 530dcc3

Please sign in to comment.