window_item_destroy((WI_ITEM_REC *) channel);
if (channel->joined && !channel->left &&
- channel->server != NULL) {
+ !channel->server->disconnected) {
/* kicked out from channel */
window_bind_add(window, channel->server->tag,
channel->name);
if (channel == NULL)
return;
+ /* already joined to channel, set it active */
window = window_item_window(channel);
+ if (window != active_win)
+ window_set_active(window);
- if (window == active_win) {
- /* channel is in active window, set it active */
- window_item_set_active(active_win,
- (WI_ITEM_REC *) channel);
- } else {
- /* notify user how to move the channel to active
- window. this was used to be done automatically
- but it just confused everyone who did it
- accidentally */
- printformat_window(active_win, MSGLEVEL_CLIENTNOTICE,
- TXT_CHANNEL_MOVE_NOTIFY, channel->name,
- window->refnum);
- }
+ window_item_set_active(active_win, (WI_ITEM_REC *) channel);
}
static void cmd_wjoin_post(const char *data)
window_bind_add(window_item_window(chanrec),
chanrec->server->tag, chanrec->name);
- /* FIXME: kludgy kludgy... and it relies on channel not
- being destroyed immediately.. */
+ /* FIXME: kludgy kludgy... */
signal_emit("command part", 3, data, server, item);
- chanrec->left = TRUE;
- channel_destroy(chanrec);
+
+ if (g_slist_find(channels, chanrec) != NULL) {
+ chanrec->left = TRUE;
+ channel_destroy(chanrec);
+ }
server->channels_join(server, joindata, FALSE);
g_free(joindata);