Skip to content

Commit

Permalink
Non-public mod action logs should still be relayed to non-public chan…
Browse files Browse the repository at this point in the history
…nels on external relays
  • Loading branch information
UnknownShadow200 committed Jun 3, 2024
1 parent a3dd5b5 commit 8088496
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
3 changes: 2 additions & 1 deletion MCGalaxy/CorePlugin/ModActionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ internal static class ModActionHandler {
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);
Expand Down
15 changes: 10 additions & 5 deletions MCGalaxy/Modules/Moderation/Notes/CmdNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -44,7 +47,7 @@ public class CmdNote : Command2 {
if (group == null) return;

ModAction action = new ModAction(target, p, modActionType, note);
action.Announce = announce;
action.Announce = announce;
OnModActionEvent.Call(action);
}

Expand All @@ -54,12 +57,14 @@ public class CmdNote : Command2 {
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.");
Expand Down
17 changes: 9 additions & 8 deletions MCGalaxy/Modules/Moderation/Notes/NotesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ public sealed class NotesPlugin : Plugin
/// </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");
Expand Down Expand Up @@ -101,13 +110,5 @@ public class NoteAcronym
}
return acronym;
}

public readonly string Acronym;
public readonly string Action;

private NoteAcronym(string acronym, string action) {
Acronym = acronym;
Action = action;
}
}
}

0 comments on commit 8088496

Please sign in to comment.