In my case, I let the XChat window (almost) always opened (with the current set of channel tabs still opened) even after I disconnect, so I can suspend the machine, turn it off, get some sleep and the next day I can open it in the state it was. The only problem is that after a reconnect, XChat will not automatically join the channel tabs that are currently opened. I think it should always join all the channels again, the same way it does when you reconnect without a prior explicit "disconnect" command.
Anyway, that is my use case. So I decided to fix this.
After some search I was able to find this issue was already reported before (https://bugs.launchpad.net/ubuntu/+source/xchat/+bug/215078 and http://sourceforge.net/tracker/index.php?func=detail&aid=1405961&group_id=239&atid=100239), but I wasn't able to find any solution.
The steps I used and was always able to reproduce this issue are reported in https://bugs.launchpad.net/ubuntu/+source/xchat/+bug/215078/comments/7, quoted here:
1. Connect to server, autojoin #testchannel.
2. /quit - disconnects.
3. /reconnect - reconnects, does NOT autojoin #testchannel.
So I decided to patch this myself, and it worked. I didn't test it extensively, it simply worked as expected in my case, where I connect to one server only (Freenode). This might be useful for a bunch of other users, and the ones who reported it. I just hope my patch is correct and won't break anything else.
---
Patch:
- Code: Select all
diff -urN xchat-cur/src/common/server.c xchat-new/src/common/server.c
--- xchat-cur/src/common/server.c 2010-10-08 15:51:45.000000000 -0300
+++ xchat-new/src/common/server.c 2010-10-08 15:52:23.000000000 -0300
@@ -1143,8 +1143,15 @@
/* print "Disconnected" to each window using this server */
EMIT_SIGNAL (XP_TE_DISCON, sess, errorstring (err), NULL, NULL, NULL, 0);
- if (!sess->channel[0] || sess->type == SESS_CHANNEL)
+ if (!sess->channel[0])
+ {
clear_channel (sess);
+ }
+ else if (sess->type == SESS_CHANNEL)
+ {
+ strcpy (sess->willjoinchannel, sess->channel);
+ clear_channel (sess);
+ }
}
list = list->next;
}