Update Settings and Signals version (#3398)
Co-authored-by: zneix <zneix@zneix.eu>
This commit is contained in:
@@ -430,12 +430,6 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically, QWidget *parent)
|
||||
this->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Policy::Ignored);
|
||||
}
|
||||
|
||||
// remove once https://github.com/pajlada/signals/pull/10 gets merged
|
||||
UserInfoPopup::~UserInfoPopup()
|
||||
{
|
||||
this->refreshConnection_.disconnect();
|
||||
}
|
||||
|
||||
void UserInfoPopup::themeChangedEvent()
|
||||
{
|
||||
BaseWindow::themeChangedEvent();
|
||||
@@ -601,26 +595,25 @@ void UserInfoPopup::updateLatestMessages()
|
||||
// shrink dialog in case ChannelView goes from visible to hidden
|
||||
this->adjustSize();
|
||||
|
||||
this->refreshConnection_
|
||||
.disconnect(); // remove once https://github.com/pajlada/signals/pull/10 gets merged
|
||||
this->refreshConnection_ =
|
||||
std::make_unique<pajlada::Signals::ScopedConnection>(
|
||||
this->channel_->messageAppended.connect([this, hasMessages](
|
||||
auto message, auto) {
|
||||
if (!checkMessageUserName(this->userName_, message))
|
||||
return;
|
||||
|
||||
this->refreshConnection_ = this->channel_->messageAppended.connect(
|
||||
[this, hasMessages](auto message, auto) {
|
||||
if (!checkMessageUserName(this->userName_, message))
|
||||
return;
|
||||
|
||||
if (hasMessages)
|
||||
{
|
||||
// display message in ChannelView
|
||||
this->ui_.latestMessages->channel()->addMessage(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The ChannelView is currently hidden, so manually refresh
|
||||
// and display the latest messages
|
||||
this->updateLatestMessages();
|
||||
}
|
||||
});
|
||||
if (hasMessages)
|
||||
{
|
||||
// display message in ChannelView
|
||||
this->ui_.latestMessages->channel()->addMessage(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The ChannelView is currently hidden, so manually refresh
|
||||
// and display the latest messages
|
||||
this->updateLatestMessages();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
void UserInfoPopup::updateUserData()
|
||||
|
||||
Reference in New Issue
Block a user