Improve Twitch PubSub connection reliability (#3643)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -103,10 +103,10 @@ Split::Split(QWidget *parent)
|
||||
this->input_->ui_.textEdit->installEventFilter(parent);
|
||||
|
||||
// update placeholder text on Twitch account change and channel change
|
||||
this->signalHolder_.managedConnect(
|
||||
getApp()->accounts->twitch.currentUserChanged, [this] {
|
||||
this->bSignals_.emplace_back(
|
||||
getApp()->accounts->twitch.currentUserChanged.connect([this] {
|
||||
this->updateInputPlaceholder();
|
||||
});
|
||||
}));
|
||||
this->signalHolder_.managedConnect(channelChanged, [this] {
|
||||
this->updateInputPlaceholder();
|
||||
});
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <QShortcut>
|
||||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
@@ -151,6 +152,7 @@ private:
|
||||
|
||||
pajlada::Signals::Connection indirectChannelChangedConnection_;
|
||||
pajlada::Signals::SignalHolder signalHolder_;
|
||||
std::vector<boost::signals2::scoped_connection> bSignals_;
|
||||
|
||||
public slots:
|
||||
void addSibling();
|
||||
|
||||
@@ -204,10 +204,10 @@ SplitHeader::SplitHeader(Split *_split)
|
||||
this->handleChannelChanged();
|
||||
});
|
||||
|
||||
this->managedConnections_.managedConnect(
|
||||
getApp()->accounts->twitch.currentUserChanged, [this] {
|
||||
this->bSignals_.emplace_back(
|
||||
getApp()->accounts->twitch.currentUserChanged.connect([this] {
|
||||
this->updateModerationModeIcon();
|
||||
});
|
||||
}));
|
||||
|
||||
auto _ = [this](const auto &, const auto &) {
|
||||
this->updateChannelText();
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
|
||||
#include "widgets/BaseWidget.hpp"
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <QMenu>
|
||||
#include <QPoint>
|
||||
#include <memory>
|
||||
#include <boost/signals2.hpp>
|
||||
#include <pajlada/settings/setting.hpp>
|
||||
#include <pajlada/signals/connection.hpp>
|
||||
#include <pajlada/signals/signalholder.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include <QElapsedTimer>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
@@ -85,6 +86,7 @@ private:
|
||||
pajlada::Signals::NoArgSignal modeUpdateRequested_;
|
||||
pajlada::Signals::SignalHolder managedConnections_;
|
||||
pajlada::Signals::SignalHolder channelConnections_;
|
||||
std::vector<boost::signals2::scoped_connection> bSignals_;
|
||||
|
||||
public slots:
|
||||
void reloadChannelEmotes();
|
||||
|
||||
Reference in New Issue
Block a user