X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_quit.c;h=9ccc361566d6e0078a7766ad4ab7551b79c53e29;hb=refs%2Fheads%2Fupstream-ssl;hp=38d47e29d5c74ae74bc63cb65557b3cc9a7a20d1;hpb=b8294f6c0db86ec8d204b0fda51070f3a415fb57;p=ircu2.10.12-pk.git diff --git a/ircd/m_quit.c b/ircd/m_quit.c index 38d47e2..9ccc361 100644 --- a/ircd/m_quit.c +++ b/ircd/m_quit.c @@ -83,12 +83,14 @@ #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 /* @@ -99,7 +101,6 @@ */ int m_quit(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { - char comment[TOPICLEN]; assert(0 != cptr); assert(0 != sptr); assert(cptr == sptr); @@ -107,25 +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"); } } - - if (parc > 1) { - 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); + 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