summaryrefslogtreecommitdiff
path: root/src/irc/dcc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-12-28 17:54:13 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-12-28 17:54:13 +0000
commitbd6fe052bce57849a7a850c0c5bee0ad896b9460 (patch)
tree95f3cb743874913a6dc1ff1314264b88989a4b60 /src/irc/dcc
parent9c18cb00e7d096e46f5853f802724da4c59c2857 (diff)
downloadirssi-bd6fe052bce57849a7a850c0c5bee0ad896b9460.zip
Added time, size and level setting types. Breaks some settings - I'll add
automatic converter to these settings later. Meanwhile you CVS users can fix your config files yourself :) Time settings allow using "days", "hours", "minutes", "seconds" and "milliseconds" or several of their abbreviations. For example "5d 4h 5msecs". Size settings allow using "gbytes", "mbytes", "kbytes" and "bytes" or their abbrevations. For example "5MB". Level settings are currently handled pretty much the way they were before. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3080 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc/dcc')
-rw-r--r--src/irc/dcc/dcc-autoget.c6
-rw-r--r--src/irc/dcc/dcc.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/irc/dcc/dcc-autoget.c b/src/irc/dcc/dcc-autoget.c
index 87dd00d8..bf9a3b66 100644
--- a/src/irc/dcc/dcc-autoget.c
+++ b/src/irc/dcc/dcc-autoget.c
@@ -57,8 +57,8 @@ static void sig_dcc_request(GET_DCC_REC *dcc, const char *nickaddr)
/* check file size limit, NOTE: it's still possible to send a
bogus file size and then just send what ever sized file.. */
- max_size = settings_get_int("dcc_autoget_max_size");
- if (max_size > 0 && (uoff_t)max_size*1024 < dcc->size)
+ max_size = settings_get_size("dcc_autoget_max_size");
+ if (max_size > 0 && (uoff_t)max_size < dcc->size)
return;
/* ok. but do we want/need to resume? */
@@ -77,7 +77,7 @@ void dcc_autoget_init(void)
settings_add_bool("dcc", "dcc_autoget", FALSE);
settings_add_bool("dcc", "dcc_autoaccept_lowports", FALSE);
settings_add_bool("dcc", "dcc_autoresume", FALSE);
- settings_add_int("dcc", "dcc_autoget_max_size", 0);
+ settings_add_size("dcc", "dcc_autoget_max_size", 0);
settings_add_str("dcc", "dcc_autoget_masks", "");
signal_add_last("dcc request", (SIGNAL_FUNC) sig_dcc_request);
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index 44ef3f20..e3e04107 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -420,7 +420,7 @@ static int dcc_timeout_func(void)
GSList *tmp, *next;
time_t now;
- now = time(NULL)-settings_get_int("dcc_timeout");
+ now = time(NULL)-settings_get_time("dcc_timeout")/1000;
for (tmp = dcc_conns; tmp != NULL; tmp = next) {
DCC_REC *dcc = tmp->data;
@@ -514,7 +514,7 @@ void irc_dcc_init(void)
dcc_timeouttag = g_timeout_add(1000, (GSourceFunc) dcc_timeout_func, NULL);
settings_add_str("dcc", "dcc_port", "0");
- settings_add_int("dcc", "dcc_timeout", 300);
+ settings_add_time("dcc", "dcc_timeout", "5min");
settings_add_str("dcc", "dcc_own_ip", "");
signal_add("event connected", (SIGNAL_FUNC) sig_connected);