Add /names

weechat-hashes
C. McEnroe 2020-02-08 03:19:56 -05:00
parent b6bf6d62b0
commit ff6424a87c
2 changed files with 9 additions and 0 deletions

View File

@ -130,6 +130,8 @@ can be typed
Join a channel. Join a channel.
.It Ic /me Op Ar action .It Ic /me Op Ar action
Send an action message. Send an action message.
.It Ic /names
List users in the channel.
.It Ic /nick Ar nick .It Ic /nick Ar nick
Change nicknames. Change nicknames.
.It Ic /notice Ar message .It Ic /notice Ar message

View File

@ -101,6 +101,12 @@ static void commandNick(size_t id, char *params) {
ircFormat("NICK :%s\r\n", params); ircFormat("NICK :%s\r\n", params);
} }
static void commandNames(size_t id, char *params) {
(void)params;
ircFormat("NAMES :%s\r\n", idNames[id]);
replies.names++;
}
static void commandQuery(size_t id, char *params) { static void commandQuery(size_t id, char *params) {
if (!params) return; if (!params) return;
size_t query = idFor(params); size_t query = idFor(params);
@ -137,6 +143,7 @@ static const struct Handler {
{ "/debug", commandDebug }, { "/debug", commandDebug },
{ "/join", commandJoin }, { "/join", commandJoin },
{ "/me", commandMe }, { "/me", commandMe },
{ "/names", commandNames },
{ "/nick", commandNick }, { "/nick", commandNick },
{ "/notice", commandNotice }, { "/notice", commandNotice },
{ "/part", commandPart }, { "/part", commandPart },