removed latest messages

This commit is contained in:
fourtf 2020-09-26 14:02:18 +02:00
parent 1d306c1dd9
commit d5855ba7d6
2 changed files with 3 additions and 41 deletions

View file

@ -42,30 +42,6 @@ namespace {
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
UserInfoPopup::UserInfoPopup()
@ -123,13 +99,10 @@ UserInfoPopup::UserInfoPopup()
user.emplace<QCheckBox>("Ignore").assign(&this->ui_.ignore);
user.emplace<QCheckBox>("Ignore highlights")
.assign(&this->ui_.ignoreHighlights);
auto viewLogs = user.emplace<EffectLabel2>(this);
viewLogs->getLabel().setText("Online logs");
auto usercard = user.emplace<EffectLabel2>(this);
usercard->getLabel().setText("Usercard");
usercard->setBorderColor(borderColor);
viewLogs->setBorderColor(borderColor);
auto mod = user.emplace<Button>(this);
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->installEvents();
@ -386,9 +354,6 @@ void UserInfoPopup::setData(const QString &name, const ChannelPtr &channel)
this->updateUserData();
this->userStateChanged_.invoke();
this->latestMessages_->setChannel(
filterMessages(this->userName_, this->channel_));
}
void UserInfoPopup::updateUserData()

View file

@ -1,10 +1,9 @@
#pragma once
#include "widgets/BaseWindow.hpp"
#include "widgets/helper/ChannelView.hpp"
#include <pajlada/signals/signal.hpp>
#include "widgets/BaseWindow.hpp"
class QCheckBox;
namespace chatterino {
@ -36,7 +35,6 @@ private:
QString userName_;
QString userId_;
ChannelPtr channel_;
ChannelView *latestMessages_{};
pajlada::Signals::NoArgSignal userStateChanged_;
@ -45,7 +43,6 @@ private:
struct {
Button *avatarButton = nullptr;
// RippleEffectLabel2 *viewLogs = nullptr;
Label *nameLabel = nullptr;
Label *viewCountLabel = nullptr;
Label *followerCountLabel = nullptr;