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

Commit

Permalink
Merge remote-tracking branch 'origin/master' into chatterino7
Browse files Browse the repository at this point in the history
Now we're on commit 3fcb634; Changes from upstream we've pulled

- Bugfix: Fix Split Input hotkeys not being available when input is hidden (Chatterino#3362)
- Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (Chatterino#3368)
  • Loading branch information
zneix committed Nov 28, 2021
2 parents d8bc1af + 3fcb634 commit a4ae09f
Show file tree
Hide file tree
Showing 22 changed files with 118 additions and 95 deletions.
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/a_make_a_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Issue report
description: Report something that's missing, that you have trouble with or that stopped working
labels: [issue-report]

body:
- type: checkboxes
id: acknowledgments
attributes:
label: Checklist
description:
options:
- label: I'm reporting a problem with Chatterino
required: true
- label: I've verified that I'm running a recent nightly build or the *newest* stable release
required: true
- label: I've looked for my problem on the [wiki](https://wiki.chatterino.com/Help/)
required: true
- label: I've searched the [issues](https://github.com/Chatterino/chatterino2/issues?q=) for similar looking reports
required: true

- type: textarea
id: description
validations:
required: true
attributes:
label: Describe your issue
description: |
Write a brief description of your issue.
Important:
Focus on the problem instead of a concrete solution. This ensures that the focus of the thread is to resolve your issue.
If you want to voice a concrete idea you can add a comment below after posting the issue.
placeholder: |
Examples:
- I cannot do X.
- I have trouble doing X.
- Feature X has stopped working for me.
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: While optional, it's highly encouraged to include screenshots or videos to illustrate what you mean.
placeholder: You can upload them using the text editor's dedicated button.

- type: input
id: versions
validations:
required: true
attributes:
label: OS and Chatterino Version
description: The name of your Operating System and the version shown in Chatterino's title bar.
placeholder: Chatterino 2.3.4 on Windows 10 (insiders)

48 changes: 0 additions & 48 deletions .github/ISSUE_TEMPLATE/a_report_your_issue.md

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Cache Qt
id: cache-qt
uses: actions/cache@v2.1.6
uses: actions/cache@v2.1.7
with:
path: ../Qt
key: ${{ runner.os }}-QtCache-${{ matrix.qt-version }}-20210109
Expand All @@ -73,7 +73,7 @@ jobs:
# WINDOWS
- name: Cache conan packages
if: startsWith(matrix.os, 'windows')
uses: actions/cache@v2.1.6
uses: actions/cache@v2.1.7
with:
key: ${{ runner.os }}-conan-${{ hashFiles('**/conanfile.txt') }}-20210412
path: C:/.conan/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Cache Qt
id: cache-qt
uses: actions/cache@v2.1.6
uses: actions/cache@v2.1.7
with:
path: ../Qt
key: ${{ runner.os }}-QtCache-20201005
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
- Minor: Made join and part message have links to usercards. (#3358)
- Minor: Show picked outcome in prediction badges. (#3357)
- Minor: Add support for Emoji in IRC (#3354)
- 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)
- Bugfix: Notifications for moderators about other moderators deleting messages can now be disabled. (#3121)
Expand All @@ -60,6 +61,7 @@
- Bugfix: Fixed splits losing filters when closing and reopening them (#3351)
- Bugfix: Fixed the first usercard being broken in `/mods` and `/vips` (#3349)
- Bugfix: Fixed Chatterino attempting to send empty messages (#3355)
- Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368)
- 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
6 changes: 3 additions & 3 deletions src/common/ChannelChatters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ void ChannelChatters::addPartedUser(const QString &user)
}

void ChannelChatters::updateOnlineChatters(
const std::unordered_set<QString> &chatters)
const std::unordered_set<QString> &usernames)
{
auto chatters_ = this->chatters_.access();
chatters_->updateOnlineChatters(chatters);
auto chatters = this->chatters_.access();
chatters->updateOnlineChatters(usernames);
}

size_t ChannelChatters::colorsSize() const
Expand Down
2 changes: 1 addition & 1 deletion src/common/ChannelChatters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ChannelChatters
void addPartedUser(const QString &user);
const QColor getUserColor(const QString &user);
void setUserColor(const QString &user, const QColor &color);
void updateOnlineChatters(const std::unordered_set<QString> &chatters);
void updateOnlineChatters(const std::unordered_set<QString> &usernames);

// colorsSize returns the amount of colors stored in `chatterColors_`
// NOTE: This function is only meant to be used in tests and benchmarks
Expand Down
37 changes: 19 additions & 18 deletions src/common/DownloadManager.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#include "DownloadManager.hpp"

#include "common/QLogging.hpp"
#include "singletons/Paths.hpp"

#include <QDesktopServices>
#include "common/QLogging.hpp"

namespace chatterino {

DownloadManager::DownloadManager(QObject *parent)
: QObject(parent)
, manager_(new QNetworkAccessManager)
{
manager = new QNetworkAccessManager;
}

DownloadManager::~DownloadManager()
{
manager->deleteLater();
this->manager_->deleteLater();
}

void DownloadManager::setFile(QString fileURL, const QString &channelName)
Expand All @@ -25,18 +25,18 @@ void DownloadManager::setFile(QString fileURL, const QString &channelName)
getPaths()->twitchProfileAvatars + "/twitch/" + channelName + ".png";
QNetworkRequest request;
request.setUrl(QUrl(fileURL));
reply = manager->get(request);
this->reply_ = this->manager_->get(request);

file = new QFile;
file->setFileName(saveFilePath);
file->open(QIODevice::WriteOnly);
this->file_ = new QFile;
this->file_->setFileName(saveFilePath);
this->file_->open(QIODevice::WriteOnly);

connect(reply, SIGNAL(downloadProgress(qint64, qint64)), this,
connect(this->reply_, SIGNAL(downloadProgress(qint64, qint64)), this,
SLOT(onDownloadProgress(qint64, qint64)));
connect(manager, SIGNAL(finished(QNetworkReply *)), this,
connect(this->manager_, SIGNAL(finished(QNetworkReply *)), this,
SLOT(onFinished(QNetworkReply *)));
connect(reply, SIGNAL(readyRead()), this, SLOT(onReadyRead()));
connect(reply, SIGNAL(finished()), this, SLOT(onReplyFinished()));
connect(this->reply_, SIGNAL(readyRead()), this, SLOT(onReadyRead()));
connect(this->reply_, SIGNAL(finished()), this, SLOT(onReplyFinished()));
}

void DownloadManager::onDownloadProgress(qint64 bytesRead, qint64 bytesTotal)
Expand All @@ -58,25 +58,26 @@ void DownloadManager::onFinished(QNetworkReply *reply)
};
}

if (file->isOpen())
if (this->file_->isOpen())
{
file->close();
file->deleteLater();
this->file_->close();
this->file_->deleteLater();
}
emit downloadComplete();
}

void DownloadManager::onReadyRead()
{
file->write(reply->readAll());
this->file_->write(this->reply_->readAll());
}

void DownloadManager::onReplyFinished()
{
if (file->isOpen())
if (this->file_->isOpen())
{
file->close();
file->deleteLater();
this->file_->close();
this->file_->deleteLater();
}
}

} // namespace chatterino
9 changes: 4 additions & 5 deletions src/common/DownloadManager.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#pragma once

#include "Application.hpp"

#include <QFile>
#include <QNetworkAccessManager>
#include <QNetworkReply>
Expand All @@ -20,9 +18,9 @@ class DownloadManager : public QObject
void setFile(QString fileURL, const QString &channelName);

private:
QNetworkAccessManager *manager;
QNetworkReply *reply;
QFile *file;
QNetworkAccessManager *manager_;
QNetworkReply *reply_;
QFile *file_;

private slots:
void onDownloadProgress(qint64, qint64);
Expand All @@ -33,4 +31,5 @@ private slots:
signals:
void downloadComplete();
};

} // namespace chatterino
2 changes: 0 additions & 2 deletions src/controllers/commands/CommandController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,8 +951,6 @@ QString CommandController::execCommand(const QString &textNoEmoji,
}
}

