]> jfr.im git - irc/quakenet/newserv.git/blobdiff - helpmod2/hqueue.c
Merge pull request #1 from meeb/meeb
[irc/quakenet/newserv.git] / helpmod2 / hqueue.c
index c0b8fd6acdfb0ccc4c6a9e61b1cc50a70b9c51a8..9ab9d2175011c49e50b5b10c5d2d3cf1179f3ab5 100644 (file)
@@ -107,6 +107,9 @@ void hqueue_advance(hchannel *hchan, huser *oper, int nadv)
     char buffer[512];
     int counter = nadv;
     huser_channel *huserchan;
+
+    if (hchan == NULL) return;
+
     hchannel_user *hchanuser = hchan->channel_users;
 
     buffer[0] = '\0';
@@ -151,7 +154,7 @@ void hqueue_advance(hchannel *hchan, huser *oper, int nadv)
 
         if ((hchan->flags & H_QUEUE_SPAMMY) && (oper != NULL))
         {
-           helpmod_reply(hchanuser->husr, hchan->real_channel, "It is now your time to state your problem. Please do so on channel %s and direct your questions to %s %s", (huser_get_level(oper) < H_OPER)?hlevel_name(H_STAFF):hlevel_name(H_OPER), hchannel_get_name(hchan), huser_get_nick(oper));
+           helpmod_reply(hchanuser->husr, hchan->real_channel, "It is now your time to state your problem. Please do so on channel %s and direct your questions to %s %s",  hchannel_get_name(hchan), hlevel_title(huser_get_level(oper)), huser_get_nick(oper));
             if (!(huser_get_account_flags(oper) & H_NOSPAM))
                 helpmod_reply(oper, hchan->real_channel, "User %s (%s@%s) is yours, he has been in queue for %s", huser_get_nick(hchanuser->husr), huser_get_ident(hchanuser->husr), huser_get_host(hchanuser->husr), helpmod_strtime(time(NULL) - hchanuser->time_joined));
         }
@@ -162,7 +165,7 @@ void hqueue_advance(hchannel *hchan, huser *oper, int nadv)
         hchanuser = hchanuser->next;
     }
     if (oper != NULL)
-        helpmod_message_channel(hchan, "user%s %s: Please state your questions on this channel and direct them to %s %s", (nadv - counter == 1)?"":"s", buffer, (huser_get_level(oper) < H_OPER)?hlevel_name(H_STAFF):hlevel_name(H_OPER), huser_get_nick(oper));
+        helpmod_message_channel(hchan, "user%s %s: Please state your questions on this channel and direct them to %s %s", (nadv - counter == 1)?"":"s", buffer, hlevel_title(huser_get_level(oper)), huser_get_nick(oper));
     else
         helpmod_message_channel(hchan, "user%s %s: Please state your questions on this channel", (nadv - counter == 1)?"":"s", buffer);
 
@@ -210,7 +213,6 @@ void helpmod_queue_handler (huser *sender, channel* returntype, hchannel *hchan,
                    if (huser_get_level(hchanuser->husr) == H_PEON && huserchan->flags & HCUMODE_VOICE)
                        helpmod_channick_modes(hchanuser->husr, hchan, MC_DEVOICE, HLAZY);
                }
-
            }
 
        }
@@ -229,7 +231,7 @@ void helpmod_queue_handler (huser *sender, channel* returntype, hchannel *hchan,
             int i;
             if (argc == 0)
             {
-                helpmod_reply(sender, returntype, "Can not advance queue: User not specified", hchannel_get_name(hchan));
+                helpmod_reply(sender, returntype, "Can not advance queue: User not specified");
                 return;
             }
             if (argc > H_CMD_MAX_ARGS)
@@ -256,7 +258,7 @@ void helpmod_queue_handler (huser *sender, channel* returntype, hchannel *hchan,
             {
                 if (!sscanf(argv[0], "%d", &nnext) || nnext <= 0 || nnext > 25 /* magic number */)
                 {
-                    helpmod_reply(sender, returntype, "Can not advance queue: Integer [1, 25] expected", hchannel_get_name(hchan));
+                    helpmod_reply(sender, returntype, "Can not advance queue: Integer [1, 25] expected");
                     return;
                 }
             }
@@ -273,7 +275,7 @@ void helpmod_queue_handler (huser *sender, channel* returntype, hchannel *hchan,
             }
             if (!sscanf(argv[0], "%d", &tmp) || tmp < 0 || tmp > 25)
             {
-                helpmod_reply(sender, returntype, "Can not set auto queue: Integer [0, 20] expected", hchannel_get_name(hchan));
+                helpmod_reply(sender, returntype, "Can not set auto queue: Integer [0, 20] expected");
                 return;
             }
             hchan->autoqueue = tmp;