[smuxi/experiments/gtk2_builder_pref_dialog: 1/25] Engine-IRC: implement /oper command



commit abcee315b991f332b169cad38d407399cda52b00
Author: Ondřej Hošek <ondra hosek gmail com>
Date:   Mon Mar 21 21:56:03 2016 +0100

    Engine-IRC: implement /oper command
    
    Upon successful authentication with the credentials given to the command,
    OPER <username> <password> grants IRC operator (IRCOp) privileges to the
    issuing user.

 src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs 
b/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs
index 70d942d..c3747d6 100644
--- a/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs
+++ b/src/Engine-IRC/Protocols/Irc/IrcProtocolManager.cs
@@ -837,6 +837,10 @@ namespace Smuxi.Engine
                             CommandCtcp(command);
                             handled = true;
                             break;
+                        case "oper":
+                            CommandOper(command);
+                            handled = true;
+                            break;
                         // commands which only work on channels or queries
                         case "me":
                             CommandMe(command);
@@ -1068,6 +1072,7 @@ namespace Smuxi.Engine
             "finger nick",
             "mode [target] [new-mode]",
             "away [away-message]",
+            "oper username password",
             "kick nick(s) [reason]",
             "kickban/kb nick(s) [reason]",
             "ban [mask]",
@@ -1673,6 +1678,15 @@ namespace Smuxi.Engine
                 SetPresenceStatus(PresenceStatus.Online, null);
             }
         }
+
+        public void CommandOper(CommandModel cd)
+        {
+            if (cd.DataArray.Length < 3) {
+                _NotEnoughParameters(cd);
+                return;
+            }
+            _IrcClient.RfcOper(cd.DataArray[1], cd.DataArray[2]);
+        }
         
         public void CommandCtcp(CommandModel cd)
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]