diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-23 19:11:35 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2014-01-23 19:11:35 +0000 |
commit | 3408dd8c218a267139d9c4d64e3c6eb90502373a (patch) | |
tree | f822abd81f37ed9a93992f9765b03a0e1dc11f12 /src | |
parent | 4794646cb6c696141411a34f2359d255e5ad9bad (diff) |
- Implemented "userhost-in-names" client capability
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@2911 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'src')
-rw-r--r-- | src/channel.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/channel.c b/src/channel.c index 4994df2..d422688 100644 --- a/src/channel.c +++ b/src/channel.c @@ -437,6 +437,7 @@ channel_member_names(struct Client *source_p, struct Channel *chptr, int tlen = 0; int is_member = IsMember(source_p, chptr); int multi_prefix = HasCap(source_p, CAP_MULTI_PREFIX) != 0; + int uhnames = HasCap(source_p, CAP_UHNAMES) != 0; if (PubChannel(chptr) || is_member) { @@ -452,7 +453,11 @@ channel_member_names(struct Client *source_p, struct Channel *chptr, if (HasUMode(ms->client_p, UMODE_INVISIBLE) && !is_member) continue; - tlen = strlen(ms->client_p->name) + 1; /* nick + space */ + if (!uhnames) + tlen = strlen(ms->client_p->name) + 1; /* nick + space */ + else + tlen = strlen(ms->client_p->name) + strlen(ms->client_p->username) + + strlen(ms->client_p->host) + 3; if (!multi_prefix) { @@ -476,8 +481,13 @@ channel_member_names(struct Client *source_p, struct Channel *chptr, t = start; } - t += sprintf(t, "%s%s ", get_member_status(ms, multi_prefix), - ms->client_p->name); + if (!uhnames) + t += sprintf(t, "%s%s ", get_member_status(ms, multi_prefix), + ms->client_p->name); + else + t += sprintf(t, "%s%s!%s@%s ", get_member_status(ms, multi_prefix), + ms->client_p->name, ms->client_p->username, + ms->client_p->host); } if (tlen != 0) @@ -488,8 +498,8 @@ channel_member_names(struct Client *source_p, struct Channel *chptr, } if (show_eon) - sendto_one(source_p, form_str(RPL_ENDOFNAMES), - me.name, source_p->name, chptr->chname); + sendto_one(source_p, form_str(RPL_ENDOFNAMES), me.name, + source_p->name, chptr->chname); } /*! \brief adds client to invite list |