diff options
author | Timo Sirainen <cras@irssi.org> | 2004-03-23 22:06:41 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2004-03-23 22:06:41 +0000 |
commit | af4bcb70f2634b8917166e948e9d631ad3b5cccd (patch) | |
tree | 28cfa9891aedd97ac1f73c1a2501cccba643bd20 /src/irc/dcc/dcc-queue.c | |
parent | 2a12dfb9d00a6196e071c1e9a965e6e11aa46471 (diff) | |
download | irssi-af4bcb70f2634b8917166e948e9d631ad3b5cccd.zip |
Passive DCC support by Francesco Fracassi (francesco.f at openssl.it)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3236 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/dcc/dcc-queue.c')
-rw-r--r-- | src/irc/dcc/dcc-queue.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/irc/dcc/dcc-queue.c b/src/irc/dcc/dcc-queue.c index 677bc07b..9f982ed9 100644 --- a/src/irc/dcc/dcc-queue.c +++ b/src/irc/dcc/dcc-queue.c @@ -122,6 +122,31 @@ 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; qlist = (GSList **) &g_ptr_array_index(queuelist, queue); if (mode == DCC_QUEUE_PREPEND) |