[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2007-04-21 16:21:16
|
Committer : zolty CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2007-04-21 16:20:29 UTC Modified files: ChangeLog ChangeLog.es include/channel.h include/client.h include/ircd_features.h include/patchlevel.h include/struct.h ircd/channel.c ircd/m_bmode.c ircd/m_burst.c ircd/m_create.c ircd/m_invite.c ircd/m_join.c ircd/m_kick.c ircd/m_lusers.c ircd/m_mode.c ircd/m_notice.c ircd/m_part.c ircd/m_privmsg.c ircd/m_server.c ircd/m_wallchops.c ircd/m_wallvoices.c ircd/s_debug.c ircd/s_misc.c ircd/s_user.c Log message: Author: zo...@ir... Log message: 2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta2 * Eliminar restos soporte P09 * Nueva estructura Invite ---------------------- diff included ---------------------- Index: ircd-ircdev/ChangeLog diff -u ircd-ircdev/ChangeLog:1.50 ircd-ircdev/ChangeLog:1.51 --- ircd-ircdev/ChangeLog:1.50 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/ChangeLog Sat Apr 21 09:20:17 2007 @@ -1,10 +1,14 @@ # # ChangeLog for ircd-ircdev # -# $Id: ChangeLog,v 1.50 2007/04/19 22:53:46 zolty Exp $ +# $Id: ChangeLog,v 1.51 2007/04/21 16:20:17 zolty Exp $ # # Insert new changes at beginning of the change list. # +2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta2 + * Remove P09 support rests + * New Invite structure + 2007-04-20 Toni Garc�a <zo...@ir...> 1.0.beta1 * Write doxygen comments * Statics Index: ircd-ircdev/ChangeLog.es diff -u ircd-ircdev/ChangeLog.es:1.50 ircd-ircdev/ChangeLog.es:1.51 --- ircd-ircdev/ChangeLog.es:1.50 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/ChangeLog.es Sat Apr 21 09:20:17 2007 @@ -1,10 +1,14 @@ # # Log de Cambios para ircd-ircdev # -# $Id: ChangeLog.es,v 1.50 2007/04/19 22:53:46 zolty Exp $ +# $Id: ChangeLog.es,v 1.51 2007/04/21 16:20:17 zolty Exp $ # # Insertar los nuevos cambios al principio de esta lista de cambios. # +2007-04-21 Toni Garc�a <zo...@ir...> 1.0.beta2 + * Eliminar restos soporte P09 + * Nueva estructura Invite + 2007-04-20 Toni Garc�a <zo...@ir...> 1.0.beta1 * Escribir comentarios de doxygen * Statics Index: ircd-ircdev/include/channel.h diff -u ircd-ircdev/include/channel.h:1.16 ircd-ircdev/include/channel.h:1.17 --- ircd-ircdev/include/channel.h:1.16 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/channel.h Sat Apr 21 09:20:17 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Channel management and maintenance. - * @version $Id: channel.h,v 1.16 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: channel.h,v 1.17 2007/04/21 16:20:17 zolty Exp $ */ #ifndef INCLUDED_channel_h #define INCLUDED_channel_h @@ -63,8 +63,6 @@ #define CHFL_CHANOP 0x0001 /**< Channel operator */ #define CHFL_VOICE 0x0002 /**< the power to speak */ -#define CHFL_DEOPPED 0x0004 /**< Is de-opped by a server */ -#define CHFL_SERVOPOK 0x0008 /**< Server op allowed */ #define CHFL_ZOMBIE 0x0010 /**< Kicked from channel */ #define CHFL_BURST_JOINED 0x0100 /**< Just joined by net.junction */ #define CHFL_BANVALID 0x0800 /**< CHFL_BANNED bit is valid */ @@ -204,15 +202,6 @@ */ #define TS_LAG_TIME 86400 -/** - * A Magic TS that is used for channels that are created by JOIN, - * a channel with this TS accepts all TS without complaining that - * it might receive later via MODE or CREATE. - * - * Part of the P9 compatibility, shouldn't occur on a P10 network. - */ -#define MAGIC_REMOTE_JOIN_TS 1270080000 - extern const char* const PartFmt1; @@ -248,7 +237,6 @@ #define MAXOPLEVEL 999 #define IsZombie(x) ((x)->status & CHFL_ZOMBIE) /**< see \ref zombie */ -#define IsDeopped(x) ((x)->status & CHFL_DEOPPED) #define IsBanned(x) ((x)->status & CHFL_BANNED) #define IsBanValid(x) ((x)->status & CHFL_BANVALID) #if defined(DDB) || defined(SERVICES) @@ -257,7 +245,6 @@ #define IsChanOp(x) ((x)->status & CHFL_CHANOP) #define OpLevel(x) ((x)->oplevel) #define HasVoice(x) ((x)->status & CHFL_VOICE) -#define IsServOpOk(x) ((x)->status & CHFL_SERVOPOK) #define IsBurstJoined(x) ((x)->status & CHFL_BURST_JOINED) #define IsVoicedOrOpped(x) ((x)->status & CHFL_VOICED_OR_OPPED) #if defined(UNDERNET) @@ -268,8 +255,6 @@ #define SetBanned(x) ((x)->status |= CHFL_BANNED) #define SetBanValid(x) ((x)->status |= CHFL_BANVALID) -#define SetDeopped(x) ((x)->status |= CHFL_DEOPPED) -#define SetServOpOk(x) ((x)->status |= CHFL_SERVOPOK) #define SetBurstJoined(x) ((x)->status |= CHFL_BURST_JOINED) #define SetZombie(x) ((x)->status |= CHFL_ZOMBIE) #if defined(UNDERNET) @@ -284,8 +269,6 @@ #define ClearBanned(x) ((x)->status &= ~CHFL_BANNED) #define ClearBanValid(x) ((x)->status &= ~CHFL_BANVALID) -#define ClearDeopped(x) ((x)->status &= ~CHFL_DEOPPED) -#define ClearServOpOk(x) ((x)->status &= ~CHFL_SERVOPOK) #define ClearBurstJoined(x) ((x)->status &= ~CHFL_BURST_JOINED) #define ClearDelayedJoin(x) ((x)->status &= ~CHFL_DELAYED) #if defined(DDB) || defined(SERVICES) @@ -323,6 +306,15 @@ char banstr[NICKLEN+USERLEN+HOSTLEN+3]; /**< hostmask that the ban matches */ }; +/** An invitation to a channel. */ +struct Invite { + struct Invite* next_user; /**< next invite to the user */ + struct Invite* next_channel; /**< next invite to the channel */ + struct Client* user; /**< user being invited */ + struct Channel* channel; /**< channel to which invited */ + char inviter[NICKLEN+USERLEN+HOSTLEN+3]; /**< hostmask of inviter */ +}; + /** Information about a channel */ struct Channel { struct Channel* next; /**< next channel in the global channel list */ @@ -333,7 +325,7 @@ time_t topic_time; /**< Modification time of the topic */ unsigned int users; /**< Number of clients on this channel */ struct Membership* members; /**< Pointer to the clients on this channel*/ - struct SLink* invites; /**< List of invites on this channel */ + struct Invite* invites; /**< List of invites on this channel */ struct Ban* banlist; /**< List of bans on this channel */ struct Mode mode; /**< This channels mode */ char topic[TOPICLEN + 1]; /**< Channels topic */ @@ -452,7 +444,6 @@ struct Client* cptr, struct Client* sptr, struct Channel* chptr); extern struct Client* find_chasing(struct Client* sptr, const char* user, int* chasing); -void add_invite(struct Client *cptr, struct Channel *chptr); int number_of_zombies(struct Channel *chptr); extern const char* find_no_nickchange_channel(struct Client* cptr); @@ -467,16 +458,10 @@ extern int is_chan_owner(struct Client *cptr, struct Channel *chptr); #endif extern int is_chan_op(struct Client *cptr, struct Channel *chptr); -extern int is_zombie(struct Client *cptr, struct Channel *chptr); -extern int has_voice(struct Client *cptr, struct Channel *chptr); -/* - NOTE: pointer is compared, and not dereferenced, called by - add_target with a void*, since targets could be anything, - this function can't make any assumptions that it has a channel -*/ -extern int IsInvited(struct Client* cptr, const void* chptr); extern void send_channel_modes(struct Client *cptr, struct Channel *chptr); extern char *pretty_mask(char *mask); +extern struct Invite* is_invited(struct Client* cptr, struct Channel* chptr); +extern void add_invite(struct Client *cptr, struct Channel *chptr, struct Client *inviter); extern void del_invite(struct Client *cptr, struct Channel *chptr); extern void list_set_default(void); /* this belongs elsewhere! */ Index: ircd-ircdev/include/client.h diff -u ircd-ircdev/include/client.h:1.17 ircd-ircdev/include/client.h:1.18 --- ircd-ircdev/include/client.h:1.17 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/client.h Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Structures and functions for handling local clients. - * @version $Id: client.h,v 1.17 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: client.h,v 1.18 2007/04/21 16:20:18 zolty Exp $ */ #ifndef INCLUDED_client_h #define INCLUDED_client_h @@ -159,7 +159,6 @@ FLAG_GOTID, /**< successful ident lookup achieved */ FLAG_DOID, /**< I-lines say must use ident return */ FLAG_NONL, /**< No \n in buffer */ - FLAG_TS8, /**< Why do you want to know? */ FLAG_MAP, /**< Show server on the map */ FLAG_JUNCTION, /**< Junction causing the net.burst. */ FLAG_BURST, /**< Server is receiving a net.burst */ Index: ircd-ircdev/include/ircd_features.h diff -u ircd-ircdev/include/ircd_features.h:1.16 ircd-ircdev/include/ircd_features.h:1.17 --- ircd-ircdev/include/ircd_features.h:1.16 Thu Apr 19 15:53:46 2007 +++ ircd-ircdev/include/ircd_features.h Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Public interfaces and declarations for dealing with configurable features. - * @version $Id: ircd_features.h,v 1.16 2007/04/19 22:53:46 zolty Exp $ + * @version $Id: ircd_features.h,v 1.17 2007/04/21 16:20:18 zolty Exp $ */ #ifndef INCLUDED_features_h #define INCLUDED_features_h @@ -162,6 +162,7 @@ /* Misc. random stuff */ FEAT_NETWORK, FEAT_URL_CLIENTS, + FEAT_URLREG, FEAT_LAST_F }; Index: ircd-ircdev/include/patchlevel.h diff -u ircd-ircdev/include/patchlevel.h:1.49 ircd-ircdev/include/patchlevel.h:1.50 --- ircd-ircdev/include/patchlevel.h:1.49 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/include/patchlevel.h Sat Apr 21 09:20:18 2007 @@ -17,10 +17,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: patchlevel.h,v 1.49 2007/04/19 22:53:47 zolty Exp $ + * $Id: patchlevel.h,v 1.50 2007/04/21 16:20:18 zolty Exp $ * */ -#define PATCHLEVEL "1" +#define PATCHLEVEL "2" #define RELEASE "1.0.beta" Index: ircd-ircdev/include/struct.h diff -u ircd-ircdev/include/struct.h:1.10 ircd-ircdev/include/struct.h:1.11 --- ircd-ircdev/include/struct.h:1.10 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/include/struct.h Sat Apr 21 09:20:18 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Structure definitions for users and servers. - * @version $Id: struct.h,v 1.10 2007/04/19 22:53:47 zolty Exp $ + * @version $Id: struct.h,v 1.11 2007/04/21 16:20:18 zolty Exp $ */ #ifndef INCLUDED_struct_h #define INCLUDED_struct_h @@ -39,6 +39,7 @@ struct Client; struct User; struct Membership; +struct Invite; struct SLink; /** Describes a server on the network. */ @@ -73,14 +74,13 @@ struct User { struct Client* server; /**< client structure of server */ struct Membership* channel; /**< chain of channel pointer blocks */ - struct SLink* invited; /**< chain of invite pointer blocks */ + struct Invite* invited; /**< chain of invite pointer blocks */ struct Ban* silence; /**< chain of silence pointer blocks */ struct SLink* watch; /**< chain of watch pointer blocks */ char* away; /**< pointer to away message */ time_t last; /**< last time user sent a message */ unsigned int refcnt; /**< Number of times this block is referenced */ unsigned int joined; /**< number of channels joined */ - unsigned int invites; /**< Number of channels we've been invited to */ unsigned int watches; /**< Number of entrances in the watch list */ /** Remote account name. Before registration is complete, this is * either empty or contains the username from the USER command. Index: ircd-ircdev/ircd/channel.c diff -u ircd-ircdev/ircd/channel.c:1.29 ircd-ircdev/ircd/channel.c:1.30 --- ircd-ircdev/ircd/channel.c:1.29 Thu Apr 19 15:53:47 2007 +++ ircd-ircdev/ircd/channel.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Channel management and maintanance - * @version $Id: channel.c,v 1.29 2007/04/19 22:53:47 zolty Exp $ + * @version $Id: channel.c,v 1.30 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -266,18 +266,44 @@ #if defined(UNDERNET) chptr->users = 0; - /* There is a semantics problem here: Assuming no fragments across a - * split, a channel without Apass could be maliciously destroyed and - * recreated, and someone could set apass on the new instance. - * - * This could be fixed by preserving the empty non-Apass channel for - * the same time as if it had an Apass (but removing +i and +l), and - * reopping the first user to rejoin. However, preventing net rides - * requires a backwards-incompatible protocol change.. + /* + * Also channels without Apass set need to be kept alive, + * otherwise Bad Guys(tm) would be able to takeover + * existing channels too easily, and then set an Apass! + * However, if a channel without Apass becomes empty + * then we try to be kind to them and remove possible + * limiting modes. */ - if (!chptr->mode.apass[0]) /* If no Apass, destroy now. */ - destruct_channel(chptr); - else if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48 hours? */ + chptr->mode.mode &= ~MODE_INVITEONLY; + chptr->mode.limit = 0; + /* + * We do NOT reset a possible key or bans because when + * the 'channel owners' can't get in because of a key + * or ban then apparently there was a fight/takeover + * on the channel and we want them to contact IRC opers + * who then will educate them on the use of Apass/Upass. + */ + if (!chptr->mode.apass[0]) /* If no Apass, reset all modes. */ + { + struct Ban *link, *next; + chptr->mode.mode = 0; + *chptr->mode.key = '\0'; + mode_invite_clear(chptr); + for (link = chptr->banlist; link; link = next) { + next = link->next; + free_ban(link); + } + chptr->banlist = NULL; + + /* Immediately destruct empty -A channels if not using apass. */ + if (!feature_bool(FEAT_OPLEVELS)) + { + destruct_channel(chptr); + destruct_channel(chptr); + return 0; + } + } + if (TStime() - chptr->creationtime < 172800) /* Channel younger than 48 hours? */ schedule_destruct_event_1m(chptr); /* Get rid of it in approximately 4-5 minutes */ else schedule_destruct_event_48h(chptr); /* Get rid of it in approximately 48 hours */ @@ -314,8 +340,7 @@ /* * Now, find all invite links from channel structure */ - while (chptr->invites) - del_invite(chptr->invites->value.cptr, chptr); + mode_invite_clear(chptr); for (ban = chptr->banlist; ban; ban = next) { @@ -716,6 +741,7 @@ */ if (member->channel->mode.mode & MODE_MODERATED) return 0; + #if defined(UNDERNET) /* If only logged in users may join and you're not one, you can't speak. */ if (member->channel->mode.mode & MODE_REGONLY && !IsAccount(member->user)) @@ -1378,41 +1404,80 @@ return chptr; } -/** invite a user to a channel. +/** Find invitation (if any) for \a cptr to \a chptr. + * @param[in] cptr Possibly invited client. + * @param[in] chptr Channel to search for. + * @return A pointer to the relevant struct Invite, or NULL if not invited. + */ +struct Invite *is_invited(struct Client* cptr, struct Channel* chptr) +{ + struct Invite *ip; + + for (ip = (cli_user(cptr))->invited; ip; ip = ip->next_user) + if (ip->channel == chptr) + return ip; + + return 0; +} + +static struct Invite *invite_freelist; + +/** Invite a user to a channel. * * Adds an invite for a user to a channel. Limits the number of invites - * to FEAT_MAXCHANNELSPERUSER. Does not sent notification to the user. + * to FEAT_MAXCHANNELSPERUSER. Does not notify the user. * - * @param cptr The client to be invited. - * @param chptr The channel to be invited to. + * @param[in] cptr The client to be invited. + * @param[in] chptr The channel to be invited to. + * @param[in] inviter The client inviting \a cptr. */ -void add_invite(struct Client *cptr, struct Channel *chptr) +void add_invite(struct Client *cptr, struct Channel *chptr, struct Client *inviter) { - struct SLink *inv, **tmp; + struct Invite **uprev = &cli_user(cptr)->invited; + struct Invite *inv; + int max = feature_int(FEAT_MAXCHANNELSPERUSER); + int count = 0; + /* See if the user is already invited. */ + while ((inv = *uprev) != NULL) + { + if (inv->channel == chptr) + break; + else if (++count >= max) + del_invite(cptr, inv->channel); + else + uprev = &inv->next_user; + } - del_invite(cptr, chptr); - /* - * Delete last link in chain if the list is max length - */ - assert(list_length((cli_user(cptr))->invited) == (cli_user(cptr))->invites); - if ((cli_user(cptr))->invites >= feature_int(FEAT_MAXCHANNELSPERUSER)) - del_invite(cptr, (cli_user(cptr))->invited->value.chptr); - /* - * Add client to channel invite list - */ - inv = make_link(); - inv->value.cptr = cptr; - inv->next = chptr->invites; - chptr->invites = inv; - /* - * Add channel to the end of the client invite list - */ - for (tmp = &((cli_user(cptr))->invited); *tmp; tmp = &((*tmp)->next)); - inv = make_link(); - inv->value.chptr = chptr; - inv->next = NULL; - (*tmp) = inv; - (cli_user(cptr))->invites++; + if (inv) { + /* Remove from the user's invite list. */ + *uprev = inv->next_user; + /* Search for end of invite list. */ + while ((*uprev)->next_user) + uprev = &(*uprev)->next_user; + } else { + /* Find or allocate an Invite struct. */ + if (invite_freelist) { + inv = invite_freelist; + invite_freelist = inv->next_user; + } else { + inv = MyCalloc(1, sizeof(*inv)); + } + + /* Set client and channel fields; add to channel list. */ + inv->user = cptr; + inv->channel = chptr; + inv->next_channel = chptr->invites; + chptr->invites = inv; + } + + /* Add to the user's invite list. */ + assert(uprev != NULL); + *uprev = inv; + + /* Set the remaining fields. */ + ircd_snprintf(NULL, inv->inviter, sizeof(inv->inviter) - 1, + "%#C", inviter); + inv->next_user = NULL; } /** Delete an invite @@ -1423,26 +1488,31 @@ */ void del_invite(struct Client *cptr, struct Channel *chptr) { - struct SLink **inv, *tmp; + struct Invite **inv, *tmp; - for (inv = &(chptr->invites); (tmp = *inv); inv = &tmp->next) - if (tmp->value.cptr == cptr) + /* Remove from channel's invite list. */ + for (inv = &(chptr->invites); (tmp = *inv); inv = &tmp->next_channel) + if (tmp->user == cptr) { - *inv = tmp->next; - free_link(tmp); - tmp = 0; - (cli_user(cptr))->invites--; + *inv = tmp->next_channel; break; } - for (inv = &((cli_user(cptr))->invited); (tmp = *inv); inv = &tmp->next) - if (tmp->value.chptr == chptr) + /* If nothing found, bail. */ + if (!tmp) + return; + + /* Remove from client's invite list. */ + for (inv = &((cli_user(cptr))->invited); (tmp = *inv); inv = &tmp->next_user) + if (tmp->channel == chptr) { - *inv = tmp->next; - free_link(tmp); - tmp = 0; + *inv = tmp->next_user; break; } + + /* Append to freelist of invites. */ + tmp->next_user = invite_freelist; + invite_freelist = tmp; } /** @page zombie Explanation of Zombies @@ -2352,7 +2422,7 @@ mode_invite_clear(struct Channel *chan) { while (chan->invites) - del_invite(chan->invites->value.cptr, chan); + del_invite(chan->invites->user, chan); } /* What we've done for mode_parse so far... */ @@ -3245,8 +3315,6 @@ #else (MODE_CHANOP | MODE_VOICE)); #endif - if (state->cli_change[i].flag & MODE_CHANOP) - ClearDeopped(member); } else member->status &= ~(state->cli_change[i].flag & #if defined(DDB) || defined(SERVICES) @@ -3741,18 +3809,6 @@ return 0; } -/* Returns TRUE (1) if client is invited, FALSE (0) if not */ -int IsInvited(struct Client* cptr, const void* chptr) -{ - struct SLink *lp; - - for (lp = (cli_user(cptr))->invited; lp; lp = lp->next) - if (lp->value.chptr == chptr) - return 1; - - return 0; -} - /* RevealDelayedJoin: sends a join for a hidden user */ void RevealDelayedJoin(struct Membership *member) Index: ircd-ircdev/ircd/m_bmode.c diff -u ircd-ircdev/ircd/m_bmode.c:1.2 ircd-ircdev/ircd/m_bmode.c:1.3 --- ircd-ircdev/ircd/m_bmode.c:1.2 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_bmode.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for BMODE command (Bot Mode). - * @version $Id: m_bmode.c,v 1.2 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_bmode.c,v 1.3 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -61,8 +61,6 @@ if (IsLocalChannel(chptr->chname)) return protocol_violation(sptr, "Attemped to set BMODE on local channel"); - ClrFlag(sptr, FLAG_TS8); - modebuf_init(&mbuf, sptr, cptr, chptr, (MODEBUF_DEST_CHANNEL | /* Send mode to clients */ MODEBUF_DEST_SERVER | /* Send mode to servers */ Index: ircd-ircdev/ircd/m_burst.c diff -u ircd-ircdev/ircd/m_burst.c:1.17 ircd-ircdev/ircd/m_burst.c:1.18 --- ircd-ircdev/ircd/m_burst.c:1.17 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_burst.c Sat Apr 21 09:20:18 2007 @@ -22,7 +22,7 @@ */ /** @file * @brief Handlers for BURST command. - * @version $Id: m_burst.c,v 1.17 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_burst.c,v 1.18 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -389,7 +389,7 @@ struct Membership* member; #endif - base_mode = CHFL_DEOPPED | CHFL_BURST_JOINED; + base_mode = CHFL_BURST_JOINED; if (chptr->mode.mode & MODE_DELJOINS) base_mode |= CHFL_DELAYED; current_mode = last_mode = base_mode; @@ -415,7 +415,7 @@ current_mode = base_mode; current_mode_needs_reset = 0; } - current_mode = (current_mode & ~(CHFL_DEOPPED | CHFL_DELAYED)) | CHFL_CHANOP; + current_mode = (current_mode & ~CHFL_DELAYED) | CHFL_CHANOP; } else if (*ptr == 'v') { /* has voice status */ if (current_mode_needs_reset) { @@ -434,7 +434,7 @@ } oplevel = 0; } - current_mode = (current_mode & ~(CHFL_DEOPPED | CHFL_DELAYED)) | CHFL_CHANOP; + current_mode = (current_mode & ~CHFL_DELAYED) | CHFL_CHANOP; do { level_increment = 10 * level_increment + *ptr++ - '0'; } while(IsDigit(*ptr)); @@ -445,12 +445,12 @@ ptr++) { #if defined(DDB) || defined(SERVICES) if (*ptr == 'q') /* has owner status */ - current_mode = (current_mode & ~(CHFL_DEOPPED | CHFL_DELAYED)) | CHFL_OWNER; + current_mode = (current_mode & ~CHFL_DELAYED) | CHFL_OWNER; else if (*ptr == 'o') /* has oper status */ #else if (*ptr == 'o') /* has oper status */ #endif - current_mode = (current_mode & ~(CHFL_DEOPPED | CHFL_DELAYED)) | CHFL_CHANOP; + current_mode = (current_mode & ~CHFL_DELAYED) | CHFL_CHANOP; else if (*ptr == 'v') /* has voice status */ current_mode = (current_mode & ~CHFL_DELAYED) | CHFL_VOICE; #endif @@ -579,15 +579,14 @@ if (member->status & CHFL_VOICE) modebuf_mode_client(mbuf, MODE_DEL | CHFL_VOICE, member->user, 0); #endif - member->status = (member->status + member->status &= #if defined(UNDERNET) - & ~(CHFL_CHANNEL_MANAGER | CHFL_CHANOP | CHFL_VOICE)) + ~(CHFL_CHANNEL_MANAGER | CHFL_CHANOP | CHFL_VOICE); #elif defined(DDB) || defined(SERVICES) - & ~(CHFL_OWNER | CHFL_CHANOP | CHFL_VOICE)) + ~(CHFL_OWNER | CHFL_CHANOP | CHFL_VOICE); #else - & ~(CHFL_CHANOP | CHFL_VOICE)) + ~(CHFL_CHANOP | CHFL_VOICE); #endif - | CHFL_DEOPPED; } } Index: ircd-ircdev/ircd/m_create.c diff -u ircd-ircdev/ircd/m_create.c:1.9 ircd-ircdev/ircd/m_create.c:1.10 --- ircd-ircdev/ircd/m_create.c:1.9 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_create.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for CREATE command. - * @version $Id: m_create.c,v 1.9 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_create.c,v 1.10 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -80,8 +80,7 @@ /* A create that didn't appear during a burst has that servers idea of * the current time. Use it for lag calculations. */ - if (!IsBurstOrBurstAck(sptr) && 0 != chanTS && - MAGIC_REMOTE_JOIN_TS != chanTS) + if (!IsBurstOrBurstAck(sptr) && 0 != chanTS) cli_serv(cli_user(sptr)->server)->lag = TStime() - chanTS; /* If this server is >1 minute fast, warn */ @@ -121,8 +120,7 @@ /* Check if we need to bounce a mode */ if (TStime() - chanTS > TS_LAG_TIME || - (chptr->creationtime && chanTS > chptr->creationtime && - chptr->creationtime != MAGIC_REMOTE_JOIN_TS)) { + (chptr->creationtime && chanTS > chptr->creationtime)) { modebuf_init(&mbuf, sptr, cptr, chptr, (MODEBUF_DEST_SERVER | /* Send mode to server */ MODEBUF_DEST_HACK2 | /* Send a HACK(2) message */ Index: ircd-ircdev/ircd/m_invite.c diff -u ircd-ircdev/ircd/m_invite.c:1.16 ircd-ircdev/ircd/m_invite.c:1.17 --- ircd-ircdev/ircd/m_invite.c:1.16 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_invite.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for INVITE command. - * @version $Id: m_invite.c,v 1.16 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_invite.c,v 1.17 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -73,9 +73,9 @@ /* * list the channels you have an invite to. */ - struct SLink *lp; - for (lp = cli_user(sptr)->invited; lp; lp = lp->next) - send_reply(cptr, RPL_INVITELIST, lp->value.chptr->chname); + struct Invite *ip; + for (ip = cli_user(sptr)->invited; ip; ip = ip->next_user) + send_reply(cptr, RPL_INVITELIST, ip->channel->chname); send_reply(cptr, RPL_ENDOFINVITELIST); return 0; } @@ -124,7 +124,7 @@ send_reply(sptr, RPL_AWAY, cli_name(acptr), cli_user(acptr)->away); if (MyConnect(acptr)) { - add_invite(acptr, chptr); + add_invite(acptr, chptr, sptr); sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr); } else if (!IsLocalChannel(chptr->chname)) { sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr, @@ -236,7 +236,7 @@ return 0; if (MyConnect(acptr)) { - add_invite(acptr, chptr); + add_invite(acptr, chptr, sptr); sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H", cli_name(acptr), chptr); } else { sendcmdto_one(sptr, CMD_INVITE, acptr, "%s %H %Tu", cli_name(acptr), chptr, Index: ircd-ircdev/ircd/m_join.c diff -u ircd-ircdev/ircd/m_join.c:1.17 ircd-ircdev/ircd/m_join.c:1.18 --- ircd-ircdev/ircd/m_join.c:1.17 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_join.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for JOIN command. - * @version $Id: m_join.c,v 1.17 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_join.c,v 1.18 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -169,7 +169,6 @@ /* Try to add the new channel as a recent target for the user. */ if (check_target_limit(sptr, chptr, chptr->chname, 0)) { #if defined(UNDERNET) -/* FIXME zoltan */ chptr->members = 0; destruct_channel(chptr); continue; @@ -177,6 +176,7 @@ joinbuf_join(&create, chptr, CHFL_CHANOP | CHFL_CHANNEL_MANAGER); #else +/*TODO-ZOLTAN: Ojo con esto, con el target limit*/ sub1_from_channel(chptr); continue; } @@ -188,14 +188,13 @@ } else if (check_target_limit(sptr, chptr, chptr->chname, 0)) { continue; } else { - int flags = CHFL_DEOPPED; + struct Invite *invite; + int flags = 0; int err = 0; #if defined(DDB) struct Ddb *ddb = ddb_find_key(DDB_CHANDB, chptr->chname); #endif - /* Check target change limits. */ - #if defined(UNDERNET) /* Check Apass/Upass -- since we only ever look at a single * "key" per channel now, this hampers brute force attacks. */ @@ -203,16 +202,18 @@ flags = CHFL_CHANOP | CHFL_CHANNEL_MANAGER; else if (key && !strcmp(key, chptr->mode.upass)) flags = CHFL_CHANOP; - else if (IsInvited(sptr, chptr)) { + else if (chptr->users == 0 && !chptr->mode.apass[0]) { + /* Joining a zombie channel (zannel): give ops and increment TS. */ + flags = CHFL_CHANOP; + chptr->creationtime++; + } else if (chptr->mode.mode & MODE_INVITEONLY) #elif defined(DDB) if (ddb && !ircd_strcmp(ddb_content(ddb), cli_name(sptr))) flags = CHFL_OWNER; - else if (IsInvited(sptr, chptr)) { + else if (chptr->mode.mode & MODE_INVITEONLY) #else - if (IsInvited(sptr, chptr)) { + if (chptr->mode.mode & MODE_INVITEONLY) #endif - /* Invites bypass these other checks. */ - } else if (chptr->mode.mode & MODE_INVITEONLY) err = ERR_INVITEONLYCHAN; else if (chptr->mode.limit && (chptr->users >= chptr->mode.limit)) err = ERR_CHANNELISFULL; @@ -227,6 +228,19 @@ else if (*chptr->mode.key && (!key || strcmp(key, chptr->mode.key))) err = ERR_BADCHANNELKEY; + /* If the user is invited, s/he can bypass the normal errors. */ + if (err && feature_bool(FEAT_ANNOUNCE_INVITES) + && (invite = is_invited(sptr, chptr))) { + const struct Numeric *num; + num = get_error_numeric(RPL_ISSUEDINVITE); + sendcmdto_channel_butone(&me, num->str, num->str, chptr, cptr, + SKIP_NONOPS | SKIP_BURST, + "%H %s %s :%s has been invited by %s", + chptr, cli_name(sptr), invite->inviter, + cli_name(sptr), invite->inviter); + err = 0; + } + /* An oper with WALK_LCHAN privilege can join a local channel * he otherwise could not join by using "OVERRIDE" as the key. * This will generate a HACK(4) notice, but fails if the oper @@ -234,13 +248,21 @@ if (IsLocalChannel(chptr->chname) && HasPriv(sptr, PRIV_WALK_LCHAN) && !(flags & CHFL_CHANOP) - && key && !strcmp(key, "OVERRIDE") - && strcmp(chptr->mode.key, "OVERRIDE")) + && key && !strcmp(key, "OVERRIDE")) { switch (err) { case 0: - send_reply(sptr, ERR_DONTCHEAT, chptr->chname); - continue; + if (strcmp(chptr->mode.key, "OVERRIDE") +#if defined(UNDERNET) + && strcmp(chptr->mode.apass, "OVERRIDE") + && strcmp(chptr->mode.upass, "OVERRIDE")) { +#else + ) { +#endif + send_reply(sptr, ERR_DONTCHEAT, chptr->chname); + continue; + } + break; case ERR_INVITEONLYCHAN: err = 'i'; break; case ERR_CHANNELISFULL: err = 'l'; break; case ERR_BANNEDFROMCHAN: err = 'b'; break; @@ -249,20 +271,49 @@ default: err = '?'; break; } /* send accountability notice */ - sendto_opmask_butone(0, SNO_HACK4, "OPER JOIN: %C JOIN %H " - "(overriding +%c)", sptr, chptr, err); + if (err) + sendto_opmask_butone(0, SNO_HACK4, "OPER JOIN: %C JOIN %H " + "(overriding +%c)", sptr, chptr, err); err = 0; } /* Is there some reason the user may not join? */ if (err) { - send_reply(sptr, err, chptr->chname); + switch(err) { + case ERR_NEEDREGGEDNICK: + send_reply(sptr, + ERR_NEEDREGGEDNICK, + chptr->chname, + feature_str(FEAT_URLREG)); + break; + default: + send_reply(sptr, err, chptr->chname); + break; + } continue; } joinbuf_join(&join, chptr, flags); +// TODO-ZOltan cli_last_join(sptr) = CurrentTime; + if (flags & CHFL_CHANOP) { + struct ModeBuf mbuf; + /* Always let the server op him: this is needed on a net with older servers + because they 'destruct' channels immediately when they become empty without + sending out a DESTRUCT message. As a result, they would always bounce a mode + (as HACK(2)) when the user ops himself. + (There is also no particularly good reason to have the user op himself.) + */ + modebuf_init(&mbuf, &me, cptr, chptr, MODEBUF_DEST_SERVER); +#if defined(UNDERNET) + modebuf_mode_client(&mbuf, MODE_ADD | MODE_CHANOP, sptr, + chptr->mode.apass[0] ? ((flags & CHFL_CHANNEL_MANAGER) ? 0 : 1) : MAXOPLEVEL); +#elif defined(DDB) || defined(SERVICES) +/*TODO-ZOLTAN*/ + modebuf_mode_client(&mbuf, MODE_ADD | MODE_CHANOP, sptr, 0); +#endif + modebuf_flush(&mbuf); + } } - del_invite(sptr, chptr); if (chptr->topic[0]) { @@ -292,7 +343,6 @@ struct Membership *member; struct Channel *chptr; struct JoinBuf join; - unsigned int flags; time_t creation = 0; char *p = 0; char *chanlist; @@ -321,6 +371,7 @@ for (name = ircd_strtok(&p, chanlist, ","); name; name = ircd_strtok(&p, 0, ",")) { +#if 0 #if defined(UNDERNET) || defined(DDB) if (name[0] == '0' && name[1] == ':') { @@ -328,7 +379,7 @@ flags = CHFL_CHANOP | CHFL_CHANNEL_MANAGER; # else flags = CHFL_OWNER; -# endif +#endif name += 2; } else if (name[0] == '1' && name[1] == ':') @@ -339,6 +390,7 @@ else #endif flags = CHFL_DEOPPED; +#endif if (IsLocalChannel(name) || !IsChannelName(name)) { @@ -355,10 +407,7 @@ name,cli_name(sptr)); continue; } - flags |= HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0; - - /* when the network is 2.10.11+ then remove MAGIC_REMOTE_JOIN_TS */ - chptr->creationtime = creation ? creation : MAGIC_REMOTE_JOIN_TS; + chptr->creationtime = creation; } else { /* We have a valid channel? */ if ((member = find_member_link(chptr, sptr))) @@ -367,19 +416,16 @@ if (!IsZombie(member)) /* already on channel */ continue; - flags = member->status & (CHFL_DEOPPED | CHFL_SERVOPOK); remove_user_from_channel(sptr, chptr); chptr = FindChannel(name); } - else - flags |= HasFlag(sptr, FLAG_TS8) ? CHFL_SERVOPOK : 0; /* Always copy the timestamp when it is older, that is the only way to ensure network-wide synchronization of creation times. */ if (creation && creation < chptr->creationtime) chptr->creationtime = creation; } - joinbuf_join(&join, chptr, flags); + joinbuf_join(&join, chptr, 0); } joinbuf_flush(&join); /* flush joins... */ Index: ircd-ircdev/ircd/m_kick.c diff -u ircd-ircdev/ircd/m_kick.c:1.14 ircd-ircdev/ircd/m_kick.c:1.15 --- ircd-ircdev/ircd/m_kick.c:1.14 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_kick.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for KICK command. - * @version $Id: m_kick.c,v 1.14 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_kick.c,v 1.15 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -61,8 +61,6 @@ struct Membership* member2; char *name, *comment; - ClrFlag(sptr, FLAG_TS8); - if (parc < 3 || *parv[1] == '\0') return need_more_params(sptr, "KICK"); @@ -97,8 +95,12 @@ return send_reply(sptr, ERR_USERNOTINCHANNEL, cli_name(who), chptr->chname); #if defined(UNDERNET) - /* Don't allow to kick member with a higher or equal op-level */ - if (chptr->mode.apass[0] && OpLevel(member) <= OpLevel(member2)) + /* Don't allow to kick member with a higher op-level, + * or members with the same op-level unless both are MAXOPLEVEL. + */ + if (OpLevel(member) < OpLevel(member2) + || (OpLevel(member) == OpLevel(member2) + && OpLevel(member) < MAXOPLEVEL)) return send_reply(sptr, ERR_NOTLOWEROPLEVEL, cli_name(who), chptr->chname, OpLevel(member2), OpLevel(member), "kick", OpLevel(member) == OpLevel(member2) ? "the same" : "a higher"); @@ -151,8 +153,6 @@ struct Membership *member = 0, *sptr_link = 0; char *name, *comment; - ClrFlag(sptr, FLAG_TS8); - if (parc < 3 || *parv[1] == '\0') return need_more_params(sptr, "KICK"); Index: ircd-ircdev/ircd/m_lusers.c diff -u ircd-ircdev/ircd/m_lusers.c:1.7 ircd-ircdev/ircd/m_lusers.c:1.8 --- ircd-ircdev/ircd/m_lusers.c:1.7 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_lusers.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for LUSERS command. - * @version $Id: m_lusers.c,v 1.7 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_lusers.c,v 1.8 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -53,7 +53,7 @@ * @param[in] cptr Client that sent us the message. * @param[in] sptr Original source of message. * @param[in] parc Number of arguments. - * @param[in] parv Argument vector./* + * @param[in] parv Argument vector. */ int m_lusers(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { Index: ircd-ircdev/ircd/m_mode.c diff -u ircd-ircdev/ircd/m_mode.c:1.11 ircd-ircdev/ircd/m_mode.c:1.12 --- ircd-ircdev/ircd/m_mode.c:1.11 Thu Apr 19 15:53:48 2007 +++ ircd-ircdev/ircd/m_mode.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for MODE command. - * @version $Id: m_mode.c,v 1.11 2007/04/19 22:53:48 zolty Exp $ + * @version $Id: m_mode.c,v 1.12 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -71,8 +71,6 @@ if (!IsChannelName(parv[1]) || !(chptr = FindChannel(parv[1]))) return set_user_mode(cptr, sptr, parc, parv); - ClrFlag(sptr, FLAG_TS8); - member = find_member_link(chptr, sptr); if (parc < 3) { @@ -144,8 +142,6 @@ if (!(chptr = FindChannel(parv[1]))) return set_user_mode(cptr, sptr, parc, parv); - ClrFlag(sptr, FLAG_TS8); - if (IsServer(sptr)) { if (find_conf_byhost(cli_confs(cptr), cli_name(sptr), CONF_UWORLD)) modebuf_init(&mbuf, sptr, cptr, chptr, Index: ircd-ircdev/ircd/m_notice.c diff -u ircd-ircdev/ircd/m_notice.c:1.6 ircd-ircdev/ircd/m_notice.c:1.7 --- ircd-ircdev/ircd/m_notice.c:1.6 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_notice.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for NOTICE command. - * @version $Id: m_notice.c,v 1.6 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_notice.c,v 1.7 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -66,8 +66,6 @@ assert(0 != cptr); assert(cptr == sptr); - ClrFlag(sptr, FLAG_TS8); - if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NORECIPIENT, MSG_NOTICE); @@ -118,8 +116,6 @@ char* name; char* server; - ClrFlag(sptr, FLAG_TS8); - if (parc < 3) { /* * we can't deliver it, sending an error back is pointless @@ -174,8 +170,6 @@ assert(0 != cptr); assert(cptr == sptr); - ClrFlag(sptr, FLAG_TS8); - if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NORECIPIENT, MSG_NOTICE); Index: ircd-ircdev/ircd/m_part.c diff -u ircd-ircdev/ircd/m_part.c:1.8 ircd-ircdev/ircd/m_part.c:1.9 --- ircd-ircdev/ircd/m_part.c:1.8 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_part.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for PART command. - * @version $Id: m_part.c,v 1.8 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_part.c,v 1.9 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -60,8 +60,6 @@ char *p = 0; char *name; - ClrFlag(sptr, FLAG_TS8); - /* check number of arguments */ if (parc < 2 || parv[1][0] == '\0') return need_more_params(sptr, "PART"); @@ -126,8 +124,6 @@ char *p = 0; char *name; - ClrFlag(sptr, FLAG_TS8); - /* check number of arguments */ if (parc < 2 || parv[1][0] == '\0') return need_more_params(sptr, "PART"); Index: ircd-ircdev/ircd/m_privmsg.c diff -u ircd-ircdev/ircd/m_privmsg.c:1.6 ircd-ircdev/ircd/m_privmsg.c:1.7 --- ircd-ircdev/ircd/m_privmsg.c:1.6 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_privmsg.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for PRIVMSG command. - * @version $Id: m_privmsg.c,v 1.6 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_privmsg.c,v 1.7 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -65,8 +65,6 @@ assert(cptr == sptr); assert(0 != cli_user(sptr)); - ClrFlag(sptr, FLAG_TS8); - if (feature_bool(FEAT_IDLE_FROM_MSG)) cli_user(sptr)->last = CurrentTime; @@ -115,8 +113,6 @@ char* name; char* server; - ClrFlag(sptr, FLAG_TS8); - if (parc < 3) { /* * we can't deliver it, sending an error back is pointless @@ -172,8 +168,6 @@ assert(cptr == sptr); assert(0 != cli_user(sptr)); - ClrFlag(sptr, FLAG_TS8); - if (feature_bool(FEAT_IDLE_FROM_MSG)) cli_user(sptr)->last = CurrentTime; Index: ircd-ircdev/ircd/m_server.c diff -u ircd-ircdev/ircd/m_server.c:1.10 ircd-ircdev/ircd/m_server.c:1.11 --- ircd-ircdev/ircd/m_server.c:1.10 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_server.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for the SERVER command. - * @version $Id: m_server.c,v 1.10 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_server.c,v 1.11 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -747,8 +747,6 @@ set_server_flags(acptr, parv[7] + 1); Count_newremoteserver(UserStats); - if (Protocol(acptr) < 10) - SetFlag(acptr, FLAG_TS8); add_client_to_list(acptr); hAddClient(acptr); if (*parv[5] == 'J') Index: ircd-ircdev/ircd/m_wallchops.c diff -u ircd-ircdev/ircd/m_wallchops.c:1.8 ircd-ircdev/ircd/m_wallchops.c:1.9 --- ircd-ircdev/ircd/m_wallchops.c:1.8 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_wallchops.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for WALLCHOPS command. - * @version $Id: m_wallchops.c,v 1.8 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_wallchops.c,v 1.9 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -59,8 +59,6 @@ assert(0 != cptr); assert(cptr == sptr); - ClrFlag(sptr, FLAG_TS8); - if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NORECIPIENT, "WALLCHOPS"); Index: ircd-ircdev/ircd/m_wallvoices.c diff -u ircd-ircdev/ircd/m_wallvoices.c:1.8 ircd-ircdev/ircd/m_wallvoices.c:1.9 --- ircd-ircdev/ircd/m_wallvoices.c:1.8 Thu Apr 19 15:53:49 2007 +++ ircd-ircdev/ircd/m_wallvoices.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Handlers for WALLVOICES command. - * @version $Id: m_wallvoices.c,v 1.8 2007/04/19 22:53:49 zolty Exp $ + * @version $Id: m_wallvoices.c,v 1.9 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -59,8 +59,6 @@ assert(0 != cptr); assert(cptr == sptr); - ClrFlag(sptr, FLAG_TS8); - if (parc < 2 || EmptyString(parv[1])) return send_reply(sptr, ERR_NORECIPIENT, "WALLVOICES"); Index: ircd-ircdev/ircd/s_debug.c diff -u ircd-ircdev/ircd/s_debug.c:1.12 ircd-ircdev/ircd/s_debug.c:1.13 --- ircd-ircdev/ircd/s_debug.c:1.12 Thu Apr 19 15:53:50 2007 +++ ircd-ircdev/ircd/s_debug.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Debug support for the ircd. - * @version $Id: s_debug.c,v 1.12 2007/04/19 22:53:50 zolty Exp $ + * @version $Id: s_debug.c,v 1.13 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -217,6 +217,7 @@ char *param) { struct Client *acptr; + struct Invite *inv; struct SLink *link; struct Ban *ban; struct Channel *chptr; @@ -229,7 +230,6 @@ cn = 0, /* connections */ ch = 0, /* channels */ lcc = 0, /* local client conf links */ - chi = 0, /* channel invites */ chb = 0, /* channel bans */ wwu = 0, /* whowas users */ cl = 0, /* classes */ @@ -284,7 +284,7 @@ } if (cli_user(acptr)) { - for (link = cli_user(acptr)->invited; link; link = link->next) + for (inv = cli_user(acptr)->invited; inv; inv = inv->next_user) usi++; for (member = cli_user(acptr)->channel; member; member = member->next_channel) ++memberships; @@ -307,8 +307,6 @@ { ch++; chm += (strlen(chptr->chname) + sizeof(struct Channel)); - for (link = chptr->invites; link; link = link->next) - chi++; for (ban = chptr->banlist; ban; ban = ban->next) { chb++; @@ -333,7 +331,7 @@ send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Users %zu(%zu) Accounts %d(%zu) Invites %d(%zu)", us, usm, acc, acc * (ACCOUNTLEN + 1), - usi, usi * sizeof(struct SLink)); + usi, usi * sizeof(struct Invite)); send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":User channels %d(%zu) Aways %d(%zu)", memberships, memberships * sizeof(struct Membership), aw, awm); @@ -348,11 +346,10 @@ send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Channels %d(%zu) Bans %d(%zu)", ch, chm, chb, chbm); send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, - ":Channel Members %d(%zu) Invites %d(%zu)", memberships, - memberships * sizeof(struct Membership), chi, - chi * sizeof(struct SLink)); + ":Channel Members %d(%zu)", memberships, + memberships * sizeof(struct Membership)); - totch = chm + chbm + chi * sizeof(struct SLink); + totch = chm + chbm; send_reply(cptr, SND_EXPLICIT | RPL_STATSDEBUG, ":Whowas Users %d(%zu) Away %d(%zu) Array %d(%zu)", Index: ircd-ircdev/ircd/s_misc.c diff -u ircd-ircdev/ircd/s_misc.c:1.14 ircd-ircdev/ircd/s_misc.c:1.15 --- ircd-ircdev/ircd/s_misc.c:1.14 Thu Apr 19 15:53:50 2007 +++ ircd-ircdev/ircd/s_misc.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous support functions. - * @version $Id: s_misc.c,v 1.14 2007/04/19 22:53:50 zolty Exp $ + * @version $Id: s_misc.c,v 1.15 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -180,7 +180,7 @@ /* Rewritten by Run - 24 sept 94 */ static void exit_one_client(struct Client* bcptr, const char* comment) { - struct SLink *lp; + struct Invite *ip; struct Ban *bp; if (cli_serv(bcptr) && cli_serv(bcptr)->client_list) /* Was SetServerYXX called ? */ @@ -209,8 +209,8 @@ remove_user_from_all_channels(bcptr); /* Clean up invitefield */ - while ((lp = cli_user(bcptr)->invited)) - del_invite(bcptr, lp->value.chptr); + while ((ip = cli_user(bcptr)->invited)) + del_invite(bcptr, ip->channel); /* Clean up silencefield */ while ((bp = cli_user(bcptr)->silence)) { Index: ircd-ircdev/ircd/s_user.c diff -u ircd-ircdev/ircd/s_user.c:1.27 ircd-ircdev/ircd/s_user.c:1.28 --- ircd-ircdev/ircd/s_user.c:1.27 Thu Apr 19 15:53:51 2007 +++ ircd-ircdev/ircd/s_user.c Sat Apr 21 09:20:18 2007 @@ -21,7 +21,7 @@ */ /** @file * @brief Miscellaneous user-related helper functions. - * @version $Id: s_user.c,v 1.27 2007/04/19 22:53:51 zolty Exp $ + * @version $Id: s_user.c,v 1.28 2007/04/21 16:20:18 zolty Exp $ */ #include "config.h" @@ -641,8 +641,6 @@ SetFlag(sptr, FLAG_KILLED); return exit_client(cptr, sptr, &me, "NICK server wrong direction"); } - else if (HasFlag(acptr, FLAG_TS8)) - SetFlag(sptr, FLAG_TS8); /* * Check to see if this user is being propagated @@ -1236,8 +1234,7 @@ assert(cli_local(sptr)); targets = cli_targets(sptr); - /* If user is invited to channel, give him/her a free target */ - if (IsChannelName(name) && IsInvited(sptr, target)) + if (IsChannelName(name) && is_invited(sptr, target)) return 0; /* ----------------------- End of diff ----------------------- |