From f9daf14f3480647e61e59ae78691e73f0f987ceb Mon Sep 17 00:00:00 2001 From: Perry Lorier Date: Sun, 3 Dec 2000 11:42:12 +0000 Subject: [PATCH] Author: Isomer Log message: Added 'End of Names' when joining channel. thanks to hektik for pointing this out. Testing needed: * Make sure it displays End Of Names when it should * Make sure it doesn't display End Of Names when it shouldn't git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@320 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 5 +++++ include/s_user.h | 1 + ircd/m_join.c | 2 +- ircd/m_names.c | 10 +++++++++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e966b5a..df70ed1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-12-04 Isomer + * ircd/m_names.c: Add NAMES_EON to do_names to say add a + 'end_of_names' reply when done. + * ircd/m_join.c: use NAMES_EON as mentioned above + 2000-12-01 net * ircd/motd.c: add a freelist for struct Motds diff --git a/include/s_user.h b/include/s_user.h index e3e70c7..274bf4a 100644 --- a/include/s_user.h +++ b/include/s_user.h @@ -96,6 +96,7 @@ extern unsigned int umode_make_snomask(unsigned int oldmask, char *arg, #define NAMES_ALL 1 /* List all users in channel */ #define NAMES_VIS 2 /* List only visible users in non-secret channels */ +#define NAMES_EON 4 /* Add an 'End Of Names' reply to the end */ void do_names(struct Client* sptr, struct Channel* chptr, int filter); diff --git a/ircd/m_join.c b/ircd/m_join.c index e6fea02..8908bdf 100644 --- a/ircd/m_join.c +++ b/ircd/m_join.c @@ -292,7 +292,7 @@ int m_join(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) chptr->topic_time); } - do_names(sptr, chptr, NAMES_ALL); /* send /names list */ + do_names(sptr, chptr, NAMES_ALL|NAMES_EON); /* send /names list */ } joinbuf_flush(&join); /* must be first, if there's a JOIN 0 */ diff --git a/ircd/m_names.c b/ircd/m_names.c index 56cc590..1c69828 100644 --- a/ircd/m_names.c +++ b/ircd/m_names.c @@ -108,6 +108,8 @@ * * NAMES_ALL - Lists all users on channel. * NAMES_VIS - Only list visible (-i) users. --Gte (04/06/2000). + * NAMES_EON - When OR'd with the other two, adds an 'End of Names' numeric + * used by m_join * */ @@ -121,6 +123,10 @@ void do_names(struct Client* sptr, struct Channel* chptr, int filter) char buf[BUFSIZE]; struct Client *c2ptr; struct Membership* member; + + assert(chptr); + assert(sptr); + assert((filter&NAMES_ALL) != (filter&NAMES_VIS)); /* Tag Pub/Secret channels accordingly. */ @@ -149,7 +155,7 @@ void do_names(struct Client* sptr, struct Channel* chptr, int filter) { c2ptr = member->user; - if ((filter == NAMES_VIS) && IsInvisible(c2ptr)) + if (((filter&NAMES_VIS)!=0) && IsInvisible(c2ptr)) continue; if (IsZombie(member) && member->user != sptr) @@ -197,6 +203,8 @@ void do_names(struct Client* sptr, struct Channel* chptr, int filter) } if (flag) send_reply(sptr, RPL_NAMREPLY, buf); + if (filter&NAMES_EON) + send_reply(sptr, RPL_ENDOFNAMES, chptr->chname); } /* -- 2.20.1