X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/59cfd72e68e7b41c134eb066f1537abf7f57e024..f4b4216a9fed79fd3d2b1a35e8ecd3c948c598a0:/modules/m_names.c diff --git a/modules/m_names.c b/modules/m_names.c index b1e4b279..bbebb8a4 100644 --- a/modules/m_names.c +++ b/modules/m_names.c @@ -172,14 +172,31 @@ names_global(struct Client *source_p) if(dont_show) continue; - if((cur_len + NICKLEN + 2) > (BUFSIZE - 3)) + if (IsCapable(source_p, CLICAP_USERHOST_IN_NAMES)) { - sendto_one(source_p, "%s", buf); - cur_len = mlen; - t = buf + mlen; + if (cur_len + strlen(target_p->name) + strlen(target_p->username) + strlen(target_p->host) + strlen(" !@") >= BUFSIZE - strlen("\r\n")) + { + *(t - 1) = '\0'; + sendto_one(source_p, "%s", buf); + cur_len = mlen; + t = buf + mlen; + } + + tlen = sprintf(t, "%s!%s@%s ", target_p->name, target_p->username, target_p->host); + } + else + { + if(cur_len + strlen(target_p->name) + strlen(" ") >= BUFSIZE - strlen("\r\n")) + { + *(t - 1) = '\0'; + sendto_one(source_p, "%s", buf); + cur_len = mlen; + t = buf + mlen; + } + + tlen = sprintf(t, "%s ", target_p->name); } - tlen = sprintf(t, "%s ", target_p->name); cur_len += tlen; t += tlen; }