Committer : klmitch
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2007-12-28 15:52:53 UTC
Modified files:
Tag: u2_10_12_branch
ChangeLog include/channel.h include/supported.h ircd/channel.c
Log message:
Author: Kev <[EMAIL PROTECTED]>
Log message:
This very simple change adds a +R channel mode that can only be set or
reset by remote users (or servers) or with /opmode. This can be used by X
to indicate that a channel is registered, a sentinal that C can use to
decide when it is legal to reop a channel.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.224 ircu2.10/ChangeLog:1.710.2.225
--- ircu2.10/ChangeLog:1.710.2.224 Thu Dec 13 18:37:48 2007
+++ ircu2.10/ChangeLog Fri Dec 28 07:52:43 2007
@@ -1,3 +1,14 @@
+2007-12-28 Kevin L. Mitchell <[EMAIL PROTECTED]>
+
+ * ircd/channel.c: add MODE_REGISTERED, mapped to +R; arrange to
+ only have it settable or clearable by remote users or /opmode
+
+ * include/supported.h (FEATURESVALUES2): update to include 'R'
+ channel mode
+
+ * include/channel.h: add MODE_REGISTERED, update infochanmodes to
+ include 'R' channel mode
+
2007-12-13 Kevin L. Mitchell <[EMAIL PROTECTED]>
* ircd/m_gline.c (ms_gline): if we got an activate or deactivate
Index: ircu2.10/include/channel.h
diff -u ircu2.10/include/channel.h:1.55.2.3 ircu2.10/include/channel.h:1.55.2.4
--- ircu2.10/include/channel.h:1.55.2.3 Sun Nov 4 19:01:34 2007
+++ ircu2.10/include/channel.h Fri Dec 28 07:52:43 2007
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Channel management and maintenance.
- * @version $Id: channel.h,v 1.55.2.3 2007/11/05 03:01:34 entrope Exp $
+ * @version $Id: channel.h,v 1.55.2.4 2007/12/28 15:52:43 klmitch Exp $
*/
#ifndef INCLUDED_channel_h
#define INCLUDED_channel_h
@@ -101,6 +101,8 @@
#define MODE_LIMIT 0x0400 /**< +l Limit */
#define MODE_REGONLY 0x0800 /**< Only +r users may join */
#define MODE_DELJOINS 0x1000 /**< New join messages are delayed */
+#define MODE_REGISTERED 0x2000 /**< Channel marked as registered
+ * (for future semantic expansion) */
#define MODE_SAVE 0x20000 /**< save this mode-with-arg 'til
* later */
#define MODE_FREE 0x40000 /**< string needs to be passed to
@@ -115,7 +117,7 @@
#define MODE_WPARAS
(MODE_CHANOP|MODE_VOICE|MODE_BAN|MODE_KEY|MODE_LIMIT|MODE_APASS|MODE_UPASS)
/** Available Channel modes */
-#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstUvrD" :
"biklmnopstvrD"
+#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "AbiklmnopstUvrDR" :
"biklmnopstvrDR"
/** Available Channel modes that take parameters */
#define infochanmodeswithparams feature_bool(FEAT_OPLEVELS) ? "AbkloUv" :
"bklov"
Index: ircu2.10/include/supported.h
diff -u ircu2.10/include/supported.h:1.20.2.2
ircu2.10/include/supported.h:1.20.2.3
--- ircu2.10/include/supported.h:1.20.2.2 Sun May 20 06:02:51 2007
+++ ircu2.10/include/supported.h Fri Dec 28 07:52:43 2007
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: supported.h,v 1.20.2.2 2007/05/20 13:02:51 entrope Exp $
+ * $Id: supported.h,v 1.20.2.3 2007/12/28 15:52:43 klmitch Exp $
*
* Description: This file has the featureset that ircu announces on connecting
* a client. It's in this .h because it's likely to be appended
@@ -65,7 +65,7 @@
#define FEATURESVALUES2 NICKLEN, TOPICLEN, AWAYLEN, TOPICLEN, \
feature_int(FEAT_CHANNELLEN), CHANNELLEN, \
(feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#"),
"(ov)@+", "@+", \
- (feature_bool(FEAT_OPLEVELS) ? "b,AkU,l,imnpstrDd" :
"b,k,l,imnpstrDd"), \
+ (feature_bool(FEAT_OPLEVELS) ? "b,AkU,l,imnpstrDdR" :
"b,k,l,imnpstrDdR"), \
"rfc1459", feature_str(FEAT_NETWORK)
#endif /* INCLUDED_supported_h */
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.155.2.19 ircu2.10/ircd/channel.c:1.155.2.20
--- ircu2.10/ircd/channel.c:1.155.2.19 Tue Nov 27 21:47:11 2007
+++ ircu2.10/ircd/channel.c Fri Dec 28 07:52:43 2007
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.155.2.19 2007/11/28 05:47:11 entrope Exp $
+ * @version $Id: channel.c,v 1.155.2.20 2007/12/28 15:52:43 klmitch Exp $
*/
#include "config.h"
@@ -832,6 +832,8 @@
*mbuf++ = 'D';
else if (MyUser(cptr) && (chptr->mode.mode & MODE_WASDELJOINS))
*mbuf++ = 'd';
+ if (chptr->mode.mode & MODE_REGISTERED)
+ *mbuf++ = 'R';
if (chptr->mode.limit) {
*mbuf++ = 'l';
ircd_snprintf(0, pbuf, buflen, "%u", chptr->mode.limit);
@@ -1540,6 +1542,7 @@
MODE_NOPRIVMSGS, 'n',
MODE_REGONLY, 'r',
MODE_DELJOINS, 'D',
+ MODE_REGISTERED, 'R',
/* MODE_KEY, 'k', */
/* MODE_BAN, 'b', */
MODE_LIMIT, 'l',
@@ -1953,7 +1956,7 @@
mode &= (MODE_ADD | MODE_DEL | MODE_PRIVATE | MODE_SECRET | MODE_MODERATED |
MODE_TOPICLIMIT | MODE_INVITEONLY | MODE_NOPRIVMSGS | MODE_REGONLY |
- MODE_DELJOINS | MODE_WASDELJOINS);
+ MODE_DELJOINS | MODE_WASDELJOINS | MODE_REGISTERED);
if (!(mode & ~(MODE_ADD | MODE_DEL))) /* don't add empty modes... */
return;
@@ -2113,6 +2116,7 @@
MODE_KEY, 'k',
MODE_APASS, 'A',
MODE_UPASS, 'U',
+ MODE_REGISTERED, 'R',
/* MODE_BAN, 'b', */
MODE_LIMIT, 'l',
MODE_REGONLY, 'r',
@@ -3178,6 +3182,11 @@
if (!state->mbuf)
return;
+ /* Local users are not permitted to change registration status */
+ if (flag_p[0] == MODE_REGISTERED && !(state->flags & MODE_PARSE_FORCE) &&
+ MyUser(state->sptr))
+ return;
+
if (state->dir == MODE_ADD) {
state->add |= flag_p[0];
state->del &= ~flag_p[0];
@@ -3221,6 +3230,7 @@
MODE_KEY, 'k',
MODE_APASS, 'A',
MODE_UPASS, 'U',
+ MODE_REGISTERED, 'R',
MODE_BAN, 'b',
MODE_LIMIT, 'l',
MODE_REGONLY, 'r',
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches