Allow $mychannels() to query a window attached to a different server

Otherwise, there's really no point in passing this function a window refnum at all.
This commit is contained in:
Kevin Easton
2017-11-10 16:57:26 +11:00
parent a028aebdb9
commit 3ec950a7d7
2 changed files with 7 additions and 6 deletions

View File

@@ -1,5 +1,7 @@
[Changes 1.2.2] [Changes 1.2.2]
* Allow $mychannels() to query a window attached to a different server. (caf)
* Fix crash when passing $mychannels() a non-existent window refnum. (caf) * Fix crash when passing $mychannels() a non-existent window refnum. (caf)
* Remove dll_functions, dll_numeric, dll_commands, dll_variable, dll_ctcp, * Remove dll_functions, dll_numeric, dll_commands, dll_variable, dll_ctcp,

View File

@@ -1732,13 +1732,12 @@ extern char * BX_create_channel_list(Window *window)
ChannelList *chan; ChannelList *chan;
char buffer[BIG_BUFFER_SIZE]; char buffer[BIG_BUFFER_SIZE];
for (*buffer = 0, chan = get_server_channels(window->server); chan; chan = chan->next) buffer[0] = 0;
for (chan = get_server_channels(window->server); chan; chan = chan->next)
{ {
if (chan->server == from_server) strlcat(buffer, chan->channel, sizeof buffer);
{ strlcat(buffer, space, sizeof buffer);
strlcat(buffer, chan->channel, sizeof buffer);
strlcat(buffer, space, sizeof buffer);
}
} }
return m_strdup(buffer); return m_strdup(buffer);
} }