X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_part.c;h=bc34ce93572eb3433536ef5fcecb1a61f9a09ae3;hb=refs%2Fheads%2Fupstream-ssl;hp=19ea1f02532f3e5fd8f1ab9d72e95100520c0b80;hpb=fda0e2796ececf42f7a36f8066cc63fa1ef736fc;p=ircu2.10.12-pk.git diff --git a/ircd/m_part.c b/ircd/m_part.c index 19ea1f0..bc34ce9 100644 --- a/ircd/m_part.c +++ b/ircd/m_part.c @@ -79,25 +79,20 @@ * 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 "hash.h" #include "ircd.h" +#include "ircd_log.h" #include "ircd_reply.h" #include "ircd_string.h" #include "numeric.h" #include "numnicks.h" #include "send.h" -#include +/* #include -- Now using assert in ircd_log.h */ #include /* @@ -112,10 +107,11 @@ int m_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) struct Channel *chptr; struct Membership *member; struct JoinBuf parts; + unsigned int flags = 0; char *p = 0; char *name; - cli_flags(sptr) &= ~FLAGS_TS8; + ClrFlag(sptr, FLAG_TS8); /* check number of arguments */ if (parc < 2 || parv[1][0] == '\0') @@ -144,8 +140,17 @@ int m_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) assert(!IsZombie(member)); /* Local users should never zombie */ - joinbuf_join(&parts, chptr, /* part client from channel */ - member_can_send_to_channel(member) ? 0 : CHFL_BANNED); + if (!member_can_send_to_channel(member, 0)) + { + flags |= CHFL_BANNED; + /* Remote clients don't want to see a comment either. */ + parts.jb_comment = 0; + } + + if (IsDelayedJoin(member)) + flags |= CHFL_DELAYED; + + joinbuf_join(&parts, chptr, flags); /* part client from channel */ } return joinbuf_flush(&parts); /* flush channel parts */ @@ -167,7 +172,7 @@ int ms_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) char *p = 0; char *name; - cli_flags(sptr) &= ~FLAGS_TS8; + ClrFlag(sptr, FLAG_TS8); /* check number of arguments */ if (parc < 2 || parv[1][0] == '\0') @@ -192,13 +197,9 @@ int ms_part(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) if (IsZombie(member)) /* figure out special flags... */ flags |= CHFL_ZOMBIE; - /* - * XXX BUG: If a client /part's with a part notice, on channels where - * he's banned, local clients will not see the part notice, but remote - * clients will. - */ - if (!member_can_send_to_channel(member)) - flags |= CHFL_BANNED; + + if (IsDelayedJoin(member)) + flags |= CHFL_DELAYED; /* part user from channel */ joinbuf_join(&parts, chptr, flags);