mirror of
https://github.com/irssi/irssi.git
synced 2024-11-03 04:27:19 -05:00
fixed /WHO handling
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2762 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
2c3d24e1da
commit
ac61d08976
@ -74,26 +74,32 @@ static void proxy_redirect_event(CLIENT_REC *client, const char *command,
|
|||||||
|
|
||||||
static void grab_who(CLIENT_REC *client, const char *channel)
|
static void grab_who(CLIENT_REC *client, const char *channel)
|
||||||
{
|
{
|
||||||
char *chlist, *chanevent;
|
GString *arg;
|
||||||
char **list, **tmp;
|
char **list, **tmp;
|
||||||
|
int count;
|
||||||
|
|
||||||
/* /WHO a,b,c may respond with either one "a,b,c End of WHO" message
|
/* /WHO a,b,c may respond with either one "a,b,c End of WHO" message
|
||||||
or three different "a End of WHO", "b End of WHO", .. messages */
|
or three different "a End of WHO", "b End of WHO", .. messages */
|
||||||
chlist = g_strdup(channel);
|
|
||||||
list = g_strsplit(channel, ",", -1);
|
list = g_strsplit(channel, ",", -1);
|
||||||
|
|
||||||
for (tmp = list; *tmp != NULL; tmp++) {
|
arg = g_string_new(channel);
|
||||||
|
|
||||||
|
for (tmp = list, count = 0; *tmp != NULL; tmp++, count++) {
|
||||||
if (strcmp(*tmp, "0") == 0) {
|
if (strcmp(*tmp, "0") == 0) {
|
||||||
/* /who 0 displays everyone */
|
/* /who 0 displays everyone */
|
||||||
**tmp = '*';
|
**tmp = '*';
|
||||||
}
|
}
|
||||||
|
|
||||||
chanevent = g_strdup_printf("%s %s", chlist, *tmp);
|
g_string_append_c(arg, ' ');
|
||||||
proxy_redirect_event(client, "who", 1, chanevent, -1);
|
g_string_append(arg, *tmp);
|
||||||
g_free(chanevent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proxy_redirect_event(client, "who",
|
||||||
|
client->server->one_endofwho ? 1 : count,
|
||||||
|
arg->str, -1);
|
||||||
|
|
||||||
g_strfreev(list);
|
g_strfreev(list);
|
||||||
g_free(chlist);
|
g_string_free(arg, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handle_client_connect_cmd(CLIENT_REC *client,
|
static void handle_client_connect_cmd(CLIENT_REC *client,
|
||||||
|
Loading…
Reference in New Issue
Block a user