Add option always include broadcaster in user completions (#5193)
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
- Minor: Add a new completion API for experimental plugins feature. (#5000, #5047)
|
- Minor: Add a new completion API for experimental plugins feature. (#5000, #5047)
|
||||||
- Minor: Re-enabled _Restart on crash_ option on Windows. (#5012)
|
- Minor: Re-enabled _Restart on crash_ option on Windows. (#5012)
|
||||||
- Minor: The whisper highlight color can now be configured through the settings. (#5053)
|
- Minor: The whisper highlight color can now be configured through the settings. (#5053)
|
||||||
|
- Minor: Added an option to always include the broadcaster in user completions. This is enabled by default. (#5193)
|
||||||
- Minor: Added missing periods at various moderator messages and commands. (#5061)
|
- Minor: Added missing periods at various moderator messages and commands. (#5061)
|
||||||
- Minor: Improved color selection and display. (#5057)
|
- Minor: Improved color selection and display. (#5057)
|
||||||
- Minor: Improved Streamlink documentation in the settings dialog. (#5076)
|
- Minor: Improved Streamlink documentation in the settings dialog. (#5076)
|
||||||
|
|||||||
@@ -59,6 +59,26 @@ void UserSource::initializeFromChannel(const Channel *channel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
this->items_ = tc->accessChatters()->all();
|
this->items_ = tc->accessChatters()->all();
|
||||||
|
|
||||||
|
if (getSettings()->alwaysIncludeBroadcasterInUserCompletions)
|
||||||
|
{
|
||||||
|
auto it = std::find_if(this->items_.begin(), this->items_.end(),
|
||||||
|
[tc](const UserItem &user) {
|
||||||
|
return user.first == tc->getName();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (it != this->items_.end())
|
||||||
|
{
|
||||||
|
auto broadcaster = *it;
|
||||||
|
this->items_.erase(it);
|
||||||
|
this->items_.insert(this->items_.begin(), broadcaster);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->items_.insert(this->items_.begin(),
|
||||||
|
{tc->getName(), tc->getDisplayName()});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<UserItem> &UserSource::output() const
|
const std::vector<UserItem> &UserSource::output() const
|
||||||
|
|||||||
@@ -264,6 +264,12 @@ public:
|
|||||||
void updateStreamStatus(const std::optional<HelixStream> &helixStream);
|
void updateStreamStatus(const std::optional<HelixStream> &helixStream);
|
||||||
void updateStreamTitle(const QString &title);
|
void updateStreamTitle(const QString &title);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the display name of the user
|
||||||
|
*
|
||||||
|
* If the display name contained chinese, japenese, or korean characters, the user's login name is returned instead
|
||||||
|
**/
|
||||||
|
const QString &getDisplayName() const override;
|
||||||
void updateDisplayName(const QString &displayName);
|
void updateDisplayName(const QString &displayName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -323,13 +329,6 @@ private:
|
|||||||
void setDisplayName(const QString &name);
|
void setDisplayName(const QString &name);
|
||||||
void setLocalizedName(const QString &name);
|
void setLocalizedName(const QString &name);
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the display name of the user
|
|
||||||
*
|
|
||||||
* If the display name contained chinese, japenese, or korean characters, the user's login name is returned instead
|
|
||||||
**/
|
|
||||||
const QString &getDisplayName() const override;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the localized name of the user
|
* Returns the localized name of the user
|
||||||
**/
|
**/
|
||||||
|
|||||||
@@ -218,6 +218,10 @@ public:
|
|||||||
"/behaviour/autocompletion/emoteCompletionWithColon", true};
|
"/behaviour/autocompletion/emoteCompletionWithColon", true};
|
||||||
BoolSetting showUsernameCompletionMenu = {
|
BoolSetting showUsernameCompletionMenu = {
|
||||||
"/behaviour/autocompletion/showUsernameCompletionMenu", true};
|
"/behaviour/autocompletion/showUsernameCompletionMenu", true};
|
||||||
|
BoolSetting alwaysIncludeBroadcasterInUserCompletions = {
|
||||||
|
"/behaviour/autocompletion/alwaysIncludeBroadcasterInUserCompletions",
|
||||||
|
true,
|
||||||
|
};
|
||||||
BoolSetting useSmartEmoteCompletion = {
|
BoolSetting useSmartEmoteCompletion = {
|
||||||
"/experiments/useSmartEmoteCompletion",
|
"/experiments/useSmartEmoteCompletion",
|
||||||
false,
|
false,
|
||||||
|
|||||||
@@ -1032,6 +1032,11 @@ void GeneralPage::initLayout(GeneralPageView &layout)
|
|||||||
"Find mentions of users in chat without the @ prefix.");
|
"Find mentions of users in chat without the @ prefix.");
|
||||||
layout.addCheckbox("Show username autocompletion popup menu",
|
layout.addCheckbox("Show username autocompletion popup menu",
|
||||||
s.showUsernameCompletionMenu);
|
s.showUsernameCompletionMenu);
|
||||||
|
layout.addCheckbox(
|
||||||
|
"Always include broadcaster in user completions",
|
||||||
|
s.alwaysIncludeBroadcasterInUserCompletions, false,
|
||||||
|
"This will ensure a broadcaster is always easy to ping, even if they "
|
||||||
|
"don't have chat open or have typed recently.");
|
||||||
const QStringList usernameDisplayModes = {"Username", "Localized name",
|
const QStringList usernameDisplayModes = {"Username", "Localized name",
|
||||||
"Username and localized name"};
|
"Username and localized name"};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user