Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2006-11-04 22:01:47 UTC
Modified files:
ircd/version.c.SH ircd/m_who.c ircd/m_nick.c ircd/channel.c
doc/readme.who ChangeLog
Log message:
Merge changes from u2_10_12_branch.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.821 ircu2.10/ChangeLog:1.822
--- ircu2.10/ChangeLog:1.821 Sat Oct 21 08:37:09 2006
+++ ircu2.10/ChangeLog Sat Nov 4 14:01:36 2006
@@ -1,3 +1,28 @@
+2006-11-04 Michael Poole <[EMAIL PROTECTED]>
+
+ * ircd/m_nick.c (m_nick): If we get NICK on a server port, tell
+ the client to go away.
+
+2006-11-04 Michael Poole <[EMAIL PROTECTED]>
+
+ * ircd/version.c.SH: Skip version.c.
+
+2006-11-04 Michael Poole <[EMAIL PROTECTED]>
+
+ * doc/readme.who: Document new 'o' field flag.
+
+ * ircd/channel.c (send_channel_modes): Rename feat_oplevels to
+ send_oplevels and determine it automatically.
+ (modebuf_flush_int): Pass along oplevel if it's less than
+ MAXOPLEVEL.
+ (mode_process_clients): Allow oplevels to be inherited for -A
+ channels. Inherit the opper's oplevel if >= MAXOPLEVEL.
+
+ * ircd/m_who.c (WHO_FIELD_OPL): New flag.
+ (do_who): Send oplevel for WHO_FIELD_OPL, but only show up to the
+ requester's own oplevel.
+ (m_who): Recognize 'o' flag as WHO_FIELD_OPL.
+
2006-10-21 Michael Poole <[EMAIL PROTECTED]>
* ircd/convert-conf.c (finish_connects): Fix error display for
Index: ircu2.10/doc/readme.who
diff -u ircu2.10/doc/readme.who:1.5 ircu2.10/doc/readme.who:1.6
--- ircu2.10/doc/readme.who:1.5 Thu Apr 6 20:46:12 2006
+++ ircu2.10/doc/readme.who Sat Nov 4 14:01:36 2006
@@ -99,6 +99,7 @@
t : Include the querytype in the reply
u : Include userID with eventual ~
a : Include account name
+ o : Include oplevel (shows 999 to users without ops in the channel)
And the ,<querytype> final option can be used to specify what you want the
server to say in the querytype field of the output, useful to filter the
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.174 ircu2.10/ircd/channel.c:1.175
--- ircu2.10/ircd/channel.c:1.174 Sun Jul 23 19:08:33 2006
+++ ircu2.10/ircd/channel.c Sat Nov 4 14:01:35 2006
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Channel management and maintenance
- * @version $Id: channel.c,v 1.174 2006/07/24 02:08:33 entrope Exp $
+ * @version $Id: channel.c,v 1.175 2006/11/04 22:01:35 entrope Exp $
*/
#include "config.h"
@@ -887,7 +887,7 @@
int opped_members_index = 0;
struct Membership** opped_members = NULL;
int last_oplevel = 0;
- int feat_oplevels = (chptr->mode.apass[0]) != '\0';
+ int send_oplevels = 0;
assert(0 != cptr);
assert(0 != chptr);
@@ -945,6 +945,9 @@
++number_of_ops;
else
opped_members[opped_members_index++] = member;
+ /* We also send oplevels if anyone is below the weakest level. */
+ if (OpLevel(member) < MAXOPLEVEL)
+ send_oplevels = 1;
}
/* Only handle the members with the flags that we are interested in. */
if ((member->status & CHFL_VOICED_OR_OPPED) == current_flags[flag_cnt])
@@ -985,7 +988,7 @@
if (IsChanOp(member)) /* flag_cnt == 2 or 3 */
{
/* append the absolute value of the oplevel */
- if (feat_oplevels)
+ if (send_oplevels)
loc += ircd_snprintf(0, tbuf + loc, sizeof(tbuf) - loc, "%u",
last_oplevel = member->oplevel);
else
tbuf[loc++] = 'o';
@@ -994,7 +997,7 @@
msgq_append(&me, mb, tbuf);
new_mode = 0;
}
- else if (feat_oplevels && flag_cnt > 1 && last_oplevel !=
member->oplevel)
+ else if (send_oplevels && flag_cnt > 1 && last_oplevel !=
member->oplevel)
{
/*
* This can't be the first member of a (continued) BURST
@@ -1794,8 +1797,7 @@
}
/* if we're changing oplevels and we know the oplevel, pass it on */
- if (mbuf->mb_channel->mode.apass[0]
- && (MB_TYPE(mbuf, i) & MODE_CHANOP)
+ if ((MB_TYPE(mbuf, i) & MODE_CHANOP)
&& MB_OPLEVEL(mbuf, i) < MAXOPLEVEL)
*strptr_i += ircd_snprintf(0, strptr + *strptr_i, BUFSIZE -
*strptr_i,
" %s%s:%d",
@@ -3071,8 +3073,8 @@
SetOpLevel(member, state->cli_change[i].oplevel);
else if (!state->member)
SetOpLevel(member, MAXOPLEVEL);
- else if (!state->chptr->mode.apass[0] || OpLevel(state->member) ==
MAXOPLEVEL)
- SetOpLevel(member, MAXOPLEVEL);
+ else if (OpLevel(state->member) >= MAXOPLEVEL)
+ SetOpLevel(member, OpLevel(state->member));
else
SetOpLevel(member, OpLevel(state->member) + 1);
}
Index: ircu2.10/ircd/m_nick.c
diff -u ircu2.10/ircd/m_nick.c:1.29 ircu2.10/ircd/m_nick.c:1.30
--- ircu2.10/ircd/m_nick.c:1.29 Sun Jul 23 11:04:21 2006
+++ ircu2.10/ircd/m_nick.c Sat Nov 4 14:01:34 2006
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_nick.c,v 1.29 2006/07/23 18:04:21 entrope Exp $
+ * $Id: m_nick.c,v 1.30 2006/11/04 22:01:34 entrope Exp $
*/
#include "config.h"
@@ -104,6 +104,9 @@
assert(0 != cptr);
assert(cptr == sptr);
+ if (IsServerPort(cptr))
+ return exit_client(cptr, cptr, &me, "Use a different port");
+
/*
* parv[0] will be empty for clients connecting for the first time
*/
@@ -113,6 +116,7 @@
send_reply(sptr, ERR_NONICKNAMEGIVEN);
return 0;
}
+
/*
* Don't let them send make us send back a really long string of
* garbage
Index: ircu2.10/ircd/m_who.c
diff -u ircu2.10/ircd/m_who.c:1.24 ircu2.10/ircd/m_who.c:1.25
--- ircu2.10/ircd/m_who.c:1.24 Fri Sep 30 20:42:13 2005
+++ ircu2.10/ircd/m_who.c Sat Nov 4 14:01:34 2006
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_who.c,v 1.24 2005/10/01 03:42:13 entrope Exp $
+ * $Id: m_who.c,v 1.25 2006/11/04 22:01:34 entrope Exp $
*/
#include "config.h"
@@ -80,6 +80,7 @@
#define WHO_FIELD_REN 512 /**< Show realname (info). */
#define WHO_FIELD_IDL 1024 /**< Show idle time. */
#define WHO_FIELD_ACC 2048 /**< Show account name. */
+#define WHO_FIELD_OPL 4096 /**< Show oplevel. */
/** Default fields for /WHO */
#define WHO_FIELD_DEF ( WHO_FIELD_NIC | WHO_FIELD_UID | WHO_FIELD_HOS |
WHO_FIELD_SER )
@@ -303,6 +304,23 @@
*(p1++) = '0';
}
+ if (fields & WHO_FIELD_OPL)
+ {
+ if (!chan || !IsChanOp(chan))
+ {
+ strcpy(p1, " n/a");
+ p1 += 4;
+ }
+ else
+ {
+ int vis_level = MAXOPLEVEL;
+ if ((IsGlobalChannel(chan->channel->chname) ? IsOper(sptr) :
IsAnOper(sptr))
+ || is_chan_op(sptr, chan->channel))
+ vis_level = OpLevel(chan);
+ p1 += ircd_snprintf(0, p1, 5, " %d", vis_level);
+ }
+ }
+
if (!fields || (fields & WHO_FIELD_REN))
{
char *p2 = cli_info(acptr);
@@ -474,6 +492,10 @@
case 'A':
fields |= WHO_FIELD_ACC;
break;
+ case 'o':
+ case 'O':
+ fields |= WHO_FIELD_OPL;
+ break;
default:
break;
}
Index: ircu2.10/ircd/version.c.SH
diff -u ircu2.10/ircd/version.c.SH:1.7 ircu2.10/ircd/version.c.SH:1.8
--- ircu2.10/ircd/version.c.SH:1.7 Mon Jun 14 18:20:35 2004
+++ ircu2.10/ircd/version.c.SH Sat Nov 4 14:01:34 2006
@@ -84,15 +84,17 @@
!SUB!THIS!
for file in ${srcdir}/ircd/*.c ; do
- echo " \"[" `./umkpasswd -5 $file` " ]\"," >> version.c
-done;
+ if [ `basename $file` != version.c ] ; then
+ echo " \"[" `./umkpasswd -5 $file` " ]\"," >> version.c
+ fi
+done
echo " \"\"," >> version.c
echo " \"Headers:\"," >> version.c
for file in ${srcdir}/include/*.h ; do
echo " \"[" `./umkpasswd -5 $file` " ]\"," >> version.c
-done;
+done
/bin/cat >>version.c <<!SUB!THIS!
0,
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches