Compare commits

...

10 Commits

Author SHA1 Message Date
Sam Dodrill ac2dfa08ff Change the oper-up message to something more fitting 2014-06-01 17:22:12 -07:00
Sam Dodrill 246a41fd4e modules/m_whois: TODO added 2014-06-01 16:13:57 -07:00
Sam Dodrill 5cbf96e318 Add UMODE +I to hide channels in WHOIS line
Does not hide channels from IRC operators.
2014-06-01 16:11:04 -07:00
Sam Dodrill 624e2c5aa5 Add channel mode +u to hide bans/quiets from non chanops 2014-05-28 18:54:39 -07:00
Sam Dodrill ccfdbe7bb9 Tell Atheme about +u 2014-05-28 18:54:35 -07:00
Sam Dodrill 13c46e5812 src/messages.tab: make quiet +Q 2014-05-28 18:54:22 -07:00
Sam Dodrill 5fdbc1ebfb modules/m_whois: Server hiding in WHOIS 2014-05-28 17:03:09 -07:00
Sam Dodrill 7dfd0a40cc README: Clarify IHW patches 2014-05-28 16:51:20 -07:00
Sam Dodrill 53df278f9c Use unreal prefixes
+q is now owner mode
+Q is now quiet mode
+y is now not used

! prefix changed to &
2014-05-28 16:33:54 -07:00
Sam Dodrill 047d0992c1 Start work on irchighway specific changes 2014-05-28 15:40:41 -07:00
19 changed files with 69 additions and 46 deletions

View File

@ -1,5 +1,9 @@
# Elemental-IRCd
# This is the IRCHighway branch. This will not link to other Elemental-IRCd instances without the specific patches in this version.
# YOU WILL NOT GET SUPPORT FOR THIS BRANCH. DO NOT ASK.
**Elemental-IRCd** is a high performance, lightweight, and scalable
IRC daemon. It is a fork of the now-defunct ShadowIRCD and seeks to continue in
the direction ShadowIRCD was headed.

View File

@ -10,7 +10,7 @@ AC_PREREQ(2.57)
dnl Sneaky way to get an Id tag into the configure script
AC_COPYRIGHT([2014 elemental-ircd Team])
AC_INIT([elemental-ircd],[6.5.1])
AC_INIT([elemental-ircd+ihw],[6.5.2])
AC_CONFIG_HEADER(include/setup.h)

View File

@ -106,7 +106,7 @@ mo_ojoin(struct Client *client_p, struct Client *source_p, int parc, const char
sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN %s",
source_p->name,
source_p->username, source_p->host, chptr->chname);
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +y %s",
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +q %s",
me.name, chptr->chname, source_p->name);
}
else if(*parv[1] == '!' && ConfigChannel.use_admin)

View File

@ -123,7 +123,7 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
set_channel_mode(client_p, source_p->servptr, chptr, msptr,
parc - 2, parv + 2);
#else
if (parc == 4 && !strcmp(parv[2], "+y") && !irccmp(parv[3], source_p->name))
if (parc == 4 && !strcmp(parv[2], "+q") && !irccmp(parv[3], source_p->name))
{
/* Ownering themselves */
if (!wasonchannel)
@ -132,10 +132,10 @@ mo_omode(struct Client *client_p, struct Client *source_p, int parc, const char
form_str(ERR_USERNOTINCHANNEL), parv[3], chptr->chname);
return 0;
}
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +y %s",
sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +q %s",
me.name, parv[1], source_p->name);
sendto_server(NULL, chptr, CAP_TS6, NOCAPS,
":%s TMODE %ld %s +y %s",
":%s TMODE %ld %s +q %s",
me.id, (long) chptr->channelts, parv[1],
source_p->id);
msptr->flags |= CHFL_OWNER;

View File

