return 1;
}
-static void
-zoot_list(struct listData *list)
-{
- struct userData *uData;
- unsigned int start, curr, highest, lowest;
- struct helpfile_table tmp_table;
- const char **temp, *msg;
-
- if(list->table.length == 1)
- {
- if(list->search)
- send_message(list->user, list->bot, "CSMSG_ACCESS_SEARCH_HEADER", list->channel->name, list->lowest, list->highest, list->search);
- else
- send_message(list->user, list->bot, "CSMSG_ACCESS_ALL_HEADER", list->channel->name, list->lowest, list->highest);
- msg = user_find_message(list->user, "MSG_NONE");
- send_message_type(4, list->user, list->bot, " %s", msg);
- }
- tmp_table.width = list->table.width;
- tmp_table.flags = list->table.flags;
- list->table.contents[0][0] = " ";
- highest = list->highest;
- if(list->lowest != 0)
- lowest = list->lowest;
- else if(highest < 100)
- lowest = 1;
- else
- lowest = highest - 100;
- for(start = curr = 1; curr < list->table.length; )
- {
- uData = list->users[curr-1];
- list->table.contents[curr++][0] = " ";
- if((curr == list->table.length) || (list->users[curr-1]->access < lowest))
- {
- if(list->search)
- send_message(list->user, list->bot, "CSMSG_ACCESS_SEARCH_HEADER", list->channel->name, lowest, highest, list->search);
- else
- send_message(list->user, list->bot, "CSMSG_ACCESS_ALL_HEADER", list->channel->name, lowest, highest);
- temp = list->table.contents[--start];
- list->table.contents[start] = list->table.contents[0];
- tmp_table.contents = list->table.contents + start;
- tmp_table.length = curr - start;
- table_send(list->bot, list->user->nick, 0, NULL, tmp_table);
- list->table.contents[start] = temp;
- start = curr;
- highest = lowest - 1;
- lowest = (highest < 100) ? 0 : (highest - 99);
- }
- }
-}
-
static void
def_list(struct listData *list)
{
lData.highest = highest;
lData.search = (argc > 1) ? argv[1] : NULL;
send_list = def_list;
- (void)zoot_list; /* since it doesn't show user levels */
if(user->handle_info)
{
static CHANSERV_FUNC(cmd_invite)
{
- struct userData *uData;
struct userNode *invite;
struct ChanUser *chanuser;
unsigned int i;
- uData = GetChannelUser(channel->channel_info, user->handle_info);
-
if(argc > 1)
{
if(!(invite = GetUserH(argv[1])))
static void
ban_read_helper(const char *key, struct record_data *rd, struct chanData *chan)
{
- struct banData *bData;
char *set, *triggered, *s_duration, *s_expires, *reason, *owner;
unsigned long set_time, triggered_time, expires_time;
if(!reason || (expires_time && (expires_time < now)))
return;
- bData = add_channel_ban(chan, key, owner, set_time, triggered_time, expires_time, reason);
+ add_channel_ban(chan, key, owner, set_time, triggered_time, expires_time, reason);
}
static struct suspended *
DEFINE_COMMAND(unf, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
DEFINE_COMMAND(ping, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
DEFINE_COMMAND(wut, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
- DEFINE_COMMAND(8ball, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
- DEFINE_COMMAND(d, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
+ DEFINE_COMMAND(8ball, 2, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
+ DEFINE_COMMAND(d, 2, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
DEFINE_COMMAND(huggle, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
DEFINE_COMMAND(addvote, 1, MODCMD_REQUIRE_AUTHED, NULL);
" v AutoVoice is active.",
" i AutoInvite is active.",
"$uSee Also:$u access, users");
+"8BALL" ("/msg $S 8BALL <question>",
+ "Asks your question to a 'Magic 8 Ball'. Your mileage may vary. Results not guaranteed in all states or countries. For entertainment purposes only.");
"ACCESS" ("/msg $S ACCESS <#channel> [<nick|*account>]",
"Reports various pieces of information about a channel user, including channel and network access level, and the user's info line. If no nick or account is provided, $S returns your own information.",
"$uSee Also:$u myaccess, users");
"CUNSUSPEND" ("/msg $C CUNSUSPEND <#channel>",
"Restores a channel's $b$C$b registration.",
"$uSee Also:$u csuspend, unregister");
+"D" ("/msg $S D <die>",
+ "Throws a (pseudo-random) die or several dice. !d 6 will roll one six-sided die. !d 5d4 will roll five four-sided dice and report the sum.");
"DELBAN" ("/msg $C DELBAN <#channel> <mask|nick>",
"Deletes a ban from the channel ban list. This command works for both permanent and timed bans alike.",
"$uSee Also:$u addban, addtimedban, bans");
"HELPERS" ("/msg $C HELPERS",
"Lists all the helpers currently online. Nicknames enclosed in parentheses are away, and likely unavailable.",
"$uSee Also:$u staff");
+"HUGGLE" ("/msg $S HUGGLE",
+ "Asks $S to give you a huggle.");
"INFO" ("/msg $C INFO <#channel>",
"This command responds with various pieces of information about a channel's users, status, and registration.");
"INVITE" ("/msg $C INVITE <#channel> [nick [reason]]",
"PEEK" ("/msg $C PEEK <#channel>",
"Displays the current topic, modes, and ops of the specified channel. Unlike $binfo$b, $bpeek$b displays channel information unrelated to $b$C$b.",
"$uSee Also:$u info");
+"PING" ("/msg $S PING",
+ "Asks $S to send a pong back to you. Can be used to check for lag in the IRC network, but is more commonly used just for fun.");
"PLIST" ("/msg $C PLIST <#channel>",
"This command lists all users of level $bPeon$b on a channel's userlist. If a mask is supplied, only peons matching the mask will be shown.",
"$uSee Also:$u addpeon, delpeon, mdelpeon, users");
"UNBANME" ("/msg $C UNBANME <#channel>",
"Unbans your hostmask from the specified channel.",
"$uSee Also:$u ban, unban");
+"UNF" ("/msg $S UNF",
+ "[This help message has been removed by the Coalition For A Family-Safe Internet.]");
"UNREGISTER" ("/msg $C UNREGISTER <#channel> [<confirmation>]",
"Unregisters a channel that is registered with $b$C$b. $bIMPORTANT$b: Once the channel is unregistered, the userlist $bcannot$b be recovered.",
"If you are not network staff, you must add a confimation string to the end of your line to confirm the unregistration. If you leave it out, $C will show the proper confirmation string.",
"WLIST" ("/msg $C WLIST <#channel> [mask]",
"This command lists all users of level $bOwner$b on a channel's userlist. If a mask is supplied, only owners matching the mask will be shown.",
"$uSee Also:$u addcoowner, delcoowner, mdelcoowner, users");
+"WUT" ("/msg $S WUT",
+ "what what?");
"I'VE FALLEN AND I CAN'T GET UP" ("$bHelp, I've fallen and I can't get up$b!",
"If you drank your milk, you might not feel so vulnerable right now.",
void (*irc_send)(struct userNode *from, const char *to, const char *msg);
static struct string_buffer input;
unsigned int size, ipos, pos, length, chars_sent, use_color;
- unsigned int expand_pos, expand_ipos, newline_ipos;
+ unsigned int expand_ipos, newline_ipos;
char line[MAX_LINE_SIZE];
if (IsChannelName(dest) || *dest == '$') {
* that requires a very big intermediate buffer.
*/
expand_ipos = newline_ipos = ipos = 0;
- expand_pos = pos = 0;
+ pos = 0;
chars_sent = 0;
while (input.list[ipos]) {
char ch, *value, *free_value;
free(free_value);
pos += length;
if ((pos < size-1) && input.list[ipos]) {
- expand_pos = pos;
expand_ipos = ipos;
continue;
}
send_line:
- expand_pos = pos;
expand_ipos = ipos;
SEND_LINE(0);
#undef SEND_LINE
static void
ioset_buffered_read(struct io_fd *fd) {
- int put_avail, nbr, fdnum;
+ int put_avail, nbr;
if (!(put_avail = ioq_put_avail(&fd->recv)))
put_avail = ioq_grow(&fd->recv);
fd->recv.put += nbr;
if (fd->recv.put == fd->recv.size)
fd->recv.put = 0;
- fdnum = fd->fd;
while (fd->line_len > 0) {
struct io_fd *old_active;
int died = 0;
unsigned int matched = 0;
if (discrim->type) {
- static volatile struct logEntry *last;
struct logEntry *entry;
- for (entry = discrim->type->log_oldest, last = NULL;
+ for (entry = discrim->type->log_oldest;
entry;
- last = entry, entry = entry->next) {
+ entry = entry->next) {
verify(entry);
if (entry_match(discrim, entry)) {
esf(entry, data);
}
static int cmd_add_user(struct helpserv_bot *hs, int from_opserv, struct userNode *user, enum helpserv_level level, int argc, char *argv[]) {
- struct helpserv_user *actor, *new_user;
+ struct helpserv_user *actor;
struct handle_info *handle;
REQUIRE_PARMS(2);
return 0;
}
- new_user = helpserv_add_user(hs, handle, level);
+ helpserv_add_user(hs, handle, level);
helpserv_notice(user, "HSMSG_ADDED_USER", helpserv_level2str(level), handle->handle);
return 1;
continue;
} else if (isdigit(argv[arg][1])) {
char *end_num;
- unsigned long tmp;
+ unsigned int tmp;
tmp = strtoul(argv[arg]+1, &end_num, 10);
+ (void)tmp;
switch (end_num[0]) {
case 0:
continue;
static NICKSERV_FUNC(cmd_reclaim)
{
- struct handle_info *hi;
struct nick_info *ni;
struct userNode *victim;
NICKSERV_MIN_PARMS(2);
- hi = user->handle_info;
ni = dict_find(nickserv_nick_dict, argv[1], 0);
if (!ni) {
reply("NSMSG_UNKNOWN_NICK", argv[1]);
static CMD_FUNC(cmd_topic)
{
struct chanNode *cn;
- unsigned long chan_ts, topic_ts;
+ unsigned long topic_ts;
if (argc < 3)
return 0;
}
if (argc >= 5) {
/* Looks like an Asuka style topic burst. */
- chan_ts = atoi(argv[2]);
topic_ts = atoi(argv[3]);
} else {
- chan_ts = cn->timestamp;
topic_ts = now;
}
SetChannelTopic(cn, GetUserH(origin), argv[argc-1], 0);
{
char numeric[COMBO_NUMERIC_LEN+1];
int local_num = get_local_numeric();
- unsigned long timestamp = now;
struct userNode *old_user = GetUserH(nick);
if (!modes)
if (old_user) {
if (IsLocal(old_user))
return old_user;
- timestamp = old_user->timestamp - 1;
}
if (local_num == -1) {
log_module(MAIN_LOG, LOG_ERROR, "Unable to allocate numnick for service %s", nick);