auto *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());

{
// check if user command exists
const auto it = this->userCommands_.find(commandName);
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/filters/parser/Tokenizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Tokenizer::Tokenizer(const QString &text)
QRegularExpressionMatchIterator i = tokenRegex.globalMatch(text);
while (i.hasNext())
{
auto text = i.next().captured();
this->tokens_ << text;
this->tokenTypes_ << this->tokenize(text);
auto capturedText = i.next().captured();
this->tokens_ << capturedText;
this->tokenTypes_ << this->tokenize(capturedText);
}
}

Expand Down
16 changes: 16 additions & 0 deletions src/controllers/highlights/HighlightModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ void HighlightModel::afterInit()
firstMessageRow[Column::Pattern]->setData("First Messages",
Qt::DisplayRole);
firstMessageRow[Column::ShowInMentions]->setFlags({});
// setBoolItem(firstMessageRow[Column::FlashTaskbar],
// getSettings()->enableFirstMessageHighlightTaskbar.getValue(),
// true, false);
// setBoolItem(firstMessageRow[Column::PlaySound],
// getSettings()->enableFirstMessageHighlightSound.getValue(),
// true, false);
firstMessageRow[Column::FlashTaskbar]->setFlags({});
firstMessageRow[Column::PlaySound]->setFlags({});
firstMessageRow[Column::UseRegex]->setFlags({});
Expand Down Expand Up @@ -245,6 +251,11 @@ void HighlightModel::customRowSetData(const std::vector<QStandardItem *> &row,
// getSettings()->enableRedeemedHighlightTaskbar.setValue(
// value.toBool());
}
else if (rowIndex == 4)
{
// getSettings()->enableFirstMessageHighlightTaskbar.setValue(
// value.toBool());
}
}
}
break;
Expand All @@ -271,6 +282,11 @@ void HighlightModel::customRowSetData(const std::vector<QStandardItem *> &row,
// getSettings()->enableRedeemedHighlightSound.setValue(
// value.toBool());
}
else if (rowIndex == 4)
{
// getSettings()->enableFirstMessageHighlightSound.setValue(
// value.toBool());
}
}
}
break;
Expand Down
1 change: 1 addition & 0 deletions src/messages/SharedMessageBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void SharedMessageBuilder::parseHighlights()
{
auto app = getApp();

// Highlight because it's a subscription
if (this->message().flags.has(MessageFlag::Subscription) &&
getSettings()->enableSubHighlight)
{
Expand Down
2 changes: 2 additions & 0 deletions src/messages/search/MessagePredicate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace chatterino {
class MessagePredicate
{
public:
virtual ~MessagePredicate() = default;

/**
* @brief Checks whether this predicate applies to the passed message.
*
Expand Down
1 change: 0 additions & 1 deletion src/providers/irc/IrcMessageBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ void IrcMessageBuilder::addWords(const QStringList &words)
continue;
}

int pos = 0;
int lastPos = 0;

while (i.hasNext())
Expand Down
2 changes: 1 addition & 1 deletion src/providers/irc/IrcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ void IrcServer::privateMessageReceived(Communi::IrcPrivateMessage *message)

if (!builder.isIgnored())
{
builder.triggerHighlights();
channel->addMessage(builder.build());
builder.triggerHighlights();
}
else
{
Expand Down
10 changes: 5 additions & 5 deletions src/providers/twitch/IrcMessageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,18 +827,18 @@ void IrcMessageHandler::handleNoticeMessage(Communi::IrcNoticeMessage *message)
{
return;
}
auto &channelName = hostOn ? parts[2] : parts[0];
if (channelName.size() < 2)
auto &hostedChannelName = hostOn ? parts[2] : parts[0];
if (hostedChannelName.size() < 2)
{
return;
}
if (hostOn)
{
channelName.chop(1);
hostedChannelName.chop(1);
}
MessageBuilder builder;
TwitchMessageBuilder::hostingSystemMessage(channelName, &builder,
hostOn);
TwitchMessageBuilder::hostingSystemMessage(hostedChannelName,
&builder, hostOn);
channel->addMessage(builder.release());
}
else if (tags == "room_mods" || tags == "vips_success")
Expand Down
Loading

0 comments on commit a4ae09f

Please sign in to comment.