@ -17,7 +17,7 @@
#include "version.h"
IRCDVar myIrcd[] = {
{"Elemental-IRCd 6.5", /* ircd name */
{"Elemental-IRCd+ihw 6.5", /* ircd name */
"+oiS", /* nickserv mode */
"+oiS", /* chanserv mode */
"+oiS", /* memoserv mode */
@ -38,13 +38,13 @@ IRCDVar myIrcd[] = {
"+oiS", /* Global alias mode */
"+oiS", /* Used by BotServ Bots */
2, /* Chan Max Symbols */
"-cijlmnpstrgzQF", /* Modes to Remove */
"+ao", /* Channel Umode used by Botserv bots */
"-cijlmnpstrgzF", /* Modes to Remove */
"+o", /* Channel Umode used by Botserv bots */
1, /* SVSNICK */
1, /* Vhost */
1, /* Has Owner */
"+y", /* Mode to set for an owner */
"-y", /* Mode to unset for an owner */
"+q", /* Mode to set for an owner */
"-q", /* Mode to unset for an owner */
"+a", /* Mode to set for chan admin */
"-a", /* Mode to unset for chan admin */
NULL, /* Mode On Reg */

View File

@ -33,7 +33,7 @@ class ChannelModeLargeBan : public ChannelMode
class ElementalProto : public IRCDProto
{
public:
ElementalProto(Module *creator) : IRCDProto(creator, "Elemental-IRCd 6.5+")
ElementalProto(Module *creator) : IRCDProto(creator, "Elemental-IRCd+ihw 6.5+")
{
DefaultPseudoclientModes = "+oiS";
CanCertFP = true;
@ -378,8 +378,8 @@ class ProtoElemental : public Module
ModeManager::AddChannelMode(new ChannelModeStatus("VOICE", 'v', '+', 0));
ModeManager::AddChannelMode(new ChannelModeStatus("HALFOP", 'h', '%', 1));
ModeManager::AddChannelMode(new ChannelModeStatus("OP", 'o', '@', 2);
ModeManager::AddChannelMode(new ChannelModeStatus("PROTECT", 'a', '!', 3));
ModeManager::AddChannelMode(new ChannelModeStatus("OWNER", 'y', '~', 4));
ModeManager::AddChannelMode(new ChannelModeStatus("PROTECT", 'a', '&', 3));
ModeManager::AddChannelMode(new ChannelModeStatus("OWNER", 'q', '~', 4));
}
public:

View File

@ -19,7 +19,7 @@ DECLARE_MODULE_V1("protocol/elemental-ircd", true, _modinit, NULL, PACKAGE_STRIN
/* *INDENT-OFF* */
ircd_t elemental_ircd = {
"elemental-ircd", /* IRCd name */
"elemental-ircd+ihw", /* IRCd name */
"$$", /* TLD Prefix, used by Global. */
true, /* Whether or not we use IRCNet/TS6 UID */
false, /* Whether or not we use RCOMMAND */
@ -32,13 +32,13 @@ ircd_t elemental_ircd = {
CSTATUS_OWNER, /* Integer flag for owner channel flag. */
CSTATUS_PROTECT, /* Integer flag for protect channel flag. */
CSTATUS_HALFOP, /* Integer flag for halfops. */
"+y", /* Mode we set for owner. */
"+q", /* Mode we set for owner. */
"+a", /* Mode we set for protect. */
"+h", /* Mode we set for halfops. */
PROTOCOL_SHADOWIRCD, /* Protocol type */
CMODE_PERM, /* Permanent cmodes */
CMODE_IMMUNE, /* Oper-immune cmode */
"beIq", /* Ban-like cmodes */
"beIQ", /* Ban-like cmodes */
'e', /* Except mchar */
'I', /* Invex mchar */
IRCD_CIDR_BANS | IRCD_HOLDNICK /* Flags */
@ -58,7 +58,6 @@ struct cmode_ elemental_mode_list[] = {
{ 'L', CMODE_EXLIMIT},
{ 'P', CMODE_PERM },
{ 'F', CMODE_FTARGET},
{ 'Q', CMODE_DISFWD },
{ 'M', CMODE_IMMUNE },
{ 'C', CMODE_NOCTCP },
{ 'A', CMODE_ADMINONLY },
@ -71,11 +70,12 @@ struct cmode_ elemental_mode_list[] = {
{ 'd', CMODE_NONICKS },
{ 'K', CMODE_NOREPEAT },
{ 'J', CMODE_KICKNOREJOIN },
{ 'u', CMODE_NOFORWARD },
{ '\0', 0 }
};
struct cmode_ elemental_status_mode_list[] = {
{ 'y', CSTATUS_OWNER },
{ 'q', CSTATUS_OWNER },
{ 'a', CSTATUS_PROTECT },
{ 'o', CSTATUS_OP },
{ 'h', CSTATUS_HALFOP },
@ -85,7 +85,7 @@ struct cmode_ elemental_status_mode_list[] = {
struct cmode_ elemental_prefix_mode_list[] = {
{ '~', CSTATUS_OWNER },
{ '!', CSTATUS_PROTECT },
{ '&', CSTATUS_PROTECT },
{ '@', CSTATUS_OP },
{ '%', CSTATUS_HALFOP },
{ '+', CSTATUS_VOICE },

View File

@ -25,4 +25,6 @@ User modes: (* designates that the umode is oper only)
+G - "soft caller id" mode - same as +g but automatically allows
anyone who's in a common channel with you to message you.
+V - Prevents you from receiving invites.
+I - Prevents non-opers from seeing your channel list in
a whois query.
+Z - Is connected via SSL (set only on connection).

View File

@ -14,6 +14,8 @@ User modes: (? designates that the umode is provided by an extension
+B - Marks you as a bot in /whois.
+C - Prevents you from receiving CTCPs other than ACTION.
+D - Deaf - ignores all channel messages.
+I - Prevents non-opers from seeing your channel list in
a whois query.
+Q - Prevents you from being affected by channel forwarding.
+R - Prevents non accept unidentified users from messaging you.
+G - "soft caller id" mode - same as +g but automatically allows

View File

@ -191,6 +191,7 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
#define MODE_NOREJOIN 0x200000 /* Block rejoin immediately after kick */
#define MODE_NOREPEAT 0x400000 /* Block repeat messages */
#define MODE_NOOPERKICK 0x800000 /* disallow kicking opers */
#define MODE_HIDEBANS 0x1000000 /* disallow non-chanops from seeing ban/quiet lists */
#define CHFL_BAN 0x10000000 /* ban channel flag */
#define CHFL_EXCEPTION 0x20000000 /* exception to ban channel flag */

View File

@ -426,6 +426,7 @@ struct ListClient
#define UMODE_NOINVITE 0x0800 /* block invites */
#define UMODE_BOT 0x8000 /* mark as a bot in whois */
#define UMODE_SCALLERID 0x40000 /* soft caller id */
#define UMODE_HIDECHANS 0x80000 /* hide channels in whois */
/* user information flags, only settable by remote mode or local oper */
#define UMODE_OPER 0x1000 /* Operator */

View File

@ -553,7 +553,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
fl |= CHFL_OWNER;
s++;
}
else if(*s == '!')
else if(*s == '&')
{
fl |= CHFL_ADMIN;
s++;
@ -601,7 +601,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
}
else if(fl & CHFL_ADMIN)
{
*ptr_uid++ = '!';
*ptr_uid++ = '&';
len_nick++;
len_uid++;
}
@ -647,7 +647,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, int parc, const char
if(fl & CHFL_OWNER)
{
*mbuf++ = 'y';
*mbuf++ = 'q';
para[pargs++] = target_p->name;
if(fl & CHFL_ADMIN)
@ -1139,7 +1139,7 @@ remove_our_modes(struct Channel *chptr, struct Client *source_p)
{
msptr->flags &= ~CHFL_ADMIN;
lpara[count++] = msptr->client_p->name;
*mbuf++ = 'y';
*mbuf++ = 'q';
/* Make sure it fits if +h, +o, or +v are involved */
if(is_admin(msptr))

View File

@ -653,7 +653,7 @@ static struct InfoStruct info_table[] = {
"use_owner",
OUTPUT_BOOLEAN_YN,
&ConfigChannel.use_owner,
"Enable chanmode +y (owner)",
"Enable chanmode +q (owner)",
},
{
"use_except",

View File

@ -276,7 +276,7 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
t = buf + mlen;
if (!IsService(target_p))
if (!IsService(target_p) && (!(target_p->umodes & UMODE_HIDECHANS) || IsOper(source_p)))
{
RB_DLINK_FOREACH(ptr, target_p->user->channel.head)
{
@ -307,9 +307,15 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
if(cur_len > mlen + extra_space)
sendto_one(source_p, "%s", buf);
sendto_one_numeric(source_p, RPL_WHOISSERVER, form_str(RPL_WHOISSERVER),
target_p->name, target_p->servptr->name,
target_p->servptr->info);
if(IsOper(source_p)) {
sendto_one_numeric(source_p, RPL_WHOISSERVER, form_str(RPL_WHOISSERVER),
target_p->name, target_p->servptr->name,
target_p->servptr->info);
} else {
//TODO: change this to a config value
sendto_one_numeric(source_p, RPL_WHOISSERVER, form_str(RPL_WHOISSERVER),
target_p->name, "irc.server", "An IRC server");
}
if(target_p->user->away)
sendto_one_numeric(source_p, RPL_AWAY, form_str(RPL_AWAY),

View File

@ -195,8 +195,8 @@ find_channel_status(struct membership *msptr, int combine)
if(is_admin(msptr))
{
if(!combine)
return "!";
*p++ = '!';
return "&";
*p++ = '&';
}
if(is_chanop(msptr))

View File

@ -150,13 +150,13 @@ construct_cflag_param_string(void)
*cflagsparaminfo = '\0';
rb_snprintf(cflagsparaminfo, sizeof cflagsparaminfo, "%s%sb%s%s%s%sklov%s%s",
ConfigChannel.use_owner ? "y" : "",
ConfigChannel.use_owner ? "q" : "",
ConfigChannel.use_admin ? "a" : "",
ConfigChannel.use_except ? "e" : "",
ConfigChannel.use_forward ? "f" : "",
ConfigChannel.use_halfop ? "h" : "",
strchr(ConfigChannel.disabledmodes, 'j') ? "" : "j",
strchr(ConfigChannel.disabledmodes, 'q') ? "" : "q",
strchr(ConfigChannel.disabledmodes, 'Q') ? "" : "Q",
ConfigChannel.use_invex ? "I" : "");
}
@ -907,6 +907,12 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
}
}
if(chptr->mode.mode & MODE_HIDEBANS) {
if(alevel != CHFL_CHANOP && alevel != CHFL_ADMIN && alevel != CHFL_HALFOP && alevel != CHFL_OWNER) {
goto skiplistdone;
}
}
RB_DLINK_FOREACH(ptr, list->head)
{
banptr = ptr->data;
@ -914,6 +920,7 @@ chm_ban(struct Client *source_p, struct Channel *chptr,
me.name, source_p->name, chptr->chname,
banptr->banstr, banptr->who, banptr->when);
}
skiplistdone:
sendto_one(source_p, form_str(rpl_endlist), me.name, source_p->name, chptr->chname);
return;
}
@ -1968,7 +1975,7 @@ struct ChannelMode chmode_table[256] =
{chm_nosuch, 0 }, /* N */
{chm_nosuch, 0 }, /* O */
{chm_staff, MODE_PERMANENT }, /* P */
{chm_simple, MODE_DISFORWARD }, /* Q */
{chm_ban, CHFL_QUIET }, /* Q */
{chm_nosuch, 0 }, /* R */
{chm_nosuch, 0 }, /* S */
{chm_simple, MODE_NONOTICE }, /* T */
@ -2000,15 +2007,15 @@ struct ChannelMode chmode_table[256] =
{chm_simple, MODE_NOPRIVMSGS }, /* n */
{chm_op, 0 }, /* o */
{chm_simple, MODE_PRIVATE }, /* p */
{chm_ban, CHFL_QUIET }, /* q */
{chm_owner, 0 }, /* q */
{chm_simple, MODE_REGONLY }, /* r */
{chm_simple, MODE_SECRET }, /* s */
{chm_simple, MODE_TOPICLIMIT }, /* t */
{chm_nosuch, 0 }, /* u */
{chm_simple, MODE_HIDEBANS }, /* u */
{chm_voice, 0 }, /* v */
{chm_nosuch, 0 }, /* w */
{chm_nosuch, 0 }, /* x */
{chm_owner, 0 }, /* y */
{chm_nosuch, 0 }, /* y */
{chm_simple, MODE_OPMODERATE }, /* z */
{chm_nosuch, 0 }, /* 0x7b */

View File

@ -402,7 +402,7 @@ static const char * replies[] = {
/* 378 RPL_WHOISHOST, */ "%s :is connecting from *@%s %s",
/* 379 RPL_WHOISMODES */ "%s :is using modes %s",
/* 380 */ NULL,
/* 381 RPL_YOUREOPER, */ ":%s 381 %s :Making sense? Aw, what fun is there in making sense?",
/* 381 RPL_YOUREOPER, */ ":%s 381 %s :O:Line Gangnam Style",
/* 382 RPL_REHASHING, */ ":%s 382 %s %s :Rehashing",
/* 383 */ NULL,
/* 384 RPL_MYPORTIS, */ NULL,
@ -749,8 +749,8 @@ static const char * replies[] = {
/* 725 RPL_TESTLINE */ ":%s 725 %s %c %ld %s :%s",
/* 726 RPL_NOTESTLINE */ ":%s 726 %s %s :No matches",
/* 727 RPL_TESTMASKGECOS */ ":%s 727 %s %d %d %s!%s@%s %s :Local/remote clients match",
/* 728 RPL_QUIETLIST */ ":%s 728 %s %s q %s %s %lu",
/* 729 RPL_ENDOFQUIETLIST */ ":%s 729 %s %s q :End of Channel Quiet List",
/* 728 RPL_QUIETLIST */ ":%s 728 %s %s Q %s %s %lu",
/* 729 RPL_ENDOFQUIETLIST */ ":%s 729 %s %s Q :End of Channel Quiet List",
/* 730 RPL_MONONLINE */ ":%s 730 %s :%s",
/* 731 RPL_MONOFFLINE */ ":%s 731 %s :%s",
/* 732 RPL_MONLIST */ ":%s 732 %s :%s",

View File

@ -74,7 +74,7 @@ int user_modes[256] = {
0, /* F */
UMODE_SCALLERID, /* G */
0, /* H */
0, /* I */
UMODE_HIDECHANS, /* I */
0, /* J */
0, /* K */
0, /* L */
@ -1538,7 +1538,7 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use
if(is_owner(mscptr))
{
*mptr++ = 'y';
*mptr++ = 'q';
strcat(modeval, nick);
strcat(modeval, " ");
}

View File

@ -260,11 +260,11 @@ isupport_prefix(const void *ptr)
static char result[13];
rb_snprintf(result, sizeof result, "(%s%so%sv)%s%s@%s+",
ConfigChannel.use_owner ? "y" : "",
ConfigChannel.use_owner ? "q" : "",
ConfigChannel.use_admin ? "a" : "",
ConfigChannel.use_halfop ? "h" : "",
ConfigChannel.use_owner ? "~" : "",
ConfigChannel.use_admin ? "!" : "",
ConfigChannel.use_admin ? "&" : "",
ConfigChannel.use_halfop ? "%" : "");
return result;
}
@ -274,7 +274,7 @@ isupport_maxlist(const void *ptr)
{
static char result[30];
rb_snprintf(result, sizeof result, "bq%s%s:%i",
rb_snprintf(result, sizeof result, "bQ%s%s:%i",
ConfigChannel.use_except ? "e" : "",
ConfigChannel.use_invex ? "I" : "",
ConfigChannel.max_bans);
@ -313,7 +313,7 @@ isupport_ownermode(const void *ptr)
if(!ConfigChannel.use_owner)
return NULL;
rb_snprintf(result, sizeof result, "y");
rb_snprintf(result, sizeof result, "q");
return result;
}
@ -332,7 +332,7 @@ init_isupport(void)
add_isupport("CHANMODES", isupport_chanmodes, NULL);
add_isupport("CHANLIMIT", isupport_chanlimit, NULL);
add_isupport("PREFIX", isupport_prefix, NULL);
add_isupport("OWNER", isupport_ownermode, NULL);
//add_isupport("OWNER", isupport_ownermode, NULL);
add_isupport("MAXLIST", isupport_maxlist, NULL);
add_isupport("MODES", isupport_intptr, &maxmodes);
add_isupport("NETWORK", isupport_stringptr, &ServerInfo.network_name);