Migrate to C++ 20 & switch to websocketpp develop branch (#4252)

* feat: c++ 20

* fix: c++ 20 deprecations

* fix(msvc): warnings

* chore: add changelog entry

* fix: formatting

* Update websocketpp to the `develop` branch

* Specify other template type in FlagsEnum != operator

* Remove the user of simple template ids in our websocketpp template class

Also standardizes the file a bit by using nested namespaces, using
pragma once

* fix: turn `MAGIC_MESSAGE_SUFFIX` into a `QString`

* hacky unhacky hacky const char hack

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2022-12-24 12:56:11 +01:00
committed by GitHub
parent 99e038ce5e
commit 86e71c8bd9
31 changed files with 219 additions and 212 deletions
+8 -4
View File
@@ -38,7 +38,11 @@
namespace chatterino {
namespace {
constexpr char MAGIC_MESSAGE_SUFFIX[] = u8" \U000E0000";
#if QT_VERSION < QT_VERSION_CHECK(6, 1, 0)
const QString MAGIC_MESSAGE_SUFFIX = QString((const char *)u8" \U000E0000");
#else
const QString MAGIC_MESSAGE_SUFFIX = QString::fromUtf8(u8" \U000E0000");
#endif
constexpr int TITLE_REFRESH_PERIOD = 10000;
constexpr int CLIP_CREATION_COOLDOWN = 5000;
const QString CLIPS_LINK("https://clips.twitch.tv/%1");
@@ -72,7 +76,7 @@ TwitchChannel::TwitchChannel(const QString &name)
qCDebug(chatterinoTwitch) << "[TwitchChannel" << name << "] Opened";
this->bSignals_.emplace_back(
getApp()->accounts->twitch.currentUserChanged.connect([=] {
getApp()->accounts->twitch.currentUserChanged.connect([this] {
this->setMod(false);
this->refreshPubSub();
}));
@@ -124,13 +128,13 @@ TwitchChannel::TwitchChannel(const QString &name)
// timers
QObject::connect(&this->chattersListTimer_, &QTimer::timeout, [=] {
QObject::connect(&this->chattersListTimer_, &QTimer::timeout, [this] {
this->refreshChatters();
});
this->chattersListTimer_.start(5 * 60 * 1000);
QObject::connect(&this->threadClearTimer_, &QTimer::timeout, [=] {
QObject::connect(&this->threadClearTimer_, &QTimer::timeout, [this] {
// We periodically check for any dangling reply threads that missed
// being cleaned up on messageRemovedFromStart. This could occur if
// some other part of the program, like a user card, held a reference