Changed /names layout

This commit is contained in:
Michiel Broek 2005-05-01 10:50:38 +00:00
parent 4bfe8b3ba7
commit 6f5308cca2

View File

@ -720,6 +720,7 @@ char *chat_put(char *data)
int found; int found;
usr_list *tmp; usr_list *tmp;
chn_list *tmpc; chn_list *tmpc;
char temp[81];
#else #else
int j; int j;
#endif #endif
@ -824,23 +825,27 @@ char *chat_put(char *data)
} else if (strncasecmp(msg, "/names", 6) == 0) { } else if (strncasecmp(msg, "/names", 6) == 0) {
#ifdef USE_EXPERIMENT #ifdef USE_EXPERIMENT
if (strlen(chat_users[i].channel)) { if (strlen(chat_users[i].channel)) {
#else sprintf(buf, "Present in channel %s:", chat_users[i].channel);
if (chat_users[i].channel != -1) { system_msg(chat_users[i].pid, buf);
#endif sprintf(buf, "Nick Real name Flags");
sprintf(buf, "Present in this channel:"); system_msg(chat_users[i].pid, buf);
sprintf(buf, "---------------------------------------- ----------------------------- -------");
system_msg(chat_users[i].pid, buf); system_msg(chat_users[i].pid, buf);
count = 0; count = 0;
#ifdef USE_EXPERIMENT
for (tmp = users; tmp; tmp = tmp->next) { for (tmp = users; tmp; tmp = tmp->next) {
Syslog('r', "/names list %s %s", tmp->name, tmp->channel);
if (strcmp(tmp->channel, chat_users[i].channel) == 0) { if (strcmp(tmp->channel, chat_users[i].channel) == 0) {
sprintf(buf, "%s@%s (%s)%s", tmp->nick, tmp->server, tmp->realname, sprintf(temp, "%s@%s", tmp->nick, tmp->server);
tmp->chanop ? (char *)" (chanop)" : (char *)""); sprintf(buf, "%-40s %-30s %s", temp, tmp->realname,
tmp->chanop ? (char *)"chanop" : (char *)"");
system_msg(chat_users[i].pid, buf); system_msg(chat_users[i].pid, buf);
count++; count++;
} }
} }
#else #else
if (chat_users[i].channel != -1) {
sprintf(buf, "Present in this channel:");
system_msg(chat_users[i].pid, buf);
count = 0;
for (j = 0; j < MAXCLIENT; j++) { for (j = 0; j < MAXCLIENT; j++) {
if ((chat_users[j].channel == chat_users[i].channel) && chat_users[j].pid) { if ((chat_users[j].channel == chat_users[i].channel) && chat_users[j].pid) {
sprintf(buf, "%s %s", chat_users[j].nick, sprintf(buf, "%s %s", chat_users[j].nick,