X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_quit.c;h=9ccc361566d6e0078a7766ad4ab7551b79c53e29;hb=refs%2Fheads%2Fupstream-ssl;hp=45a3a95c73e46c1c5067c0490d24b3523f19abee;hpb=fda0e2796ececf42f7a36f8066cc63fa1ef736fc;p=ircu2.10.12-pk.git diff --git a/ircd/m_quit.c b/ircd/m_quit.c index 45a3a95..9ccc361 100644 --- a/ircd/m_quit.c +++ b/ircd/m_quit.c @@ -79,22 +79,18 @@ * 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.h" +#include "ircd_log.h" #include "ircd_string.h" #include "struct.h" #include "s_misc.h" #include "ircd_reply.h" -#include +/* #include -- Now using assert in ircd_log.h */ #include /* @@ -105,7 +101,6 @@ */ int m_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { - char* comment; assert(0 != cptr); assert(0 != sptr); assert(cptr == sptr); @@ -113,26 +108,19 @@ int m_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) 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 @@ -150,33 +138,3 @@ int ms_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) */ 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 */