Consider nicknames when searching for messages (#4663)
Co-authored-by: pajlada <rasmus.karlsson+github@pajlada.com>
This commit is contained in:
@@ -81,6 +81,22 @@ bool ConcurrentSettings::isMutedChannel(const QString &channelName)
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::optional<QString> ConcurrentSettings::matchNickname(
|
||||
const QString &usernameText)
|
||||
{
|
||||
auto nicknames = getCSettings().nicknames.readOnly();
|
||||
|
||||
for (const auto &nickname : *nicknames)
|
||||
{
|
||||
if (auto nicknameText = nickname.match(usernameText))
|
||||
{
|
||||
return nicknameText;
|
||||
}
|
||||
}
|
||||
|
||||
return boost::none;
|
||||
}
|
||||
|
||||
void ConcurrentSettings::mute(const QString &channelName)
|
||||
{
|
||||
mutedChannels.append(channelName);
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
bool isBlacklistedUser(const QString &username);
|
||||
bool isMutedChannel(const QString &channelName);
|
||||
bool toggleMutedChannel(const QString &channelName);
|
||||
boost::optional<QString> matchNickname(const QString &username);
|
||||
|
||||
private:
|
||||
void mute(const QString &channelName);
|
||||
|
||||
Reference in New Issue
Block a user