* note: it is guaranteed that parv[0]..parv[parc-1] are all
* non-NULL pointers.
*/
-#if 0
-/*
- * No need to include handlers.h here the signatures must match
- * and we don't need to force a rebuild of all the handlers everytime
- * we add a new one to the list. --Bleep
- */
-#include "handlers.h"
-#endif /* 0 */
+#include "config.h"
+
#include "channel.h"
#include "client.h"
#include "ircd_string.h"
*/
int m_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
- char* comment;
+ char comment[TOPICLEN];
assert(0 != cptr);
assert(0 != sptr);
assert(cptr == sptr);
return exit_client(cptr, sptr, sptr, "Signed off");
}
}
- comment = cli_name(cptr);
if (parc > 1) {
- comment = parv[parc - 1];
-
- if (0 == strncmp("Local kill", comment, 10) || 0 == strncmp(comment, "Killed", 6))
- comment = cli_name(cptr);
- else if (strlen(comment) > TOPICLEN)
- comment[TOPICLEN] = '\0';
+ strcpy(comment,"Quit: ");
+ strncat(comment,parv[parc-1],sizeof(comment)-strlen("Quit: "));
+ comment[sizeof(comment)] = '\0';
+ }
+ else {
+ strncpy(comment,cli_name(cptr),sizeof(comment));
}
return exit_client(cptr, sptr, sptr, comment);
}
*/
return exit_client(cptr, sptr, sptr, parv[parc - 1]);
}
-
-#if 0
-/*
- * m_quit
- *
- * parv[0] = sender prefix
- * parv[parc-1] = comment
- */
-int m_quit(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
-{
- char *comment = (parc > 1 && parv[parc - 1]) ? parv[parc - 1] : cptr->name;
-
- if (MyUser(sptr))
- {
- if (!strncmp("Local Kill", comment, 10) || !strncmp(comment, "Killed", 6))
- comment = parv[0];
- if (sptr->user)
- {
- struct Membership* chan;
- for (chan = sptr->user->channel; chan; chan = chan->next_channel)
- if (!IsZombie(chan) && !member_can_send_to_channel(chan))
- return exit_client(cptr, sptr, sptr, "Signed off");
- }
- }
- if (strlen(comment) > TOPICLEN)
- comment[TOPICLEN] = '\0';
- return IsServer(sptr) ? 0 : exit_client(cptr, sptr, sptr, comment);
-}
-
-#endif /* 0 */