- nicht unterstuetzte Channel-Modes entfernt.
[ngircd-alex.git] / src / ngircd / irc-mode.c
index ca638fb41768690d01267af487fa0c1ce453c69b..c47345ae457e693b824b43131408c0036d63d7e9 100644 (file)
@@ -9,7 +9,7 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: irc-mode.c,v 1.5 2002/05/21 00:10:16 alex Exp $
+ * $Id: irc-mode.c,v 1.7 2002/06/02 15:14:22 alex Exp $
  *
  * irc-mode.c: IRC-Befehle zur Mode-Aenderung (MODE, AWAY, ...)
  */
 #include <assert.h>
 #include <string.h>
 
+#include "conn.h"
+#include "client.h"
 #include "channel.h"
 #include "defines.h"
 #include "irc-write.h"
 #include "log.h"
+#include "parse.h"
 #include "messages.h"
 
 #include "exp.h"
 #include "irc-mode.h"
 
 
-GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_MODE( CLIENT *Client, REQUEST *Req )
 {
        CHAR *mode_ptr, the_modes[CLIENT_MODE_LEN], x[2];
        CLIENT *cl, *chan_cl, *prefix;
@@ -140,11 +144,6 @@ GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
                                                /* invisible */
                                                x[0] = 'i';
                                                break;
-                                       case 'r':
-                                               /* restricted (kann nur gesetzt werden) */
-                                               if( set ) x[0] = 'r';
-                                               else ok = IRC_WriteStrClient( Client, ERR_RESTRICTED_MSG, Client_ID( Client ));
-                                               break;
                                        case 'o':
                                                /* operator (kann nur geloescht werden) */
                                                if( ! set )
@@ -154,6 +153,11 @@ GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
                                                }
                                                else ok = IRC_WriteStrClient( Client, ERR_UMODEUNKNOWNFLAG_MSG, Client_ID( Client ));
                                                break;
+                                       case 'r':
+                                               /* restricted (kann nur gesetzt werden) */
+                                               if( set ) x[0] = 'r';
+                                               else ok = IRC_WriteStrClient( Client, ERR_RESTRICTED_MSG, Client_ID( Client ));
+                                               break;
                                        case 's':
                                                /* server messages */
                                                x[0] = 's';
@@ -199,9 +203,9 @@ GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
                                        /* Channel-Modes */
                                        switch( *mode_ptr )
                                        {
-                                               case 'a':
-                                                       /* Anonymous */
-                                                       x[0] = 'a';
+                                               case 'i':
+                                                       /* Invite-Only */
+                                                       x[0] = 'i';
                                                        break;
                                                case 'm':
                                                        /* Moderated */
@@ -211,18 +215,6 @@ GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
                                                        /* kein Schreiben in den Channel von aussen */
                                                        x[0] = 'n';
                                                        break;
-                                               case 'p':
-                                                       /* Private */
-                                                       x[0] = 'p';
-                                                       break;
-                                               case 'q':
-                                                       /* Quiet */
-                                                       x[0] = 'q';
-                                                       break;
-                                               case 's':
-                                                       /* Secret */
-                                                       x[0] = 's';
-                                                       break;
                                                case 't':
                                                        /* Topic Lock */
                                                        x[0] = 't';
@@ -367,7 +359,8 @@ GLOBAL BOOLEAN IRC_MODE( CLIENT *Client, REQUEST *Req )
 } /* IRC_MODE */
 
 
-GLOBAL BOOLEAN IRC_AWAY( CLIENT *Client, REQUEST *Req )
+GLOBAL BOOLEAN
+IRC_AWAY( CLIENT *Client, REQUEST *Req )
 {
        assert( Client != NULL );
        assert( Req != NULL );