// // openmapi.org - IRC <--> Jabber bridge - OpCommand.cs // // (C) 2009 by Johannes Roith // // Author: Johannes Roith // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // namespace Jonfo.Jabber.IRC { using System; using jabber; /// /// Command to enable/disable silent mode for jabber user. /// public sealed class SilentCommand : Command { public SilentCommand (IRCJabberBridge bridge) : base (bridge) { } public override string Description { get { return "Enables/Disables message blocker."; } } public override string CommandStr { get { return "silent"; } } public override void Run (JID from, string args) { if (bridge.IsSilentUser (from)) { bridge.RemoveSilentUser (from); bridge.JabberClient.Message (from, "Silent mode disabled " + "for '" + from + "'."); } else { bridge.AddSilentUser (from); bridge.JabberClient.Message (from, "Silent mode enabled " + "for '" + from + "'."); } } } }