[IRC-Dev CVS] SF.net SVN: irc-dev: [192] ircd/trunk
Brought to you by:
zolty
|
From: <zo...@us...> - 2008-07-13 00:23:43
|
Revision: 192
http://irc-dev.svn.sourceforge.net/irc-dev/?rev=192&view=rev
Author: zolty
Date: 2008-07-12 17:23:49 -0700 (Sat, 12 Jul 2008)
Log Message:
-----------
nuevo modo de usuario +c
Modified Paths:
--------------
ircd/trunk/include/client.h
ircd/trunk/ircd/m_who.c
ircd/trunk/ircd/m_whois.c
ircd/trunk/ircd/s_user.c
Modified: ircd/trunk/include/client.h
===================================================================
--- ircd/trunk/include/client.h 2008-07-12 20:53:24 UTC (rev 191)
+++ ircd/trunk/include/client.h 2008-07-13 00:23:49 UTC (rev 192)
@@ -73,7 +73,7 @@
/** String containing valid user modes, in no particular order. */
#if defined(DDB) || defined(SERVICES)
-#define infousermodes "dioswkgxrRSZ"
+#define infousermodes "dioswkgxrRachBSZ"
#else
#define infousermodes "dioswkgxRZ"
#endif
@@ -159,8 +159,9 @@
#elif defined(DDB) || defined(SERVICES)
FLAG_NICKREG, /**< nick registered */
FLAG_NICKSUSPEND, /**< nick suspended */
- FLAG_HELPOPER, /**< nick is Help Operator */
FLAG_ADMIN, /**< nick is Services Admin */
+ FLAG_CODER, /**< nick is Services Coder */
+ FLAG_HELPOPER, /**< nick is Services Operator */
FLAG_BOT, /**< nick is Services Bot */
#endif
FLAG_MSGONLYREG, /**< only privmsg/notices from +r */
@@ -546,7 +547,12 @@
#define HasFlag(cli, flag) FlagHas(&cli_flags(cli), flag)
/** Return non-zero if the client is an IRC operator (global or local). */
+#if defined(DDB)
+#define IsAnOper(x) (HasFlag(x, FLAG_OPER) || HasFlag(x, FLAG_LOCOP) || HasFlag(x, FLAG_ADMIN) || \
+ HasFlag(x, FLAG_CODER) || HasFlag(x, FLAG_HELPOPER) || HasFlag(x, FLAG_BOT))
+#else
#define IsAnOper(x) (HasFlag(x, FLAG_OPER) || HasFlag(x, FLAG_LOCOP))
+#endif
/** Return non-zero if the client's connection is blocked. */
#define IsBlocked(x) HasFlag(x, FLAG_BLOCKED)
/** Return non-zero if the client's connection is still being burst. */
@@ -609,10 +615,12 @@
#define IsNickRegistered(x) HasFlag(x, FLAG_NICKREG)
/** Return non-zero if the client has set mode +S (nick suspended) */
#define IsNickSuspended(x) HasFlag(x, FLAG_NICKSUSPEND)
+/** Return non-zero if the client has set mode +a (Services Admin) */
+#define IsAdmin(x) HasFlag(x, FLAG_ADMIN)
+/** Return non-zero if the client has set mode +c (Network Coder) */
+#define IsCoder(x) HasFlag(x, FLAG_CODER)
/** Return non-zero if the client has set mode +h (Help Operator) */
#define IsHelpOper(x) HasFlag(x, FLAG_HELPOPER)
-/** Return non-zero if the client has set mode +a (Services Admin) */
-#define IsAdmin(x) HasFlag(x, FLAG_ADMIN)
/** Return non-zero if the client has set mode +B (Services Bot) */
#define IsBot(x) HasFlag(x, FLAG_BOT)
#endif
@@ -681,10 +689,12 @@
#define SetNickRegistered(x) SetFlag(x, FLAG_NICKREG)
/** Mark a client as having mode +S (nick suspended) */
#define SetNickSuspended(x) SetFlag(x, FLAG_NICKSUSPEND)
-/** Mark a client as having mode +h (Help Operator) */
-#define SetHelpOper(x) SetFlag(x, FLAG_HELPOPER)
/** Mark a client as having mode +a (Services Admin) */
#define SetAdmin(x) SetFlag(x, FLAG_ADMIN)
+/** Mark a client as having mode +c (Network Coder) */
+#define SetCoder(x) SetFlag(x, FLAG_CODER)
+/** Mark a client as having mode +h (Services Operator) */
+#define SetHelpOper(x) SetFlag(x, FLAG_HELPOPER)
/** Mark a client as having mode +B (Services Bot) */
#define SetBot(x) SetFlag(x, FLAG_BOT)
#endif
@@ -738,6 +748,10 @@
#define ClearHelpOper(x) ClrFlag(x, FLAG_HELPOPER)
/** Remode mode +A (Services Admin) from the client */
#define ClearAdmin(x) ClrFlag(x, FLAG_ADMIN)
+/** Remode mode +c (Network Coder) from the client */
+#define ClearCoder(x) ClrFlag(x, FLAG_CODER)
+/** Remode mode +h (Help Operator) from the client */
+#define ClearHelpOper(x) ClrFlag(x, FLAG_HELPOPER)
/** Remode mode +B (Services Bot) from the client */
#define ClearBot(x) ClrFlag(x, FLAG_BOT)
#endif
Modified: ircd/trunk/ircd/m_who.c
===================================================================
--- ircd/trunk/ircd/m_who.c 2008-07-12 20:53:24 UTC (rev 191)
+++ ircd/trunk/ircd/m_who.c 2008-07-13 00:23:49 UTC (rev 192)
@@ -285,6 +285,8 @@
*(p1++) = 'S';
if (IsAdmin(acptr))
*(p1++) = 'a';
+ if (IsCoder(acptr))
+ *(p1++) = 'c';
if (IsHelpOper(acptr))
*(p1++) = 'h';
if (IsBot(acptr))
Modified: ircd/trunk/ircd/m_whois.c
===================================================================
--- ircd/trunk/ircd/m_whois.c 2008-07-12 20:53:24 UTC (rev 191)
+++ ircd/trunk/ircd/m_whois.c 2008-07-13 00:23:49 UTC (rev 192)
@@ -166,7 +166,18 @@
send_reply(sptr, RPL_WHOISSUSPEND, name);
if (SeeOper(sptr,acptr))
- send_reply(sptr, RPL_WHOISOPERATOR, name);
+ {
+ if (IsAdmin(acptr))
+ send_reply(sptr, SND_EXPLICIT | RPL_WHOISOPERATOR, "%s :is a Services Administrator", name);
+ else if (IsCoder(acptr))
+ send_reply(sptr, SND_EXPLICIT | RPL_WHOISOPERATOR, "%s :is a Network Coder", name);
+ else if (IsHelpOper(acptr))
+ send_reply(sptr, SND_EXPLICIT | RPL_WHOISOPERATOR, "%s :is a Services Operator", name);
+ else if (IsOper(acptr))
+ send_reply(sptr, RPL_WHOISOPERATOR, name);
+ else
+ send_reply(sptr, SND_EXPLICIT | RPL_WHOISOPERATOR, "%s :is a Local IRC Operator", name);
+ }
if (IsBot(acptr))
send_reply(sptr, RPL_WHOISBOT, name, feature_str(FEAT_NETWORK));
Modified: ircd/trunk/ircd/s_user.c
===================================================================
--- ircd/trunk/ircd/s_user.c 2008-07-12 20:53:24 UTC (rev 191)
+++ ircd/trunk/ircd/s_user.c 2008-07-13 00:23:49 UTC (rev 192)
@@ -530,6 +530,7 @@
{ FLAG_NICKREG, 'r' },
{ FLAG_NICKSUSPEND, 'S' },
{ FLAG_ADMIN, 'a' },
+ { FLAG_CODER, 'c' },
{ FLAG_HELPOPER, 'h' },
{ FLAG_BOT, 'B' },
{ FLAG_MSGONLYREG, 'R' },
@@ -1528,6 +1529,12 @@
else
ClearAdmin(sptr);
break;
+ case 'c':
+ if (what == MODE_ADD)
+ SetCoder(sptr);
+ else
+ ClearCoder(sptr);
+ break;
case 'h':
if (what == MODE_ADD)
SetHelpOper(sptr);
@@ -1604,6 +1611,8 @@
ClearNickSuspended(sptr);
if (!FlagHas(&setflags, FLAG_ADMIN))
ClearAdmin(sptr);
+ if (!FlagHas(&setflags, FLAG_CODER))
+ ClearCoder(sptr);
if (!FlagHas(&setflags, FLAG_HELPOPER))
ClearHelpOper(sptr);
if (!FlagHas(&setflags, FLAG_BOT))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|