1
0
forked from bip/bip

Send after join /names before backlog

there're some irc client which create windows, session etc only on 366
packet received (End of /NAMES list) like Miranda IM, QIP
that's why backlog sent from bip after 332/333 packets and just before
353/336 goes to nowhere
i'v took a look at other irc bouncers, all of them send backlog right
after 353 /336 packets
so, all what we need is just chamge the order in
static void irc_send_join(struct link_client *ic, struct channel *chan)
This commit is contained in:
Vladislav Grishenko 2008-11-23 15:12:32 +01:00 committed by Arnaud Cornet
parent 0f0d0427b8
commit c3bb6639b6

View File

@ -531,6 +531,21 @@ static void irc_send_join(struct link_client *ic, struct channel *chan)
WRITE_LINE4(CONN(ic), P_SERV, "333", LINK(ic)->l_server->nick, WRITE_LINE4(CONN(ic), P_SERV, "333", LINK(ic)->l_server->nick,
chan->name, chan->creator, chan->create_ts); chan->name, chan->creator, chan->create_ts);
list_t *name_list = channel_name_list(chan);
char *s;
while ((s = list_remove_first(name_list))) {
char tmptype[2];
tmptype[0] = chan->type;
tmptype[1] = 0;
WRITE_LINE4(CONN(ic), P_SERV, "353", LINK(ic)->l_server->nick,
tmptype, chan->name, s);
free(s);
}
list_free(name_list);
WRITE_LINE3(CONN(ic), P_SERV, "366", LINK(ic)->l_server->nick,
chan->name, "End of /NAMES list.");
/* XXX: could be more efficient */ /* XXX: could be more efficient */
if (!user->backlog) { if (!user->backlog) {
mylog(LOG_DEBUG, "Backlog disabled for %s, not backlogging", mylog(LOG_DEBUG, "Backlog disabled for %s, not backlogging",
@ -550,21 +565,6 @@ static void irc_send_join(struct link_client *ic, struct channel *chan)
mylog(LOG_DEBUG, "Nothing to backlog for %s/%s", mylog(LOG_DEBUG, "Nothing to backlog for %s/%s",
user->name, chan->name); user->name, chan->name);
} }
list_t *name_list = channel_name_list(chan);
char *s;
while ((s = list_remove_first(name_list))) {
char tmptype[2];
tmptype[0] = chan->type;
tmptype[1] = 0;
WRITE_LINE4(CONN(ic), P_SERV, "353", LINK(ic)->l_server->nick,
tmptype, chan->name, s);
free(s);
}
list_free(name_list);
WRITE_LINE3(CONN(ic), P_SERV, "366", LINK(ic)->l_server->nick,
chan->name, "End of /NAMES list.");
} }
static void write_init_string(connection_t *c, struct line *line, char *nick) static void write_init_string(connection_t *c, struct line *line, char *nick)