mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
If the last query fails we should make the channel synced.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2031 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
0d919f7439
commit
8ce1d773aa
@ -304,6 +304,27 @@ static void query_check(IRC_SERVER_REC *server)
|
||||
query_send(server, query);
|
||||
}
|
||||
|
||||
/* if there's no more queries in queries in buffer, send the sync signal */
|
||||
static void channel_checksync(IRC_CHANNEL_REC *channel)
|
||||
{
|
||||
SERVER_QUERY_REC *rec;
|
||||
int n;
|
||||
|
||||
g_return_if_fail(channel != NULL);
|
||||
|
||||
if (channel->synced)
|
||||
return; /* already synced */
|
||||
|
||||
rec = channel->server->chanqueries;
|
||||
for (n = 0; n < CHANNEL_QUERIES; n++) {
|
||||
if (g_slist_find(rec->queries[n], channel))
|
||||
return;
|
||||
}
|
||||
|
||||
channel->synced = TRUE;
|
||||
signal_emit("channel sync", 1, channel);
|
||||
}
|
||||
|
||||
/* Error occured when trying to execute query - abort and try again. */
|
||||
static void query_current_error(IRC_SERVER_REC *server)
|
||||
{
|
||||
@ -336,6 +357,10 @@ static void query_current_error(IRC_SERVER_REC *server)
|
||||
rec->queries[query] =
|
||||
g_slist_append(rec->queries[query], tmp->data);
|
||||
}
|
||||
} else {
|
||||
/* check if failed channels are synced after this error */
|
||||
g_slist_foreach(rec->current_queries,
|
||||
(GFunc) channel_checksync, NULL);
|
||||
}
|
||||
|
||||
g_slist_free(rec->current_queries);
|
||||
@ -367,27 +392,6 @@ static void sig_channel_joined(IRC_CHANNEL_REC *channel)
|
||||
query_check(channel->server);
|
||||
}
|
||||
|
||||
/* if there's no more queries in queries in buffer, send the sync signal */
|
||||
static void channel_checksync(IRC_CHANNEL_REC *channel)
|
||||
{
|
||||
SERVER_QUERY_REC *rec;
|
||||
int n;
|
||||
|
||||
g_return_if_fail(channel != NULL);
|
||||
|
||||
if (channel->synced)
|
||||
return; /* already synced */
|
||||
|
||||
rec = channel->server->chanqueries;
|
||||
for (n = 0; n < CHANNEL_QUERIES; n++) {
|
||||
if (g_slist_find(rec->queries[n], channel))
|
||||
return;
|
||||
}
|
||||
|
||||
channel->synced = TRUE;
|
||||
signal_emit("channel sync", 1, channel);
|
||||
}
|
||||
|
||||
static void channel_got_query(IRC_CHANNEL_REC *chanrec, int query_type)
|
||||
{
|
||||
SERVER_QUERY_REC *rec;
|
||||
|
Loading…
Reference in New Issue
Block a user