removed latest messages
This commit is contained in:
@@ -42,30 +42,6 @@ namespace {
|
|||||||
return timeout.second * durations[timeout.first];
|
return timeout.second * durations[timeout.first];
|
||||||
}
|
}
|
||||||
|
|
||||||
ChannelPtr filterMessages(const QString &userName, ChannelPtr channel)
|
|
||||||
{
|
|
||||||
LimitedQueueSnapshot<MessagePtr> snapshot =
|
|
||||||
channel->getMessageSnapshot();
|
|
||||||
|
|
||||||
ChannelPtr channelPtr(
|
|
||||||
new Channel(channel->getName(), Channel::Type::None));
|
|
||||||
|
|
||||||
for (size_t i = 0; i < snapshot.size(); i++)
|
|
||||||
{
|
|
||||||
MessagePtr message = snapshot[i];
|
|
||||||
|
|
||||||
bool isSelectedUser =
|
|
||||||
message->loginName.compare(userName, Qt::CaseInsensitive) == 0;
|
|
||||||
|
|
||||||
if (isSelectedUser && !message->flags.has(MessageFlag::Whisper))
|
|
||||||
{
|
|
||||||
channelPtr->addMessage(message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return channelPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
UserInfoPopup::UserInfoPopup()
|
UserInfoPopup::UserInfoPopup()
|
||||||
@@ -123,13 +99,10 @@ UserInfoPopup::UserInfoPopup()
|
|||||||
user.emplace<QCheckBox>("Ignore").assign(&this->ui_.ignore);
|
user.emplace<QCheckBox>("Ignore").assign(&this->ui_.ignore);
|
||||||
user.emplace<QCheckBox>("Ignore highlights")
|
user.emplace<QCheckBox>("Ignore highlights")
|
||||||
.assign(&this->ui_.ignoreHighlights);
|
.assign(&this->ui_.ignoreHighlights);
|
||||||
auto viewLogs = user.emplace<EffectLabel2>(this);
|
|
||||||
viewLogs->getLabel().setText("Online logs");
|
|
||||||
auto usercard = user.emplace<EffectLabel2>(this);
|
auto usercard = user.emplace<EffectLabel2>(this);
|
||||||
usercard->getLabel().setText("Usercard");
|
usercard->getLabel().setText("Usercard");
|
||||||
|
|
||||||
usercard->setBorderColor(borderColor);
|
usercard->setBorderColor(borderColor);
|
||||||
viewLogs->setBorderColor(borderColor);
|
|
||||||
|
|
||||||
auto mod = user.emplace<Button>(this);
|
auto mod = user.emplace<Button>(this);
|
||||||
mod->setPixmap(app->resources->buttons.mod);
|
mod->setPixmap(app->resources->buttons.mod);
|
||||||
@@ -243,11 +216,6 @@ UserInfoPopup::UserInfoPopup()
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// fourth line (last messages)
|
|
||||||
this->latestMessages_ = new ChannelView();
|
|
||||||
this->latestMessages_->setScaleIndependantHeight(150);
|
|
||||||
layout.append(this->latestMessages_);
|
|
||||||
|
|
||||||
this->setStyleSheet("font-size: 11pt;");
|
this->setStyleSheet("font-size: 11pt;");
|
||||||
|
|
||||||
this->installEvents();
|
this->installEvents();
|
||||||
@@ -386,9 +354,6 @@ void UserInfoPopup::setData(const QString &name, const ChannelPtr &channel)
|
|||||||
this->updateUserData();
|
this->updateUserData();
|
||||||
|
|
||||||
this->userStateChanged_.invoke();
|
this->userStateChanged_.invoke();
|
||||||
|
|
||||||
this->latestMessages_->setChannel(
|
|
||||||
filterMessages(this->userName_, this->channel_));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserInfoPopup::updateUserData()
|
void UserInfoPopup::updateUserData()
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "widgets/BaseWindow.hpp"
|
|
||||||
#include "widgets/helper/ChannelView.hpp"
|
|
||||||
|
|
||||||
#include <pajlada/signals/signal.hpp>
|
#include <pajlada/signals/signal.hpp>
|
||||||
|
|
||||||
|
#include "widgets/BaseWindow.hpp"
|
||||||
|
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
@@ -36,7 +35,6 @@ private:
|
|||||||
QString userName_;
|
QString userName_;
|
||||||
QString userId_;
|
QString userId_;
|
||||||
ChannelPtr channel_;
|
ChannelPtr channel_;
|
||||||
ChannelView *latestMessages_{};
|
|
||||||
|
|
||||||
pajlada::Signals::NoArgSignal userStateChanged_;
|
pajlada::Signals::NoArgSignal userStateChanged_;
|
||||||
|
|
||||||
@@ -45,7 +43,6 @@ private:
|
|||||||
struct {
|
struct {
|
||||||
Button *avatarButton = nullptr;
|
Button *avatarButton = nullptr;
|
||||||
|
|
||||||
// RippleEffectLabel2 *viewLogs = nullptr;
|
|
||||||
Label *nameLabel = nullptr;
|
Label *nameLabel = nullptr;
|
||||||
Label *viewCountLabel = nullptr;
|
Label *viewCountLabel = nullptr;
|
||||||
Label *followerCountLabel = nullptr;
|
Label *followerCountLabel = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user