Changeset 748 for branches/ithildin-1.1
- Timestamp:
- 06/03/06 23:25:00 (6 years ago)
- Location:
- branches/ithildin-1.1/modules/ircd
- Files:
-
- 5 edited
-
client.h (modified) (5 diffs)
-
commands/mode.c (modified) (3 diffs)
-
commands/quit.c (modified) (2 diffs)
-
commands/version.c (modified) (1 diff)
-
send.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ithildin-1.1/modules/ircd/client.h
r703 r748 12 12 13 13 struct client { 14 char nick[NICKLEN + 1]; /* nickname */15 char user[USERLEN + 1]; /* username on IRC (different from username16 in conn */17 char host[HOSTLEN + 1]; /* hostname on IRC */18 char *orighost; /* concession for host-changing modules. this19 will normally point to the 'host' field of20 the client, but may be pointed elsewhere if21 need be. */22 char ip[IPADDR_MAXLEN + 1]; /* IP address (NICKIP) */23 char info[GCOSLEN + 1]; /* gecos/gcos info (ircname) */14 char nick[NICKLEN + 1]; /* nickname */ 15 char user[USERLEN + 1]; /* username on IRC (different from username 16 in conn */ 17 char host[HOSTLEN + 1]; /* hostname on IRC */ 18 char *orighost; /* concession for host-changing modules. this 19 will normally point to the 'host' field of 20 the client, but may be pointed elsewhere if 21 need be. */ 22 char ip[IPADDR_MAXLEN + 1]; /* IP address (NICKIP) */ 23 char info[GCOSLEN + 1]; /* gecos/gcos info (ircname) */ 24 24 25 25 #define IRCD_CLIENT_REGISTERED 0x0001 … … 28 28 #define IRCD_CLIENT_KILLED 0x0002 29 29 #define IRCD_CLIENT_HISTORY 0x0004 30 int flags;30 int flags; 31 31 32 32 /* check to see if this is our client. we know it's ours if their server … … 35 35 #define MYCLIENT(cli) (cli->server == ircd.me) 36 36 struct connection *conn; /* the connection for this client, NULL if 37 remote or pseudo-client. */37 remote or pseudo-client. */ 38 38 39 time_t signon; /* signon time */40 time_t ts; /* timestamp of the nickname */41 time_t last; /* used for idle time (different from42 conn->last) */43 int hops;/* how many hops away are they? */44 uint64_t modes; /* the user's modes, see below */39 time_t signon; /* signon time */ 40 time_t ts; /* timestamp of the nickname */ 41 time_t last; /* used for idle time (different from 42 conn->last) */ 43 int hops; /* how many hops away are they? */ 44 uint64_t modes; /* the user's modes, see below */ 45 45 46 struct userchans chans; /* our channels */46 struct userchans chans; /* our channels */ 47 47 48 struct privilege_set *pset; /* privileges (usually derived from class) */49 struct server *server; /* server which owns this client */48 struct privilege_set *pset; /* privileges (usually derived from class) */ 49 struct server *server; /* server which owns this client */ 50 50 51 51 struct client_history *hist; 52 52 53 char *mdext; /* mdext data */53 char *mdext; /* mdext data */ 54 54 55 55 LIST_ENTRY(client) lp; … … 138 138 139 139 struct usermode { 140 unsigned char mode; /* the actual mode */141 char avail; /* 1 if available, 0 otherwise */142 #define USERMODE_FL_GLOBAL 0x1 /* the usermode is spread across the140 unsigned char mode; /* the actual mode */ 141 char avail; /* 1 if available, 0 otherwise */ 142 #define USERMODE_FL_GLOBAL 0x1 /* the usermode is spread across the 143 143 network */ 144 #define USERMODE_FL_OPER 0x2 /* the usermode is operator only */144 #define USERMODE_FL_OPER 0x2 /* the usermode is operator only */ 145 145 #define USERMODE_FL_PRESERVE 0x4 /* preserve the mode once set unless 146 146 explicitly unset by the user */ 147 int flags;/* flags for the usermode */148 uint64_t mask; /* the bitmask for the mode */149 msymbol_t *changer; /* the changer function for the mode */150 int sflag;/* send flag (if any) for this mode. */147 int flags; /* flags for the usermode */ 148 uint64_t mask; /* the bitmask for the mode */ 149 msymbol_t *changer; /* the changer function for the mode */ 150 int sflag; /* send flag (if any) for this mode. */ 151 151 }; 152 152 153 153 TAILQ_HEAD(client_history_list, client_history); 154 154 struct client_history { 155 char nick[NICKLEN + 1]; /* these are all the same as in the */155 char nick[NICKLEN + 1]; /* these are all the same as in the */ 156 156 char serv[SERVLEN + 1]; 157 157 158 client_t *cli; /* points to the client we created this158 client_t *cli; /* points to the client we created this 159 159 from. for currently online clients the 160 160 nick will be different. */ 161 time_t signoff; /* when the client signed off */161 time_t signoff; /* when the client signed off */ 162 162 163 163 TAILQ_ENTRY(client_history) lp; … … 175 175 * functions when checking for access */ 176 176 struct client_check_args { 177 client_t *from; /* the client performing the action */178 client_t *to; /* the client being acted on */179 char *extra; /* any extra data */177 client_t *from; /* the client performing the action */ 178 client_t *to; /* the client being acted on */ 179 char *extra; /* any extra data */ 180 180 }; 181 181 182 #define CLIENT_CHECK_OVERRIDE HOOK_COND_SPASS183 #define CLIENT_CHECK_OK HOOK_COND_PASS184 #define CLIENT_CHECK_NO HOOK_COND_FAIL182 #define CLIENT_CHECK_OVERRIDE HOOK_COND_SPASS 183 #define CLIENT_CHECK_OK HOOK_COND_PASS 184 #define CLIENT_CHECK_NO HOOK_COND_FAIL 185 185 int client_check_access(client_t *, client_t *, char *, event_t *); 186 186 #define can_can_send_client(from, to, arg) \ -
branches/ithildin-1.1/modules/ircd/commands/mode.c
r733 r748 89 89 &argv[2], 1); 90 90 } else { 91 return channel_mode(cli, NULL, chan, 0, argc - 2, &argv[2], 1); 91 return channel_mode(cli, NULL, chan, chan->created, argc - 2, 92 &argv[2], 1); 92 93 } 93 94 } else if ((cp = find_client(argv[1])) != NULL) { … … 328 329 * remove our own modes (because we believe the server will 329 330 * accept our modes as stupidly as we accepted theirs... */ 330 log_debug("server %s has no support TS, setting TS for %s to 0!",331 log_debug("server %s has no TS support, setting TS for %s to 0!", 331 332 sp->name, chan->name); 332 333 ts = 0; 334 chan->created = 0; /* normally set when we reject our modes, but 335 we don't reject our modes in this case.. */ 333 336 } else { 334 337 if (ts > chan->created) … … 386 389 log_debug("reverting our modes for channel %s (ours=%d, theirs=%d", 387 390 chan->name, chan->created, ts); 391 chan->created = ts; 388 392 389 393 s = ircd.cmodes.avail; -
branches/ithildin-1.1/modules/ircd/commands/quit.c
r746 r748 37 37 38 38 if (MYCLIENT(cli)) { 39 snprintf(fmsg, TOPICLEN, MSG_FMT(cli, quit_format), msg); 40 fmsg[TOPICLEN] = '\0'; 41 39 42 /* We check to see if their message would be moderated in any channels 40 43 * they are in. If this is the case they are parted from the channels 41 44 * before the quit is sent. */ 42 if (!CLIENT_MASTER(cli) && * msg != '\0') {45 if (!CLIENT_MASTER(cli) && *fmsg != '\0') { 43 46 clp = LIST_FIRST(&cli->chans); 44 47 while (clp != NULL) { 45 48 clp2 = LIST_NEXT(clp, lpcli); 46 49 47 if (can_can_send_channel(cli, clp->chan, msg) >= 0) {50 if (can_can_send_channel(cli, clp->chan, fmsg) >= 0) { 48 51 sendto_channel_local(clp->chan, cli, NULL, "PART", NULL); 49 52 sendto_serv_butone(sptr, cli, NULL, clp->chan->name, … … 55 58 } 56 59 57 /* if it's our client, the connection will be closed. we check here 58 * because we can't after a destroy_client() */ 59 snprintf(fmsg, TOPICLEN, MSG_FMT(cli, quit_format), msg); 60 fmsg[TOPICLEN] = '\0'; 60 /* Be sure to return appropriately for our local clients */ 61 61 destroy_client(cli, fmsg); 62 62 return IRCD_CONNECTION_CLOSED; 63 } else { 64 destroy_client(cli, msg); 65 return COMMAND_WEIGHT_NONE; 63 66 } 64 destroy_client(cli, msg);65 return COMMAND_WEIGHT_NONE;66 67 } 67 68 -
branches/ithildin-1.1/modules/ircd/commands/version.c
r740 r748 40 40 ircd.vercomment); 41 41 send_isupport(cli); 42 #ifdef DEBUG_CODE 43 sendto_one(cli, "NOTICE", ":This server is running in debug mode. " 44 "Some traffic may be logged."); 45 #endif 42 if (me.debug) 43 sendto_one(cli, "NOTICE", ":This server is running in debug mode. " 44 "Some traffic may be logged."); 46 45 47 46 return COMMAND_WEIGHT_MEDIUM; -
branches/ithildin-1.1/modules/ircd/send.c
r621 r748 608 608 } 609 609 free(ircd.sflag.flags[flg].name); 610 611 memset(&ircd.sflag.flags[flg], 0, sizeof(struct send_flag)); 610 612 ircd.sflag.flags[flg].num = -1; 611 613 } … … 631 633 632 634 /* otherwise, put them in. */ 633 clp = malloc(sizeof(struct chanlink));635 clp = calloc(1, sizeof(struct chanlink)); 634 636 clp->cli = cli; 635 637 clp->chan = NULL; … … 672 674 char lmsg[512]; 673 675 va_list vl; 674 676 675 677 if (flg < 0 || flg >= ircd.sflag.size || ircd.sflag.flags[flg].num < 0) 676 678 return; /* nothing to do here. */
Note: See TracChangeset
for help on using the changeset viewer.
