Non-public mod action logs should still be relayed to non-public channels on external relays

This commit is contained in:
UnknownShadow200 2024-06-03 20:09:16 +10:00
parent a3dd5b5166
commit 80884967e2
3 changed files with 21 additions and 14 deletions

View File

@ -54,7 +54,8 @@ namespace MCGalaxy.Core {
Chat.Message(ChatScope.Global, e.FormatMessage(targetNick, action),
null, null, true);
} else {
Chat.MessageOps("To Ops: " + e.FormatMessage(targetNick, action));
Chat.Message(ChatScope.Perms, "To Ops: " + e.FormatMessage(targetNick, action),
Chat.OpchatPerms, null, true);
}
action = Colors.StripUsed(action);

View File

@ -18,13 +18,16 @@
using MCGalaxy.Commands.Moderation;
using MCGalaxy.Events;
namespace MCGalaxy.Modules.Moderation.Notes {
public class CmdNote : Command2 {
namespace MCGalaxy.Modules.Moderation.Notes
{
public class CmdNote : Command2
{
public override string name { get { return "Note"; } }
public override string type { get { return CommandTypes.Moderation; } }
public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } }
protected virtual bool announce { get { return true; } }
protected virtual ModActionType modActionType { get { return ModActionType.Noted; } }
public override void Use(Player p, string message, CommandData data) {
if (!Server.Config.LogNotes) {
p.Message("Notes logging must be enabled to note players."); return;
@ -44,7 +47,7 @@ namespace MCGalaxy.Modules.Moderation.Notes {
if (group == null) return;
ModAction action = new ModAction(target, p, modActionType, note);
action.Announce = announce;
action.Announce = announce;
OnModActionEvent.Call(action);
}
@ -54,12 +57,14 @@ namespace MCGalaxy.Modules.Moderation.Notes {
p.Message("&HFor [text], @number can be used as a shortcut for that rule.");
}
}
public class CmdOpNote : CmdNote {
public class CmdOpNote : CmdNote
{
public override string name { get { return "OpNote"; } }
public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }
protected override bool announce { get { return false; } }
protected override ModActionType modActionType { get { return ModActionType.OpNoted; } }
public override void Help(Player p) {
p.Message("&T/OpNote [player] [text]");
p.Message("&HAdds a note to [player]'s /notes that only ops may see.");

View File

@ -62,6 +62,15 @@ namespace MCGalaxy.Modules.Moderation.Notes
/// </summary>
public class NoteAcronym
{
public readonly string Acronym;
public readonly string Action;
private NoteAcronym(string acronym, string action) {
Acronym = acronym;
Action = action;
}
private readonly static NoteAcronym Warned = new NoteAcronym("W", "Warned");
private readonly static NoteAcronym Kicked = new NoteAcronym("K", "Kicked");
private readonly static NoteAcronym Muted = new NoteAcronym("M", "Muted");
@ -101,13 +110,5 @@ namespace MCGalaxy.Modules.Moderation.Notes
}
return acronym;
}
public readonly string Acronym;
public readonly string Action;
private NoteAcronym(string acronym, string action) {
Acronym = acronym;
Action = action;
}
}
}