mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
moved anonymous namespace into chatterino namespace
This commit is contained in:
parent
23c2fa8ee5
commit
d3c4d4b8cf
|
@ -28,48 +28,46 @@
|
||||||
#define TEXT_VIEWS "Views: "
|
#define TEXT_VIEWS "Views: "
|
||||||
#define TEXT_CREATED "Created: "
|
#define TEXT_CREATED "Created: "
|
||||||
|
|
||||||
|
namespace chatterino {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
const auto borderColor = QColor(255, 255, 255, 80);
|
const auto borderColor = QColor(255, 255, 255, 80);
|
||||||
|
|
||||||
int calculateTimeoutDuration(TimeoutButton timeout)
|
int calculateTimeoutDuration(TimeoutButton timeout)
|
||||||
{
|
{
|
||||||
static const QMap<QString, int> durations{
|
static const QMap<QString, int> durations{
|
||||||
{"s", 1}, {"m", 60}, {"h", 3600}, {"d", 86400}, {"w", 604800},
|
{"s", 1}, {"m", 60}, {"h", 3600}, {"d", 86400}, {"w", 604800},
|
||||||
};
|
};
|
||||||
return timeout.second * durations[timeout.first];
|
return timeout.second * durations[timeout.first];
|
||||||
}
|
}
|
||||||
|
|
||||||
chatterino::ChannelPtr filterMessages(const QString &userName,
|
ChannelPtr filterMessages(const QString &userName, ChannelPtr channel)
|
||||||
chatterino::ChannelPtr channel)
|
{
|
||||||
{
|
LimitedQueueSnapshot<MessagePtr> snapshot =
|
||||||
chatterino::LimitedQueueSnapshot<chatterino::MessagePtr> snapshot =
|
|
||||||
channel->getMessageSnapshot();
|
channel->getMessageSnapshot();
|
||||||
|
|
||||||
chatterino::ChannelPtr channelPtr(new chatterino::Channel(
|
ChannelPtr channelPtr(
|
||||||
channel->getName(), chatterino::Channel::Type::None));
|
new Channel(channel->getName(), Channel::Type::None));
|
||||||
|
|
||||||
for (size_t i = 0; i < snapshot.size(); i++)
|
for (size_t i = 0; i < snapshot.size(); i++)
|
||||||
{
|
{
|
||||||
chatterino::MessagePtr message = snapshot[i];
|
MessagePtr message = snapshot[i];
|
||||||
|
|
||||||
bool isSelectedUser =
|
bool isSelectedUser =
|
||||||
message->loginName.compare(userName, Qt::CaseInsensitive) == 0;
|
message->loginName.compare(userName, Qt::CaseInsensitive) == 0;
|
||||||
|
|
||||||
if (isSelectedUser &&
|
if (isSelectedUser && !message->flags.has(MessageFlag::Whisper))
|
||||||
!message->flags.has(chatterino::MessageFlag::Whisper))
|
|
||||||
{
|
{
|
||||||
channelPtr->addMessage(message);
|
channelPtr->addMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return channelPtr;
|
return channelPtr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace chatterino {
|
|
||||||
|
|
||||||
UserInfoPopup::UserInfoPopup()
|
UserInfoPopup::UserInfoPopup()
|
||||||
: BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless |
|
: BaseWindow(nullptr, BaseWindow::Flags(BaseWindow::Frameless |
|
||||||
BaseWindow::FramelessDraggable))
|
BaseWindow::FramelessDraggable))
|
||||||
|
|
Loading…
Reference in a new issue