mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-09 15:27:54 +00:00
feat: per-server keepproxy toggling (#574)
Merges PluralKit/PluralKit#574
This commit is contained in:
parent
8a59ef5f50
commit
22ce250b56
11 changed files with 131 additions and 15 deletions
|
|
@ -9,13 +9,22 @@ public struct ProxyMatch
|
|||
public string? Content;
|
||||
public ProxyTag? ProxyTags;
|
||||
|
||||
private bool ShouldKeepProxy()
|
||||
{
|
||||
if (Member.ServerKeepProxy != null && Member.ServerKeepProxy.Value)
|
||||
return true;
|
||||
else if (Member.KeepProxy && !(Member.ServerKeepProxy != null && !Member.ServerKeepProxy.Value))
|
||||
return true;
|
||||
else return false;
|
||||
}
|
||||
|
||||
public string? ProxyContent
|
||||
{
|
||||
get
|
||||
{
|
||||
// Add the proxy tags into the proxied message if that option is enabled
|
||||
// Also check if the member has any proxy tags - some cases autoproxy can return a member with no tags
|
||||
if (Member.KeepProxy && Content != null && ProxyTags != null)
|
||||
if (ShouldKeepProxy() && ProxyTags != null && Content != null)
|
||||
return $"{ProxyTags.Value.Prefix}{Content}{ProxyTags.Value.Suffix}";
|
||||
|
||||
return Content;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue