diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2007-01-08 19:02:20 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2007-01-08 19:02:20 +0000 |
commit | 7484c8b3739a906c310d8fe89e1413ee80726880 (patch) | |
tree | e90116cf182990700e66f9cf35bf4991bdce2e3c /src/irc | |
parent | b9cf14359a252921ea1fa08dcbbc3b710f92710d (diff) | |
download | irssi-7484c8b3739a906c310d8fe89e1413ee80726880.zip |
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
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/dcc/dcc-queue.c | 28 | ||||
-rw-r--r-- | src/irc/dcc/dcc-queue.h | 5 | ||||
-rw-r--r-- | src/irc/dcc/dcc-send.c | 8 |
3 files changed, 5 insertions, 36 deletions
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); } |