From 7484c8b3739a906c310d8fe89e1413ee80726880 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Mon, 8 Jan 2007 19:02:20 +0000 Subject: Remove dcc_queue_add_passive, use instead another argument in dcc_queue_add to initialize rec->passive. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4407 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/dcc/dcc-queue.c | 28 ++-------------------------- src/irc/dcc/dcc-queue.h | 5 +---- src/irc/dcc/dcc-send.c | 8 ++------ 3 files changed, 5 insertions(+), 36 deletions(-) (limited to 'src/irc/dcc') diff --git a/src/irc/dcc/dcc-queue.c b/src/irc/dcc/dcc-queue.c index 9f982ed9..1e775583 100644 --- a/src/irc/dcc/dcc-queue.c +++ b/src/irc/dcc/dcc-queue.c @@ -110,7 +110,7 @@ void dcc_queue_free(int queue) */ void dcc_queue_add(int queue, int mode, const char *nick, const char *fname, - const char *servertag, CHAT_DCC_REC *chat) + const char *servertag, CHAT_DCC_REC *chat, int passive) { DCC_QUEUE_REC *rec; GSList **qlist; @@ -122,31 +122,7 @@ void dcc_queue_add(int queue, int mode, const char *nick, const char *fname, rec->servertag = g_strdup(servertag); rec->nick = g_strdup(nick); rec->file = g_strdup(fname); - rec->passive = FALSE; - - qlist = (GSList **) &g_ptr_array_index(queuelist, queue); - if (mode == DCC_QUEUE_PREPEND) - *qlist = g_slist_insert(*qlist, rec, 1); - else - *qlist = g_slist_append(*qlist, rec); -} - -/* Same as above but adds a passive DCC to the queue */ -void dcc_queue_add_passive(int queue, int mode, const char *nick, - const char *fname, const char *servertag, - CHAT_DCC_REC *chat) -{ - DCC_QUEUE_REC *rec; - GSList **qlist; - - g_assert(queue >= 0 && queue < queuelist->len); - - rec = g_new0(DCC_QUEUE_REC, 1); - rec->chat = chat; - rec->servertag = g_strdup(servertag); - rec->nick = g_strdup(nick); - rec->file = g_strdup(fname); - rec->passive = TRUE; + rec->passive = passive; qlist = (GSList **) &g_ptr_array_index(queuelist, queue); if (mode == DCC_QUEUE_PREPEND) diff --git a/src/irc/dcc/dcc-queue.h b/src/irc/dcc/dcc-queue.h index d13fae66..b05beb47 100644 --- a/src/irc/dcc/dcc-queue.h +++ b/src/irc/dcc/dcc-queue.h @@ -28,10 +28,7 @@ int dcc_queue_old(const char *nick, const char *servertag); /* adds nick/fname/servertag triplet into queue */ void dcc_queue_add(int queue, int mode, const char *nick, const char *fname, - const char *servertag, CHAT_DCC_REC *chat); -void dcc_queue_add_passive(int queue, int mode, const char *nick, - const char *fname, const char *servertag, - CHAT_DCC_REC *chat); + const char *servertag, CHAT_DCC_REC *chat, int passive); int dcc_queue_remove_head(int queue); diff --git a/src/irc/dcc/dcc-send.c b/src/irc/dcc/dcc-send.c index 14d7d1e6..83242ab1 100644 --- a/src/irc/dcc/dcc-send.c +++ b/src/irc/dcc/dcc-send.c @@ -149,12 +149,8 @@ static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat, } } - if (!passive) - dcc_queue_add(queue, add_mode, nick, - fname, servertag, chat); - else - dcc_queue_add_passive(queue, add_mode, nick, - fname, servertag, chat); + dcc_queue_add(queue, add_mode, nick, + fname, servertag, chat, passive); files++; g_free(fname); } -- cgit v1.2.3