1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-12-23 08:08:54 -05:00

Merge pull request #426 from Misdre/master

Typing /join #channel → focus the channel if it's already open. closes #406
This commit is contained in:
TingPing 2013-02-24 22:27:55 -08:00
commit 3b7f86aef8

View File

@ -2348,17 +2348,26 @@ static int
cmd_join (struct session *sess, char *tbuf, char *word[], char *word_eol[]) cmd_join (struct session *sess, char *tbuf, char *word[], char *word_eol[])
{ {
char *chan = word[2]; char *chan = word[2];
session *sess_find;
if (*chan) if (*chan)
{ {
char *po, *pass = word[3]; char *po, *pass = word[3];
sess->server->p_join (sess->server, chan, pass);
if (sess->channel[0] == 0 && sess->waitchannel[0]) sess_find = find_channel (sess->server, chan);
if (!sess_find)
{ {
po = strchr (chan, ','); sess->server->p_join (sess->server, chan, pass);
if (po) if (sess->channel[0] == 0 && sess->waitchannel[0])
*po = 0; {
safe_strcpy (sess->waitchannel, chan, CHANLEN); po = strchr (chan, ',');
if (po)
*po = 0;
safe_strcpy (sess->waitchannel, chan, CHANLEN);
}
} }
else
fe_ctrl_gui (sess_find, 2, 0); /* bring-to-front */
return TRUE; return TRUE;
} }
return FALSE; return FALSE;