Merge remote branch 'upstream/master'
authorroot <root@mail.pk910.de>
Tue, 1 Nov 2011 21:02:19 +0000 (22:02 +0100)
committerroot <root@mail.pk910.de>
Tue, 1 Nov 2011 21:02:19 +0000 (22:02 +0100)
src/chanserv.c
src/chanserv.help
src/helpfile.c
src/ioset.c
src/log.c
src/mod-helpserv.c
src/modcmd.c
src/nickserv.c
src/proto-p10.c

index a0aca8e93cba58d3bbbb6a5104b91616b34253a1..9e856960333c238dd26b214bf890b304ce2c21f0 100644 (file)
@@ -4050,56 +4050,6 @@ static CHANSERV_FUNC(cmd_access)
     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)
 {
@@ -4145,7 +4095,6 @@ cmd_list_users(struct userNode *user, struct chanNode *channel, unsigned int arg
     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)
     {
@@ -4507,13 +4456,10 @@ chanserv_del_invite_mark(void *data)
 
 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])))
@@ -7935,7 +7881,6 @@ user_read_helper(const char *key, struct record_data *rd, struct chanData *chan)
 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;
 
@@ -7966,7 +7911,7 @@ ban_read_helper(const char *key, struct record_data *rd, struct chanData *chan)
     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 *
@@ -8688,8 +8633,8 @@ init_chanserv(const char *nick)
     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);
index 693d6f09f81db06b324957583c2cb222d965760f..0562477130b14fe4688b19d50e54cf681b14514a 100644 (file)
         "  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.",
index b8116b225234b80ba40d57d75672ce9d29c8c1ac..aaf0d80ab961eed5048225f3d241f536ff4a106b 100644 (file)
@@ -394,7 +394,7 @@ vsend_message(const char *dest, struct userNode *src, struct handle_info *handle
     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 == '$') {
@@ -448,7 +448,7 @@ vsend_message(const char *dest, struct userNode *src, struct handle_info *handle
      * 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;
@@ -657,12 +657,10 @@ vsend_message(const char *dest, struct userNode *src, struct handle_info *handle
             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
index 04cae40524e53a4f423b7d56cb117fcfcf25dccb..33622af1c55e39f19a298a2702444163d875b074 100644 (file)
@@ -439,7 +439,7 @@ ioset_find_line_length(struct io_fd *fd) {
 
 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);
@@ -474,7 +474,6 @@ ioset_buffered_read(struct io_fd *fd) {
         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;
index 4ea72cf54516ec3db300be79423f2ec74d99bb0f..33b0a8b78709fee0763b19eb2dd497955f656964 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -730,12 +730,11 @@ log_entry_search(struct logSearch *discrim, entry_search_func esf, void *data)
     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);
index 384339db9e5db67037f94d8aec3467145590146c..7f645a9d73d68b4c646f07cf11f063fc17d45336 100644 (file)
@@ -1371,7 +1371,7 @@ static void helpserv_del_user(struct helpserv_bot *hs, struct helpserv_user *hs_
 }
 
 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);
@@ -1399,7 +1399,7 @@ static int cmd_add_user(struct helpserv_bot *hs, int from_opserv, struct userNod
         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;
index 43a553155d2e5885824ae760a4f53737181c8608..290d75c75c79ee09c3539f683c53d888f2bb8cef 100644 (file)
@@ -995,9 +995,10 @@ check_alias_args(char *argv[], unsigned int argc) {
             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;
index d04e8efa53abdd1007c722f68fe48c95c65e56e8..a370fd4463d923d00bb6e1dd12235190501c8de9 100644 (file)
@@ -2940,12 +2940,10 @@ static OPTION_FUNC(opt_fakeident)
 
 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]);
index 4db33d8ae38f0d57ea39a45ecd34553bf499b582..e4c96207161b52632542133572ef27e368a1ef35 100644 (file)
@@ -1489,7 +1489,7 @@ static CMD_FUNC(cmd_clearmode)
 static CMD_FUNC(cmd_topic)
 {
     struct chanNode *cn;
-    unsigned long chan_ts, topic_ts;
+    unsigned long topic_ts;
 
     if (argc < 3)
         return 0;
@@ -1499,10 +1499,8 @@ static CMD_FUNC(cmd_topic)
     }
     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);
@@ -2240,7 +2238,6 @@ AddLocalUser(const char *nick, const char *ident, const char *hostname, const ch
 {
     char numeric[COMBO_NUMERIC_LEN+1];
     int local_num = get_local_numeric();
-    unsigned long timestamp = now;
     struct userNode *old_user = GetUserH(nick);
 
     if (!modes)
@@ -2248,7 +2245,6 @@ AddLocalUser(const char *nick, const char *ident, const char *hostname, const ch
     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);