#include "channel.h"
#include "client.h"
+#include "ircd.h"
+#include "ircd_log.h"
#include "ircd_string.h"
#include "struct.h"
#include "s_misc.h"
#include "ircd_reply.h"
-#include <assert.h>
+/* #include <assert.h> -- Now using assert in ircd_log.h */
#include <string.h>
/*
*/
int m_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
- char* comment;
assert(0 != cptr);
assert(0 != sptr);
assert(cptr == sptr);
if (cli_user(sptr)) {
struct Membership* chan;
for (chan = cli_user(sptr)->channel; chan; chan = chan->next_channel) {
- if (!IsZombie(chan) && !member_can_send_to_channel(chan))
+ if (!IsZombie(chan) && !IsDelayedJoin(chan) && !member_can_send_to_channel(chan, 0))
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';
- }
- return exit_client(cptr, sptr, sptr, comment);
+ if (parc > 1 && !BadPtr(parv[parc - 1]))
+ return exit_client_msg(cptr, sptr, sptr, "Quit: %s", parv[parc - 1]);
+ else
+ return exit_client(cptr, sptr, sptr, "Quit");
}
/*
- * ms_quit - server message handler template
+ * ms_quit - server message handler
*
* parv[0] = sender prefix
* parv[parc - 1] = comment