summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-16 14:39:33 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-16 14:39:33 +0000
commit8ce1d773aa212a88c416d4953bdbf63036674602 (patch)
tree7b93c9dee6a167293d2040a21e9105b16a864de6 /src
parent0d919f7439603c81196a793ecd7ffab3f11ee43d (diff)
downloadirssi-8ce1d773aa212a88c416d4953bdbf63036674602.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/channels-query.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/src/irc/core/channels-query.c b/src/irc/core/channels-query.c
index 24895a95..8b29b45a 100644
--- a/src/irc/core/channels-query.c
+++ b/src/irc/core/channels-query.c
@@ -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;