diff options
-rw-r--r-- | po/fr.po | 198 | ||||
-rw-r--r-- | po/weechat.pot | 194 | ||||
-rw-r--r-- | src/common/hotlist.c | 3 | ||||
-rw-r--r-- | src/common/weechat.h | 6 | ||||
-rw-r--r-- | src/common/weeconfig.c | 23 | ||||
-rw-r--r-- | src/common/weeconfig.h | 1 | ||||
-rw-r--r-- | src/gui/curses/gui-display.c | 32 | ||||
-rw-r--r-- | src/gui/gui.h | 1 | ||||
-rw-r--r-- | src/irc/irc-dcc.c | 139 | ||||
-rw-r--r-- | src/irc/irc.h | 1 | ||||
-rw-r--r-- | weechat/po/fr.po | 198 | ||||
-rw-r--r-- | weechat/po/weechat.pot | 194 | ||||
-rw-r--r-- | weechat/src/common/hotlist.c | 3 | ||||
-rw-r--r-- | weechat/src/common/weechat.h | 6 | ||||
-rw-r--r-- | weechat/src/common/weeconfig.c | 23 | ||||
-rw-r--r-- | weechat/src/common/weeconfig.h | 1 | ||||
-rw-r--r-- | weechat/src/gui/curses/gui-display.c | 32 | ||||
-rw-r--r-- | weechat/src/gui/gui.h | 1 | ||||
-rw-r--r-- | weechat/src/irc/irc-dcc.c | 139 | ||||
-rw-r--r-- | weechat/src/irc/irc.h | 1 |
20 files changed, 668 insertions, 528 deletions
@@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.0.8-pre2\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2004-09-01 00:46+0200\n" +"POT-Creation-Date: 2004-09-09 23:11+0200\n" "PO-Revision-Date: 2004-08-08 20:47+0200\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -20,7 +20,7 @@ msgstr "" msgid "%s cannot allocate new nick\n" msgstr "%s ompossible d'allouer un nouveau pseudo\n" -#: src/irc/irc-server.c:130 src/common/weeconfig.c:1235 +#: src/irc/irc-server.c:130 src/common/weeconfig.c:1230 msgid "Unable to get user's name" msgstr "Impossible de déterminer le nom d'utilisateur" @@ -1557,35 +1557,45 @@ msgstr "" "%s: tous les noms d'utilisateurs déclarés sont déjà en cours d'utilisation, " "fermeture de la connexion avec le serveur !\n" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Waiting" msgstr "Attente" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Connecting" msgstr "Connexion" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Active" msgstr "Actif" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Done" msgstr "Terminé" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Failed" msgstr "Echoué" -#: src/irc/irc-dcc.c:39 +#: src/irc/irc-dcc.c:44 msgid "Aborted" msgstr "Interrompu" -#: src/irc/irc-dcc.c:85 +#: src/irc/irc-dcc.c:191 #, c-format msgid "%s not enough memory for new DCC\n" msgstr "%s pas assez de mémoire pour un nouveau DCC\n" +#: src/irc/irc-dcc.c:259 +#, c-format +msgid "DCC: file \"%s\" received from \"%s\": ok!\n" +msgstr "DCC: fichier \"%s\" reçu de \"%s\": ok !\n" + +#: src/irc/irc-dcc.c:284 +#, c-format +msgid "aborting active DCC: \"%s\" from %s\n" +msgstr "abandon du DCC actif: \"%s\" de %s\n" + #: src/plugins/perl/wee-perl.c:83 #, c-format msgid "" @@ -1647,32 +1657,32 @@ msgstr "" "%s impossible d'ajouter la fonction pour le message \"%s\" (mémoire " "insuffisante)\n" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "bytes" msgstr "octets" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Kb" msgstr "Ko" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Mb" msgstr "Mo" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Gb" msgstr "Go" -#: src/gui/curses/gui-display.c:966 +#: src/gui/curses/gui-display.c:987 #, c-format msgid "%d:[not connected] " msgstr "%d:[non connecté] " -#: src/gui/curses/gui-display.c:974 +#: src/gui/curses/gui-display.c:995 msgid "[Act: " msgstr "[Act: " -#: src/gui/curses/gui-display.c:1009 src/gui/curses/gui-display.c:1012 +#: src/gui/curses/gui-display.c:1030 src/gui/curses/gui-display.c:1033 msgid "-MORE-" msgstr "-PLUS-" @@ -1680,17 +1690,17 @@ msgstr "-PLUS-" msgid "server" msgstr "serveur" -#: src/gui/gui-common.c:302 +#: src/gui/gui-common.c:304 #, c-format msgid "%s not enough memory for infobar message\n" msgstr "%s pas assez de mémoire pour un message de la barre d'infos\n" -#: src/gui/gui-common.c:437 +#: src/gui/gui-common.c:439 #, c-format msgid "%s not enough memory for new line!\n" msgstr "%s pas assez de mémoire pour une nouvelle ligne !\n" -#: src/gui/gui-common.c:480 +#: src/gui/gui-common.c:482 msgid "not enough memory!\n" msgstr "pas assez de mémoire !\n" @@ -2386,17 +2396,17 @@ msgstr "%s pas assez de mémoire pour le répertoire personnel\n" msgid "%s unable to create ~/.weechat directory\n" msgstr "%s impossible de créer le répertoire ~/.weechat\n" -#: src/common/weechat.c:391 +#: src/common/weechat.c:388 #, c-format msgid "%s unable to create/append to log file (~/.weechat/%s)" msgstr "%s impossible de créer/ajouter dans le fichier de log (~/.weechat/%s)" -#: src/common/weechat.c:414 +#: src/common/weechat.c:411 #, c-format msgid "%sWelcome to " msgstr "%sBienvenue dans " -#: src/common/weechat.c:427 +#: src/common/weechat.c:424 msgid "compiled on" msgstr "compilé le" @@ -2822,183 +2832,174 @@ msgstr "" "texte écrit à la fin d'une discussion sauvegardées (voir man strftime pour " "le format de date/heure)" -#: src/common/weeconfig.c:461 +#: src/common/weeconfig.c:460 msgid "automatically accept dcc files" msgstr "accepte automatiquement les fichiers dcc" -#: src/common/weeconfig.c:462 +#: src/common/weeconfig.c:461 msgid "automatically accept incoming dcc files" msgstr "accepte automatiquement les fichiers dcc entrants" -#: src/common/weeconfig.c:465 -msgid "max size when auto accepting file" -msgstr "taille maxi pour accepter un fichier" - -#: src/common/weeconfig.c:466 -msgid "maximum size for incoming file when automatically accepted" -msgstr "" -"taille maximum pour un fichier entrant lorsqu'il est accepté automatiquement" - -#: src/common/weeconfig.c:469 +#: src/common/weeconfig.c:464 msgid "automatically accept dcc chats" msgstr "accepte automatiquement les demandes de discussion dcc" -#: src/common/weeconfig.c:470 +#: src/common/weeconfig.c:465 msgid "automatically accept dcc chats (use carefully!)" msgstr "" "accepte automatiquement les demandes de discussion dcc (à utiliser avec " "précaution !)" -#: src/common/weeconfig.c:473 +#: src/common/weeconfig.c:468 msgid "timeout for dcc request" msgstr "délai d'attente pour les requêtes dcc" -#: src/common/weeconfig.c:474 +#: src/common/weeconfig.c:469 msgid "timeout for dcc request (in seconds)" msgstr "délai d'attente pour les requêtes dcc (en secondes)" -#: src/common/weeconfig.c:477 +#: src/common/weeconfig.c:472 msgid "block size for dcc packets" msgstr "taille de bloc pour les paquets dcc" -#: src/common/weeconfig.c:478 +#: src/common/weeconfig.c:473 msgid "block size for dcc packets in bytes (default: 1024)" msgstr "taille de bloc pour les paquets dcc en octets (défaut: 1024)" -#: src/common/weeconfig.c:481 +#: src/common/weeconfig.c:476 msgid "path for incoming files with dcc" msgstr "chemin les fichiers reçus par dcc" -#: src/common/weeconfig.c:482 +#: src/common/weeconfig.c:477 msgid "path for writing incoming files with dcc (default: user home)" msgstr "" "chemin pour écrire les fichiers reçus par dcc (par défaut: répertoire de " "l'utilisateur)" -#: src/common/weeconfig.c:485 +#: src/common/weeconfig.c:480 msgid "default path for sending files with dcc" msgstr "chemin par défaut pour envoyer les fichiers par dcc" -#: src/common/weeconfig.c:486 +#: src/common/weeconfig.c:481 msgid "" "path for reading files when sending thru dcc (when no path is specified)" msgstr "" "chemin pour lire les fichiers lorsqu'ils sont envoyés par dcc (quand aucun " "chemin n'est spécifié)" -#: src/common/weeconfig.c:489 +#: src/common/weeconfig.c:484 msgid "automatically rename dcc files if already exists" msgstr "renomme automatiquement les fichiers dcc s'ils existent déjà" -#: src/common/weeconfig.c:490 +#: src/common/weeconfig.c:485 msgid "rename incoming files if already exists (add '.1', '.2', ...)" msgstr "" "renommer les fichiers reçus s'ils existent déjà (ajoute '.1', '.2', ...)" -#: src/common/weeconfig.c:493 +#: src/common/weeconfig.c:488 msgid "automatically resume aborted transfers" msgstr "continuer automatiquement les transferts non terminés" -#: src/common/weeconfig.c:494 +#: src/common/weeconfig.c:489 msgid "" "automatically resume dcc transfer if connection with remote host is loosed" msgstr "" "continuer automatiquement les transferts dcc si la connexion avec la machine " "distante a été perdue" -#: src/common/weeconfig.c:508 +#: src/common/weeconfig.c:503 msgid "use proxy" msgstr "utiliser un proxy" -#: src/common/weeconfig.c:509 +#: src/common/weeconfig.c:504 msgid "use a proxy server to connect to irc server" msgstr "utiliser un proxy pour se connecter au serveur irc" -#: src/common/weeconfig.c:512 +#: src/common/weeconfig.c:507 msgid "proxy address" msgstr "adresse du proxy" -#: src/common/weeconfig.c:513 +#: src/common/weeconfig.c:508 msgid "proxy server address (IP or hostname)" msgstr "adresse du serveur proxy (IP ou nom)" -#: src/common/weeconfig.c:516 +#: src/common/weeconfig.c:511 msgid "port for proxy" msgstr "port pour le proxy" -#: src/common/weeconfig.c:517 +#: src/common/weeconfig.c:512 msgid "port for connecting to proxy server" msgstr "port pour se connecter au serveur proxy" -#: src/common/weeconfig.c:520 +#: src/common/weeconfig.c:515 msgid "proxy password" msgstr "mot de passe pour le proxy" -#: src/common/weeconfig.c:521 +#: src/common/weeconfig.c:516 msgid "password for proxy server" msgstr "mot de passe pour le serveur proxy" -#: src/common/weeconfig.c:532 +#: src/common/weeconfig.c:527 msgid "server name" msgstr "nom du serveur" -#: src/common/weeconfig.c:533 +#: src/common/weeconfig.c:528 msgid "name associated to IRC server (for display only)" msgstr "nom associé au serveur IRC (pour affichage seulement)" -#: src/common/weeconfig.c:536 +#: src/common/weeconfig.c:531 msgid "automatically connect to server" msgstr "connexion automatique au serveur" -#: src/common/weeconfig.c:537 +#: src/common/weeconfig.c:532 msgid "automatically connect to server when WeeChat is starting" msgstr "connexion automatique au serveur quand WeeChat démarre" -#: src/common/weeconfig.c:540 +#: src/common/weeconfig.c:535 msgid "server address or hostname" msgstr "adresse ou nom du serveur" -#: src/common/weeconfig.c:541 +#: src/common/weeconfig.c:536 msgid "IP address or hostname of IRC server" msgstr "adresse IP ou nom du serveur IRC" -#: src/common/weeconfig.c:544 +#: src/common/weeconfig.c:539 msgid "port for IRC server" msgstr "port pour le serveur IRC" -#: src/common/weeconfig.c:545 +#: src/common/weeconfig.c:540 msgid "port for connecting to server" msgstr "port pour se connecter au serveur" -#: src/common/weeconfig.c:548 +#: src/common/weeconfig.c:543 msgid "server password" msgstr "mot de passe pour le serveur" -#: src/common/weeconfig.c:549 +#: src/common/weeconfig.c:544 msgid "password for IRC server" msgstr "mot de passe pour le serveur IRC" -#: src/common/weeconfig.c:552 +#: src/common/weeconfig.c:547 msgid "nickname for server" msgstr "pseudo pour le serveur" -#: src/common/weeconfig.c:553 +#: src/common/weeconfig.c:548 msgid "nickname to use on IRC server" msgstr "pseudo à utiliser sur le serveur IRC" -#: src/common/weeconfig.c:556 +#: src/common/weeconfig.c:551 msgid "alternate nickname for server" msgstr "pseudo alternatif pour le serveur" -#: src/common/weeconfig.c:557 +#: src/common/weeconfig.c:552 msgid "alternate nickname to use on IRC server (if nickname is already used)" msgstr "pseudo alternatif pour le serveur IRC (si le pseudo est déjà utilisé)" -#: src/common/weeconfig.c:560 +#: src/common/weeconfig.c:555 msgid "2nd alternate nickname for server" msgstr "2nd pseudo alternatif pour le serveur" -#: src/common/weeconfig.c:561 +#: src/common/weeconfig.c:556 msgid "" "2nd alternate nickname to use on IRC server (if alternate nickname is " "already used)" @@ -3006,87 +3007,87 @@ msgstr "" "2nd pseudo alternatif pour le serveur IRC (si le pseudo alternatif est déjà " "utilisé)" -#: src/common/weeconfig.c:564 +#: src/common/weeconfig.c:559 msgid "user name for server" msgstr "nom d'utilisateur pour le serveur" -#: src/common/weeconfig.c:565 +#: src/common/weeconfig.c:560 msgid "user name to use on IRC server" msgstr "nom d'utilisateur pour le serveur IRC" -#: src/common/weeconfig.c:568 +#: src/common/weeconfig.c:563 msgid "real name for server" msgstr "nom réel pour le serveur" -#: src/common/weeconfig.c:569 +#: src/common/weeconfig.c:564 msgid "real name to use on IRC server" msgstr "nom réel pour le serveur IRC" -#: src/common/weeconfig.c:572 src/common/weeconfig.c:573 +#: src/common/weeconfig.c:567 src/common/weeconfig.c:568 msgid "first command to run when connected to server" msgstr "commande à exécuter en premier lorsque connecté au serveur" -#: src/common/weeconfig.c:576 +#: src/common/weeconfig.c:571 msgid "list of channels to join when connected to server" msgstr "liste des canaux à rejoindre lorsque connecté au serveur" -#: src/common/weeconfig.c:577 +#: src/common/weeconfig.c:572 msgid "comma separated list of channels to join when connected to server" msgstr "" "liste des canaux (séparés par des virgules) à rejoindre lorsque connecté au " "serveur" -#: src/common/weeconfig.c:799 +#: src/common/weeconfig.c:794 #, c-format msgid "%s %s, line %d: new server, but previous was incomplete\n" msgstr "%s %s, ligne %d: nouveau serveur, mais le précédent était incomplet\n" -#: src/common/weeconfig.c:808 +#: src/common/weeconfig.c:803 #, c-format msgid "%s %s, line %d: server '%s' already exists\n" msgstr "%s %s, ligne %d: le serveur '%s' existe déjà\n" -#: src/common/weeconfig.c:820 +#: src/common/weeconfig.c:815 #, c-format msgid "%s %s, line %d: unable to create server\n" msgstr "%s %s, ligne %d: impossible de créer le serveur\n" -#: src/common/weeconfig.c:859 +#: src/common/weeconfig.c:854 #, c-format msgid "%s unable to assign default int with string (\"%s\")\n" msgstr "%s impossible d'assigner la valeur entière avec la chaîne (\"%s\")\n" -#: src/common/weeconfig.c:870 +#: src/common/weeconfig.c:865 #, c-format msgid "%s unable to assign default color (\"%s\")\n" msgstr "%s impossible d'assigner la couleur par défaut (\"%s\")\n" -#: src/common/weeconfig.c:909 +#: src/common/weeconfig.c:904 #, c-format msgid "%s config file \"%s\" not found.\n" msgstr "%s fichier de configuration \"%s\" non trouvé.\n" -#: src/common/weeconfig.c:941 +#: src/common/weeconfig.c:936 #, c-format msgid "%s %s, line %d: invalid syntax, missing \"]\"\n" msgstr "%s %s, ligne %d: syntaxe invalide, il manque \"]\"\n" -#: src/common/weeconfig.c:958 +#: src/common/weeconfig.c:953 #, c-format msgid "%s %s, line %d: unknown section identifier (\"%s\")\n" msgstr "%s %s, ligne %d: section inconnue (\"%s\")\n" -#: src/common/weeconfig.c:976 +#: src/common/weeconfig.c:971 #, c-format msgid "%s %s, line %d: invalid syntax, missing \"=\"\n" msgstr "%s %s, ligne %d: syntaxe invalide, il manque \"=\"\n" -#: src/common/weeconfig.c:1010 +#: src/common/weeconfig.c:1005 #, c-format msgid "%s %s, line %d: invalid option \"%s\"\n" msgstr "%s %s, ligne %d: option \"%s\" invalide\n" -#: src/common/weeconfig.c:1021 +#: src/common/weeconfig.c:1016 #, c-format msgid "" "%s %s, line %d: invalid value foroption '%s'\n" @@ -3095,7 +3096,7 @@ msgstr "" "%s %s, ligne %d: valeur invalide pour l'option '%s'\n" "Attendu: valeur booléenne: 'off' ou 'on'\n" -#: src/common/weeconfig.c:1030 +#: src/common/weeconfig.c:1025 #, c-format msgid "" "%s %s, line %d: invalid value for option '%s'\n" @@ -3104,7 +3105,7 @@ msgstr "" "%s %s, ligne %d: valeur invalide pour l'option '%s'\n" "Attendu: entier compris entre %d et %d\n" -#: src/common/weeconfig.c:1041 +#: src/common/weeconfig.c:1036 #, c-format msgid "" "%s %s, line %d: invalid value for option '%s'\n" @@ -3113,26 +3114,26 @@ msgstr "" "%s %s, ligne %d: valeur invalide pour l'option '%s'\n" "Attendu: une de ces chaînes: " -#: src/common/weeconfig.c:1057 +#: src/common/weeconfig.c:1052 #, c-format msgid "%s %s, line %d: invalid color name for option '%s'\n" msgstr "%s %s, ligne %d: nom de couleur invalide pour l'option '%s'\n" -#: src/common/weeconfig.c:1116 src/common/weeconfig.c:1284 +#: src/common/weeconfig.c:1111 src/common/weeconfig.c:1279 #, c-format msgid "%s cannot create file \"%s\"\n" msgstr "%s impossible de créer le fichier \"%s\"\n" -#: src/common/weeconfig.c:1122 +#: src/common/weeconfig.c:1117 #, c-format msgid "%s: creating default config file...\n" msgstr "%s: création du fichier de configuration par défaut...\n" -#: src/common/weeconfig.c:1123 +#: src/common/weeconfig.c:1118 msgid "creating default config file\n" msgstr "création du fichier de configuration par défaut\n" -#: src/common/weeconfig.c:1126 src/common/weeconfig.c:1293 +#: src/common/weeconfig.c:1121 src/common/weeconfig.c:1288 #, c-format msgid "" "#\n" @@ -3141,9 +3142,6 @@ msgstr "" "#\n" "# %s: fichier de configuration, créé par %s v%s le %s#\n" -#: src/common/weeconfig.c:1290 +#: src/common/weeconfig.c:1285 msgid "saving config to disk\n" msgstr "sauvegarde de la configuration sur disque\n" - -#~ msgid "color for active window" -#~ msgstr "couleur pour la fenêtre active" diff --git a/po/weechat.pot b/po/weechat.pot index 4934830d5..855d8ae8e 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2004-09-01 00:46+0200\n" +"POT-Creation-Date: 2004-09-09 23:11+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -20,7 +20,7 @@ msgstr "" msgid "%s cannot allocate new nick\n" msgstr "" -#: src/irc/irc-server.c:130 src/common/weeconfig.c:1235 +#: src/irc/irc-server.c:130 src/common/weeconfig.c:1230 msgid "Unable to get user's name" msgstr "" @@ -1456,35 +1456,45 @@ msgid "" "server!\n" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Waiting" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Connecting" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Active" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Done" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Failed" msgstr "" -#: src/irc/irc-dcc.c:39 +#: src/irc/irc-dcc.c:44 msgid "Aborted" msgstr "" -#: src/irc/irc-dcc.c:85 +#: src/irc/irc-dcc.c:191 #, c-format msgid "%s not enough memory for new DCC\n" msgstr "" +#: src/irc/irc-dcc.c:259 +#, c-format +msgid "DCC: file \"%s\" received from \"%s\": ok!\n" +msgstr "" + +#: src/irc/irc-dcc.c:284 +#, c-format +msgid "aborting active DCC: \"%s\" from %s\n" +msgstr "" + #: src/plugins/perl/wee-perl.c:83 #, c-format msgid "" @@ -1540,32 +1550,32 @@ msgstr "" msgid "%s unable to add handler for \"%s\" message (not enough memory)\n" msgstr "" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "bytes" msgstr "" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Kb" msgstr "" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Mb" msgstr "" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Gb" msgstr "" -#: src/gui/curses/gui-display.c:966 +#: src/gui/curses/gui-display.c:987 #, c-format msgid "%d:[not connected] " msgstr "" -#: src/gui/curses/gui-display.c:974 +#: src/gui/curses/gui-display.c:995 msgid "[Act: " msgstr "" -#: src/gui/curses/gui-display.c:1009 src/gui/curses/gui-display.c:1012 +#: src/gui/curses/gui-display.c:1030 src/gui/curses/gui-display.c:1033 msgid "-MORE-" msgstr "" @@ -1573,17 +1583,17 @@ msgstr "" msgid "server" msgstr "" -#: src/gui/gui-common.c:302 +#: src/gui/gui-common.c:304 #, c-format msgid "%s not enough memory for infobar message\n" msgstr "" -#: src/gui/gui-common.c:437 +#: src/gui/gui-common.c:439 #, c-format msgid "%s not enough memory for new line!\n" msgstr "" -#: src/gui/gui-common.c:480 +#: src/gui/gui-common.c:482 msgid "not enough memory!\n" msgstr "" @@ -2230,17 +2240,17 @@ msgstr "" msgid "%s unable to create ~/.weechat directory\n" msgstr "" -#: src/common/weechat.c:391 +#: src/common/weechat.c:388 #, c-format msgid "%s unable to create/append to log file (~/.weechat/%s)" msgstr "" -#: src/common/weechat.c:414 +#: src/common/weechat.c:411 #, c-format msgid "%sWelcome to " msgstr "" -#: src/common/weechat.c:427 +#: src/common/weechat.c:424 msgid "compiled on" msgstr "" @@ -2637,303 +2647,295 @@ msgid "" "text written when ending log file (see man strftime for date/time specifiers)" msgstr "" -#: src/common/weeconfig.c:461 +#: src/common/weeconfig.c:460 msgid "automatically accept dcc files" msgstr "" -#: src/common/weeconfig.c:462 +#: src/common/weeconfig.c:461 msgid "automatically accept incoming dcc files" msgstr "" -#: src/common/weeconfig.c:465 -msgid "max size when auto accepting file" -msgstr "" - -#: src/common/weeconfig.c:466 -msgid "maximum size for incoming file when automatically accepted" -msgstr "" - -#: src/common/weeconfig.c:469 +#: src/common/weeconfig.c:464 msgid "automatically accept dcc chats" msgstr "" -#: src/common/weeconfig.c:470 +#: src/common/weeconfig.c:465 msgid "automatically accept dcc chats (use carefully!)" msgstr "" -#: src/common/weeconfig.c:473 +#: src/common/weeconfig.c:468 msgid "timeout for dcc request" msgstr "" -#: src/common/weeconfig.c:474 +#: src/common/weeconfig.c:469 msgid "timeout for dcc request (in seconds)" msgstr "" -#: src/common/weeconfig.c:477 +#: src/common/weeconfig.c:472 msgid "block size for dcc packets" msgstr "" -#: src/common/weeconfig.c:478 +#: src/common/weeconfig.c:473 msgid "block size for dcc packets in bytes (default: 1024)" msgstr "" -#: src/common/weeconfig.c:481 +#: src/common/weeconfig.c:476 msgid "path for incoming files with dcc" msgstr "" -#: src/common/weeconfig.c:482 +#: src/common/weeconfig.c:477 msgid "path for writing incoming files with dcc (default: user home)" msgstr "" -#: src/common/weeconfig.c:485 +#: src/common/weeconfig.c:480 msgid "default path for sending files with dcc" msgstr "" -#: src/common/weeconfig.c:486 +#: src/common/weeconfig.c:481 msgid "" "path for reading files when sending thru dcc (when no path is specified)" msgstr "" -#: src/common/weeconfig.c:489 +#: src/common/weeconfig.c:484 msgid "automatically rename dcc files if already exists" msgstr "" -#: src/common/weeconfig.c:490 +#: src/common/weeconfig.c:485 msgid "rename incoming files if already exists (add '.1', '.2', ...)" msgstr "" -#: src/common/weeconfig.c:493 +#: src/common/weeconfig.c:488 msgid "automatically resume aborted transfers" msgstr "" -#: src/common/weeconfig.c:494 +#: src/common/weeconfig.c:489 msgid "" "automatically resume dcc transfer if connection with remote host is loosed" msgstr "" -#: src/common/weeconfig.c:508 +#: src/common/weeconfig.c:503 msgid "use proxy" msgstr "" -#: src/common/weeconfig.c:509 +#: src/common/weeconfig.c:504 msgid "use a proxy server to connect to irc server" msgstr "" -#: src/common/weeconfig.c:512 +#: src/common/weeconfig.c:507 msgid "proxy address" msgstr "" -#: src/common/weeconfig.c:513 +#: src/common/weeconfig.c:508 msgid "proxy server address (IP or hostname)" msgstr "" -#: src/common/weeconfig.c:516 +#: src/common/weeconfig.c:511 msgid "port for proxy" msgstr "" -#: src/common/weeconfig.c:517 +#: src/common/weeconfig.c:512 msgid "port for connecting to proxy server" msgstr "" -#: src/common/weeconfig.c:520 +#: src/common/weeconfig.c:515 msgid "proxy password" msgstr "" -#: src/common/weeconfig.c:521 +#: src/common/weeconfig.c:516 msgid "password for proxy server" msgstr "" -#: src/common/weeconfig.c:532 +#: src/common/weeconfig.c:527 msgid "server name" msgstr "" -#: src/common/weeconfig.c:533 +#: src/common/weeconfig.c:528 msgid "name associated to IRC server (for display only)" msgstr "" -#: src/common/weeconfig.c:536 +#: src/common/weeconfig.c:531 msgid "automatically connect to server" msgstr "" -#: src/common/weeconfig.c:537 +#: src/common/weeconfig.c:532 msgid "automatically connect to server when WeeChat is starting" msgstr "" -#: src/common/weeconfig.c:540 +#: src/common/weeconfig.c:535 msgid "server address or hostname" msgstr "" -#: src/common/weeconfig.c:541 +#: src/common/weeconfig.c:536 msgid "IP address or hostname of IRC server" msgstr "" -#: src/common/weeconfig.c:544 +#: src/common/weeconfig.c:539 msgid "port for IRC server" msgstr "" -#: src/common/weeconfig.c:545 +#: src/common/weeconfig.c:540 msgid "port for connecting to server" msgstr "" -#: src/common/weeconfig.c:548 +#: src/common/weeconfig.c:543 msgid "server password" msgstr "" -#: src/common/weeconfig.c:549 +#: src/common/weeconfig.c:544 msgid "password for IRC server" msgstr "" -#: src/common/weeconfig.c:552 +#: src/common/weeconfig.c:547 msgid "nickname for server" msgstr "" -#: src/common/weeconfig.c:553 +#: src/common/weeconfig.c:548 msgid "nickname to use on IRC server" msgstr "" -#: src/common/weeconfig.c:556 +#: src/common/weeconfig.c:551 msgid "alternate nickname for server" msgstr "" -#: src/common/weeconfig.c:557 +#: src/common/weeconfig.c:552 msgid "alternate nickname to use on IRC server (if nickname is already used)" msgstr "" -#: src/common/weeconfig.c:560 +#: src/common/weeconfig.c:555 msgid "2nd alternate nickname for server" msgstr "" -#: src/common/weeconfig.c:561 +#: src/common/weeconfig.c:556 msgid "" "2nd alternate nickname to use on IRC server (if alternate nickname is " "already used)" msgstr "" -#: src/common/weeconfig.c:564 +#: src/common/weeconfig.c:559 msgid "user name for server" msgstr "" -#: src/common/weeconfig.c:565 +#: src/common/weeconfig.c:560 msgid "user name to use on IRC server" msgstr "" -#: src/common/weeconfig.c:568 +#: src/common/weeconfig.c:563 msgid "real name for server" msgstr "" -#: src/common/weeconfig.c:569 +#: src/common/weeconfig.c:564 msgid "real name to use on IRC server" msgstr "" -#: src/common/weeconfig.c:572 src/common/weeconfig.c:573 +#: src/common/weeconfig.c:567 src/common/weeconfig.c:568 msgid "first command to run when connected to server" msgstr "" -#: src/common/weeconfig.c:576 +#: src/common/weeconfig.c:571 msgid "list of channels to join when connected to server" msgstr "" -#: src/common/weeconfig.c:577 +#: src/common/weeconfig.c:572 msgid "comma separated list of channels to join when connected to server" msgstr "" -#: src/common/weeconfig.c:799 +#: src/common/weeconfig.c:794 #, c-format msgid "%s %s, line %d: new server, but previous was incomplete\n" msgstr "" -#: src/common/weeconfig.c:808 +#: src/common/weeconfig.c:803 #, c-format msgid "%s %s, line %d: server '%s' already exists\n" msgstr "" -#: src/common/weeconfig.c:820 +#: src/common/weeconfig.c:815 #, c-format msgid "%s %s, line %d: unable to create server\n" msgstr "" -#: src/common/weeconfig.c:859 +#: src/common/weeconfig.c:854 #, c-format msgid "%s unable to assign default int with string (\"%s\")\n" msgstr "" -#: src/common/weeconfig.c:870 +#: src/common/weeconfig.c:865 #, c-format msgid "%s unable to assign default color (\"%s\")\n" msgstr "" -#: src/common/weeconfig.c:909 +#: src/common/weeconfig.c:904 #, c-format msgid "%s config file \"%s\" not found.\n" msgstr "" -#: src/common/weeconfig.c:941 +#: src/common/weeconfig.c:936 #, c-format msgid "%s %s, line %d: invalid syntax, missing \"]\"\n" msgstr "" -#: src/common/weeconfig.c:958 +#: src/common/weeconfig.c:953 #, c-format msgid "%s %s, line %d: unknown section identifier (\"%s\")\n" msgstr "" -#: src/common/weeconfig.c:976 +#: src/common/weeconfig.c:971 #, c-format msgid "%s %s, line %d: invalid syntax, missing \"=\"\n" msgstr "" -#: src/common/weeconfig.c:1010 +#: src/common/weeconfig.c:1005 #, c-format msgid "%s %s, line %d: invalid option \"%s\"\n" msgstr "" -#: src/common/weeconfig.c:1021 +#: src/common/weeconfig.c:1016 #, c-format msgid "" "%s %s, line %d: invalid value foroption '%s'\n" "Expected: boolean value: 'off' or 'on'\n" msgstr "" -#: src/common/weeconfig.c:1030 +#: src/common/weeconfig.c:1025 #, c-format msgid "" "%s %s, line %d: invalid value for option '%s'\n" "Expected: integer between %d and %d\n" msgstr "" -#: src/common/weeconfig.c:1041 +#: src/common/weeconfig.c:1036 #, c-format msgid "" "%s %s, line %d: invalid value for option '%s'\n" "Expected: one of these strings: " msgstr "" -#: src/common/weeconfig.c:1057 +#: src/common/weeconfig.c:1052 #, c-format msgid "%s %s, line %d: invalid color name for option '%s'\n" msgstr "" -#: src/common/weeconfig.c:1116 src/common/weeconfig.c:1284 +#: src/common/weeconfig.c:1111 src/common/weeconfig.c:1279 #, c-format msgid "%s cannot create file \"%s\"\n" msgstr "" -#: src/common/weeconfig.c:1122 +#: src/common/weeconfig.c:1117 #, c-format msgid "%s: creating default config file...\n" msgstr "" -#: src/common/weeconfig.c:1123 +#: src/common/weeconfig.c:1118 msgid "creating default config file\n" msgstr "" -#: src/common/weeconfig.c:1126 src/common/weeconfig.c:1293 +#: src/common/weeconfig.c:1121 src/common/weeconfig.c:1288 #, c-format msgid "" "#\n" "# %s configuration file, created by %s v%s on %s#\n" msgstr "" -#: src/common/weeconfig.c:1290 +#: src/common/weeconfig.c:1285 msgid "saving config to disk\n" msgstr "" diff --git a/src/common/hotlist.c b/src/common/hotlist.c index e8be5659c..b784fda11 100644 --- a/src/common/hotlist.c +++ b/src/common/hotlist.c @@ -80,6 +80,9 @@ hotlist_add (int priority, t_gui_buffer *buffer) { t_weechat_hotlist *new_hotlist, *pos_hotlist; + if (!buffer) + return; + if ((pos_hotlist = hotlist_search (buffer))) { /* return if priority is greater or equal than the one to add */ diff --git a/src/common/weechat.h b/src/common/weechat.h index 51b0cf9e9..95c8a24ed 100644 --- a/src/common/weechat.h +++ b/src/common/weechat.h @@ -91,9 +91,11 @@ /* directory separator, depending on OS */ #ifdef _WIN32 - #define DIR_SEPARATOR "\\" + #define DIR_SEPARATOR "\\" + #define DIR_SEPARATOR_CHAR '\\' #else - #define DIR_SEPARATOR "/" + #define DIR_SEPARATOR "/" + #define DIR_SEPARATOR_CHAR '/' #endif /* global variables and functions */ diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c index 4936443c8..98d889330 100644 --- a/src/common/weeconfig.c +++ b/src/common/weeconfig.c @@ -448,7 +448,6 @@ t_config_option weechat_options_log[] = /* config, dcc section */ int cfg_dcc_auto_accept_files; -int cfg_dcc_auto_accept_max_size; int cfg_dcc_auto_accept_chats; int cfg_dcc_timeout; int cfg_dcc_blocksize; @@ -460,40 +459,36 @@ int cfg_dcc_auto_resume; t_config_option weechat_options_dcc[] = { { "dcc_auto_accept_files", N_("automatically accept dcc files"), N_("automatically accept incoming dcc files"), - OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, - NULL, NULL, &cfg_dcc_auto_accept_files, NULL, NULL }, - { "dcc_auto_accept_max_size", N_("max size when auto accepting file"), - N_("maximum size for incoming file when automatically accepted"), - OPTION_TYPE_INT, 0, INT_MAX, 0, - NULL, NULL, &cfg_dcc_auto_accept_max_size, NULL, NULL }, + OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE, + NULL, NULL, &cfg_dcc_auto_accept_files, NULL, config_change_noop }, { "dcc_auto_accept_chats", N_("automatically accept dcc chats"), N_("automatically accept dcc chats (use carefully!)"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, - NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, NULL }, + NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, config_change_noop }, { "dcc_timeout", N_("timeout for dcc request"), N_("timeout for dcc request (in seconds)"), OPTION_TYPE_INT, 1, INT_MAX, 300, - NULL, NULL, &cfg_dcc_timeout, NULL, NULL }, + NULL, NULL, &cfg_dcc_timeout, NULL, config_change_noop }, { "dcc_blocksize", N_("block size for dcc packets"), N_("block size for dcc packets in bytes (default: 1024)"), OPTION_TYPE_INT, 1024, 102400, 1024, - NULL, NULL, &cfg_dcc_blocksize, NULL, NULL }, + NULL, NULL, &cfg_dcc_blocksize, NULL, config_change_noop }, { "dcc_download_path", N_("path for incoming files with dcc"), N_("path for writing incoming files with dcc (default: user home)"), OPTION_TYPE_STRING, 0, 0, 0, - "~", NULL, NULL, &cfg_dcc_download_path, NULL }, + "~", NULL, NULL, &cfg_dcc_download_path, config_change_noop }, { "dcc_upload_path", N_("default path for sending files with dcc"), N_("path for reading files when sending thru dcc (when no path is specified)"), OPTION_TYPE_STRING, 0, 0, 0, "~", - NULL, NULL, &cfg_dcc_upload_path, NULL }, + NULL, NULL, &cfg_dcc_upload_path, config_change_noop }, { "dcc_auto_rename", N_("automatically rename dcc files if already exists"), N_("rename incoming files if already exists (add '.1', '.2', ...)"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, - NULL, NULL, &cfg_dcc_auto_rename, NULL, NULL }, + NULL, NULL, &cfg_dcc_auto_rename, NULL, config_change_noop }, { "dcc_auto_resume", N_("automatically resume aborted transfers"), N_("automatically resume dcc transfer if connection with remote host is loosed"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, - NULL, NULL, &cfg_dcc_auto_resume, NULL, NULL }, + NULL, NULL, &cfg_dcc_auto_resume, NULL, config_change_noop }, { NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL } }; diff --git a/src/common/weeconfig.h b/src/common/weeconfig.h index 91ddcdf7a..a94c5bb65 100644 --- a/src/common/weeconfig.h +++ b/src/common/weeconfig.h @@ -146,7 +146,6 @@ extern char *cfg_log_start_string; extern char *cfg_log_end_string; extern int cfg_dcc_auto_accept_files; -extern int cfg_dcc_auto_accept_max_size; extern int cfg_dcc_auto_accept_chats; extern int cfg_dcc_timeout; extern int cfg_dcc_blocksize; diff --git a/src/gui/curses/gui-display.c b/src/gui/curses/gui-display.c index 0c1fdcab5..b978bb38d 100644 --- a/src/gui/curses/gui-display.c +++ b/src/gui/curses/gui-display.c @@ -604,6 +604,9 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT); mvwprintw (ptr_win->win_chat, i, 0, " %-16s %s", ptr_dcc->nick, ptr_dcc->filename); + if (ptr_dcc->filename_suffix > 0) + wprintw (ptr_win->win_chat, " (.%d)", + ptr_dcc->filename_suffix); gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT); mvwprintw (ptr_win->win_chat, i + 1, 0, " %s ", (ptr_dcc->type == DCC_FILE_RECV) ? @@ -1008,8 +1011,12 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase) COLOR_WIN_STATUS_DATA_HIGHLIGHT); break; } - wprintw (ptr_win->win_status, "%d", - ptr_hotlist->buffer->number); + if (ptr_hotlist->buffer->dcc) + wprintw (ptr_win->win_status, "%d/DCC", + ptr_hotlist->buffer->number); + else + wprintw (ptr_win->win_status, "%d", + ptr_hotlist->buffer->number); gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS); if (ptr_hotlist->next_hotlist) @@ -1341,6 +1348,27 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer) } /* + * gui_get_dcc_buffer: get pointer to DCC buffer (DCC buffer created if not existing) + */ + +t_gui_buffer * +gui_get_dcc_buffer () +{ + t_gui_buffer *ptr_buffer; + + /* check if dcc buffer exists */ + for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer) + { + if (BUFFER_IS_DCC (ptr_buffer)) + break; + } + if (ptr_buffer) + return ptr_buffer; + else + return gui_buffer_new (gui_current_window, NULL, NULL, 1, 0); +} + +/* * gui_switch_to_dcc_buffer: switch to dcc buffer (create it if it does not exist) */ diff --git a/src/gui/gui.h b/src/gui/gui.h index 4f44ba8d8..aca1d2620 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -263,6 +263,7 @@ extern void gui_draw_buffer_infobar (t_gui_buffer *, int); extern void gui_draw_buffer_input (t_gui_buffer *, int); extern void gui_redraw_buffer (t_gui_buffer *); extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *); +extern t_gui_buffer *gui_get_dcc_buffer (); extern void gui_switch_to_dcc_buffer (); extern void gui_switch_to_previous_buffer (t_gui_window *); extern void gui_switch_to_next_buffer (t_gui_window *); diff --git a/src/irc/irc-dcc.c b/src/irc/irc-dcc.c index 136a21a1b..a8063cf8a 100644 --- a/src/irc/irc-dcc.c +++ b/src/irc/irc-dcc.c @@ -109,6 +109,83 @@ dcc_close (t_dcc *ptr_dcc, int status) } /* + * dcc_accept: accepts a DCC file or chat request + */ + +void +dcc_accept (t_dcc *ptr_dcc) +{ + char *ptr_home, *filename2; + + dcc_connect (ptr_dcc); + if (ptr_dcc->sock == -1) + ptr_dcc->status = DCC_FAILED; + else + { + ptr_dcc->status = DCC_ACTIVE; + ptr_home = getenv ("HOME"); + gui_printf (NULL, "home = %s\n", ptr_home); + ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) + + strlen (ptr_dcc->nick) + + strlen (ptr_dcc->filename) + + ((cfg_dcc_download_path[0] == '~') ? + strlen (ptr_home) : 0) + + 4); + if (!ptr_dcc->local_filename) + { + ptr_dcc->status = DCC_FAILED; + return; + } + if (cfg_dcc_download_path[0] == '~') + { + strcpy (ptr_dcc->local_filename, ptr_home); + strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1); + } + else + strcpy (ptr_dcc->local_filename, cfg_dcc_download_path); + if (ptr_dcc->local_filename[strlen (ptr_dcc->local_filename) - 1] != DIR_SEPARATOR) + strcat (ptr_dcc->local_filename, DIR_SEPARATOR); + strcat (ptr_dcc->local_filename, ptr_dcc->nick); + strcat (ptr_dcc->local_filename, "."); + strcat (ptr_dcc->local_filename, ptr_dcc->filename); + + /* file already exists? */ + if (access (ptr_dcc->local_filename, F_OK) == 0) + { + /* if auto rename is not set, then abort DCC */ + if (!cfg_dcc_auto_rename) + { + ptr_dcc->status = DCC_FAILED; + return; + } + + filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16); + if (!filename2) + { + ptr_dcc->status = DCC_FAILED; + return; + } + ptr_dcc->filename_suffix = 0; + do + { + ptr_dcc->filename_suffix++; + sprintf (filename2, "%s.%d", + ptr_dcc->local_filename, + ptr_dcc->filename_suffix); + } + while (access (filename2, F_OK) == 0); + + free (ptr_dcc->local_filename); + ptr_dcc->local_filename = strdup (filename2); + free (filename2); + } + ptr_dcc->file = open (ptr_dcc->local_filename, + O_CREAT | O_TRUNC | O_WRONLY, + 0644); + } +} + +/* * dcc_add: add a DCC file to queue */ @@ -117,8 +194,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic unsigned int size) { t_dcc *new_dcc; - int num; - char *filename2; + t_gui_buffer *dcc_buffer; if ((new_dcc = (t_dcc *) malloc (sizeof (t_dcc))) == NULL) { @@ -135,6 +211,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic new_dcc->file = -1; new_dcc->filename = strdup (filename); new_dcc->local_filename = NULL; + new_dcc->filename_suffix = -1; new_dcc->size = size; new_dcc->pos = 0; new_dcc->next_dcc = dcc_list; @@ -146,53 +223,17 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff, port, filename, size); - if (type == DCC_FILE_RECV) + dcc_buffer = gui_get_dcc_buffer (); + + if ( ( (type == DCC_CHAT_RECV) && (cfg_dcc_auto_accept_chats) ) + || ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) ) { - dcc_connect (new_dcc); - if (new_dcc->sock == -1) - new_dcc->status = DCC_FAILED; - else - { - new_dcc->status = DCC_ACTIVE; - new_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) + - strlen (nick) + - strlen (filename) + 4); - if (!new_dcc->local_filename) - { - new_dcc->status = DCC_FAILED; - return NULL; - } - strcpy (new_dcc->local_filename, cfg_dcc_download_path); - if (new_dcc->local_filename[strlen (new_dcc->local_filename) - 1] != '/') - strcat (new_dcc->local_filename, "/"); - strcat (new_dcc->local_filename, nick); - strcat (new_dcc->local_filename, "."); - strcat (new_dcc->local_filename, filename); - if (access (new_dcc->local_filename, F_OK) == 0) - { - filename2 = (char *) malloc (strlen (new_dcc->local_filename) + 16); - if (!filename2) - { - new_dcc->status = DCC_FAILED; - return NULL; - } - num = 0; - do - { - num++; - sprintf (filename2, "%s.%d", new_dcc->local_filename, num); - } - while (access (filename2, F_OK) == 0); - - free (new_dcc->local_filename); - new_dcc->local_filename = strdup (filename2); - free (filename2); - } - new_dcc->file = open (new_dcc->local_filename, - O_CREAT | O_TRUNC | O_WRONLY, - 0644); - } + dcc_accept (new_dcc); + hotlist_add (1, dcc_buffer); } + else + hotlist_add (2, dcc_buffer); + gui_draw_buffer_status (dcc_buffer, 0); return new_dcc; } @@ -233,7 +274,7 @@ dcc_handle () if (ptr_dcc->pos >= ptr_dcc->size) { gui_printf (NULL, - _("DCC: file \"%s\" received from \"%s\": done!\n"), + _("DCC: file \"%s\" received from \"%s\": ok!\n"), ptr_dcc->filename, ptr_dcc->nick); dcc_close (ptr_dcc, DCC_DONE); } @@ -260,7 +301,7 @@ dcc_end () if (ptr_dcc->status == DCC_ACTIVE) wee_log_printf (_("aborting active DCC: \"%s\" from %s\n"), ptr_dcc->filename, ptr_dcc->nick); - close (ptr_dcc->sock); + dcc_close (ptr_dcc, DCC_FAILED); } } } diff --git a/src/irc/irc.h b/src/irc/irc.h index fb0f03b56..0d1057e67 100644 --- a/src/irc/irc.h +++ b/src/irc/irc.h @@ -188,6 +188,7 @@ struct t_dcc int file; /* local file (for reading or writing) */ char *filename; /* filename */ char *local_filename; /* local filename */ + int filename_suffix; /* suffix (.1 for ex) if renaming file */ unsigned long size; /* file size */ unsigned long pos; /* number of bytes received/sent */ t_dcc *next_dcc; /* link to next dcc file/chat */ diff --git a/weechat/po/fr.po b/weechat/po/fr.po index 9deeedf82..e18ed2fc1 100644 --- a/weechat/po/fr.po +++ b/weechat/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.0.8-pre2\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2004-09-01 00:46+0200\n" +"POT-Creation-Date: 2004-09-09 23:11+0200\n" "PO-Revision-Date: 2004-08-08 20:47+0200\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -20,7 +20,7 @@ msgstr "" msgid "%s cannot allocate new nick\n" msgstr "%s ompossible d'allouer un nouveau pseudo\n" -#: src/irc/irc-server.c:130 src/common/weeconfig.c:1235 +#: src/irc/irc-server.c:130 src/common/weeconfig.c:1230 msgid "Unable to get user's name" msgstr "Impossible de déterminer le nom d'utilisateur" @@ -1557,35 +1557,45 @@ msgstr "" "%s: tous les noms d'utilisateurs déclarés sont déjà en cours d'utilisation, " "fermeture de la connexion avec le serveur !\n" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Waiting" msgstr "Attente" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Connecting" msgstr "Connexion" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Active" msgstr "Actif" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Done" msgstr "Terminé" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Failed" msgstr "Echoué" -#: src/irc/irc-dcc.c:39 +#: src/irc/irc-dcc.c:44 msgid "Aborted" msgstr "Interrompu" -#: src/irc/irc-dcc.c:85 +#: src/irc/irc-dcc.c:191 #, c-format msgid "%s not enough memory for new DCC\n" msgstr "%s pas assez de mémoire pour un nouveau DCC\n" +#: src/irc/irc-dcc.c:259 +#, c-format +msgid "DCC: file \"%s\" received from \"%s\": ok!\n" +msgstr "DCC: fichier \"%s\" reçu de \"%s\": ok !\n" + +#: src/irc/irc-dcc.c:284 +#, c-format +msgid "aborting active DCC: \"%s\" from %s\n" +msgstr "abandon du DCC actif: \"%s\" de %s\n" + #: src/plugins/perl/wee-perl.c:83 #, c-format msgid "" @@ -1647,32 +1657,32 @@ msgstr "" "%s impossible d'ajouter la fonction pour le message \"%s\" (mémoire " "insuffisante)\n" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "bytes" msgstr "octets" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Kb" msgstr "Ko" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Mb" msgstr "Mo" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Gb" msgstr "Go" -#: src/gui/curses/gui-display.c:966 +#: src/gui/curses/gui-display.c:987 #, c-format msgid "%d:[not connected] " msgstr "%d:[non connecté] " -#: src/gui/curses/gui-display.c:974 +#: src/gui/curses/gui-display.c:995 msgid "[Act: " msgstr "[Act: " -#: src/gui/curses/gui-display.c:1009 src/gui/curses/gui-display.c:1012 +#: src/gui/curses/gui-display.c:1030 src/gui/curses/gui-display.c:1033 msgid "-MORE-" msgstr "-PLUS-" @@ -1680,17 +1690,17 @@ msgstr "-PLUS-" msgid "server" msgstr "serveur" -#: src/gui/gui-common.c:302 +#: src/gui/gui-common.c:304 #, c-format msgid "%s not enough memory for infobar message\n" msgstr "%s pas assez de mémoire pour un message de la barre d'infos\n" -#: src/gui/gui-common.c:437 +#: src/gui/gui-common.c:439 #, c-format msgid "%s not enough memory for new line!\n" msgstr "%s pas assez de mémoire pour une nouvelle ligne !\n" -#: src/gui/gui-common.c:480 +#: src/gui/gui-common.c:482 msgid "not enough memory!\n" msgstr "pas assez de mémoire !\n" @@ -2386,17 +2396,17 @@ msgstr "%s pas assez de mémoire pour le répertoire personnel\n" msgid "%s unable to create ~/.weechat directory\n" msgstr "%s impossible de créer le répertoire ~/.weechat\n" -#: src/common/weechat.c:391 +#: src/common/weechat.c:388 #, c-format msgid "%s unable to create/append to log file (~/.weechat/%s)" msgstr "%s impossible de créer/ajouter dans le fichier de log (~/.weechat/%s)" -#: src/common/weechat.c:414 +#: src/common/weechat.c:411 #, c-format msgid "%sWelcome to " msgstr "%sBienvenue dans " -#: src/common/weechat.c:427 +#: src/common/weechat.c:424 msgid "compiled on" msgstr "compilé le" @@ -2822,183 +2832,174 @@ msgstr "" "texte écrit à la fin d'une discussion sauvegardées (voir man strftime pour " "le format de date/heure)" -#: src/common/weeconfig.c:461 +#: src/common/weeconfig.c:460 msgid "automatically accept dcc files" msgstr "accepte automatiquement les fichiers dcc" -#: src/common/weeconfig.c:462 +#: src/common/weeconfig.c:461 msgid "automatically accept incoming dcc files" msgstr "accepte automatiquement les fichiers dcc entrants" -#: src/common/weeconfig.c:465 -msgid "max size when auto accepting file" -msgstr "taille maxi pour accepter un fichier" - -#: src/common/weeconfig.c:466 -msgid "maximum size for incoming file when automatically accepted" -msgstr "" -"taille maximum pour un fichier entrant lorsqu'il est accepté automatiquement" - -#: src/common/weeconfig.c:469 +#: src/common/weeconfig.c:464 msgid "automatically accept dcc chats" msgstr "accepte automatiquement les demandes de discussion dcc" -#: src/common/weeconfig.c:470 +#: src/common/weeconfig.c:465 msgid "automatically accept dcc chats (use carefully!)" msgstr "" "accepte automatiquement les demandes de discussion dcc (à utiliser avec " "précaution !)" -#: src/common/weeconfig.c:473 +#: src/common/weeconfig.c:468 msgid "timeout for dcc request" msgstr "délai d'attente pour les requêtes dcc" -#: src/common/weeconfig.c:474 +#: src/common/weeconfig.c:469 msgid "timeout for dcc request (in seconds)" msgstr "délai d'attente pour les requêtes dcc (en secondes)" -#: src/common/weeconfig.c:477 +#: src/common/weeconfig.c:472 msgid "block size for dcc packets" msgstr "taille de bloc pour les paquets dcc" -#: src/common/weeconfig.c:478 +#: src/common/weeconfig.c:473 msgid "block size for dcc packets in bytes (default: 1024)" msgstr "taille de bloc pour les paquets dcc en octets (défaut: 1024)" -#: src/common/weeconfig.c:481 +#: src/common/weeconfig.c:476 msgid "path for incoming files with dcc" msgstr "chemin les fichiers reçus par dcc" -#: src/common/weeconfig.c:482 +#: src/common/weeconfig.c:477 msgid "path for writing incoming files with dcc (default: user home)" msgstr "" "chemin pour écrire les fichiers reçus par dcc (par défaut: répertoire de " "l'utilisateur)" -#: src/common/weeconfig.c:485 +#: src/common/weeconfig.c:480 msgid "default path for sending files with dcc" msgstr "chemin par défaut pour envoyer les fichiers par dcc" -#: src/common/weeconfig.c:486 +#: src/common/weeconfig.c:481 msgid "" "path for reading files when sending thru dcc (when no path is specified)" msgstr "" "chemin pour lire les fichiers lorsqu'ils sont envoyés par dcc (quand aucun " "chemin n'est spécifié)" -#: src/common/weeconfig.c:489 +#: src/common/weeconfig.c:484 msgid "automatically rename dcc files if already exists" msgstr "renomme automatiquement les fichiers dcc s'ils existent déjà" -#: src/common/weeconfig.c:490 +#: src/common/weeconfig.c:485 msgid "rename incoming files if already exists (add '.1', '.2', ...)" msgstr "" "renommer les fichiers reçus s'ils existent déjà (ajoute '.1', '.2', ...)" -#: src/common/weeconfig.c:493 +#: src/common/weeconfig.c:488 msgid "automatically resume aborted transfers" msgstr "continuer automatiquement les transferts non terminés" -#: src/common/weeconfig.c:494 +#: src/common/weeconfig.c:489 msgid "" "automatically resume dcc transfer if connection with remote host is loosed" msgstr "" "continuer automatiquement les transferts dcc si la connexion avec la machine " "distante a été perdue" -#: src/common/weeconfig.c:508 +#: src/common/weeconfig.c:503 msgid "use proxy" msgstr "utiliser un proxy" -#: src/common/weeconfig.c:509 +#: src/common/weeconfig.c:504 msgid "use a proxy server to connect to irc server" msgstr "utiliser un proxy pour se connecter au serveur irc" -#: src/common/weeconfig.c:512 +#: src/common/weeconfig.c:507 msgid "proxy address" msgstr "adresse du proxy" -#: src/common/weeconfig.c:513 +#: src/common/weeconfig.c:508 msgid "proxy server address (IP or hostname)" msgstr "adresse du serveur proxy (IP ou nom)" -#: src/common/weeconfig.c:516 +#: src/common/weeconfig.c:511 msgid "port for proxy" msgstr "port pour le proxy" -#: src/common/weeconfig.c:517 +#: src/common/weeconfig.c:512 msgid "port for connecting to proxy server" msgstr "port pour se connecter au serveur proxy" -#: src/common/weeconfig.c:520 +#: src/common/weeconfig.c:515 msgid "proxy password" msgstr "mot de passe pour le proxy" -#: src/common/weeconfig.c:521 +#: src/common/weeconfig.c:516 msgid "password for proxy server" msgstr "mot de passe pour le serveur proxy" -#: src/common/weeconfig.c:532 +#: src/common/weeconfig.c:527 msgid "server name" msgstr "nom du serveur" -#: src/common/weeconfig.c:533 +#: src/common/weeconfig.c:528 msgid "name associated to IRC server (for display only)" msgstr "nom associé au serveur IRC (pour affichage seulement)" -#: src/common/weeconfig.c:536 +#: src/common/weeconfig.c:531 msgid "automatically connect to server" msgstr "connexion automatique au serveur" -#: src/common/weeconfig.c:537 +#: src/common/weeconfig.c:532 msgid "automatically connect to server when WeeChat is starting" msgstr "connexion automatique au serveur quand WeeChat démarre" -#: src/common/weeconfig.c:540 +#: src/common/weeconfig.c:535 msgid "server address or hostname" msgstr "adresse ou nom du serveur" -#: src/common/weeconfig.c:541 +#: src/common/weeconfig.c:536 msgid "IP address or hostname of IRC server" msgstr "adresse IP ou nom du serveur IRC" -#: src/common/weeconfig.c:544 +#: src/common/weeconfig.c:539 msgid "port for IRC server" msgstr "port pour le serveur IRC" -#: src/common/weeconfig.c:545 +#: src/common/weeconfig.c:540 msgid "port for connecting to server" msgstr "port pour se connecter au serveur" -#: src/common/weeconfig.c:548 +#: src/common/weeconfig.c:543 msgid "server password" msgstr "mot de passe pour le serveur" -#: src/common/weeconfig.c:549 +#: src/common/weeconfig.c:544 msgid "password for IRC server" msgstr "mot de passe pour le serveur IRC" -#: src/common/weeconfig.c:552 +#: src/common/weeconfig.c:547 msgid "nickname for server" msgstr "pseudo pour le serveur" -#: src/common/weeconfig.c:553 +#: src/common/weeconfig.c:548 msgid "nickname to use on IRC server" msgstr "pseudo à utiliser sur le serveur IRC" -#: src/common/weeconfig.c:556 +#: src/common/weeconfig.c:551 msgid "alternate nickname for server" msgstr "pseudo alternatif pour le serveur" -#: src/common/weeconfig.c:557 +#: src/common/weeconfig.c:552 msgid "alternate nickname to use on IRC server (if nickname is already used)" msgstr "pseudo alternatif pour le serveur IRC (si le pseudo est déjà utilisé)" -#: src/common/weeconfig.c:560 +#: src/common/weeconfig.c:555 msgid "2nd alternate nickname for server" msgstr "2nd pseudo alternatif pour le serveur" -#: src/common/weeconfig.c:561 +#: src/common/weeconfig.c:556 msgid "" "2nd alternate nickname to use on IRC server (if alternate nickname is " "already used)" @@ -3006,87 +3007,87 @@ msgstr "" "2nd pseudo alternatif pour le serveur IRC (si le pseudo alternatif est déjà " "utilisé)" -#: src/common/weeconfig.c:564 +#: src/common/weeconfig.c:559 msgid "user name for server" msgstr "nom d'utilisateur pour le serveur" -#: src/common/weeconfig.c:565 +#: src/common/weeconfig.c:560 msgid "user name to use on IRC server" msgstr "nom d'utilisateur pour le serveur IRC" -#: src/common/weeconfig.c:568 +#: src/common/weeconfig.c:563 msgid "real name for server" msgstr "nom réel pour le serveur" -#: src/common/weeconfig.c:569 +#: src/common/weeconfig.c:564 msgid "real name to use on IRC server" msgstr "nom réel pour le serveur IRC" -#: src/common/weeconfig.c:572 src/common/weeconfig.c:573 +#: src/common/weeconfig.c:567 src/common/weeconfig.c:568 msgid "first command to run when connected to server" msgstr "commande à exécuter en premier lorsque connecté au serveur" -#: src/common/weeconfig.c:576 +#: src/common/weeconfig.c:571 msgid "list of channels to join when connected to server" msgstr "liste des canaux à rejoindre lorsque connecté au serveur" -#: src/common/weeconfig.c:577 +#: src/common/weeconfig.c:572 msgid "comma separated list of channels to join when connected to server" msgstr "" "liste des canaux (séparés par des virgules) à rejoindre lorsque connecté au " "serveur" -#: src/common/weeconfig.c:799 +#: src/common/weeconfig.c:794 #, c-format msgid "%s %s, line %d: new server, but previous was incomplete\n" msgstr "%s %s, ligne %d: nouveau serveur, mais le précédent était incomplet\n" -#: src/common/weeconfig.c:808 +#: src/common/weeconfig.c:803 #, c-format msgid "%s %s, line %d: server '%s' already exists\n" msgstr "%s %s, ligne %d: le serveur '%s' existe déjà\n" -#: src/common/weeconfig.c:820 +#: src/common/weeconfig.c:815 #, c-format msgid "%s %s, line %d: unable to create server\n" msgstr "%s %s, ligne %d: impossible de créer le serveur\n" -#: src/common/weeconfig.c:859 +#: src/common/weeconfig.c:854 #, c-format msgid "%s unable to assign default int with string (\"%s\")\n" msgstr "%s impossible d'assigner la valeur entière avec la chaîne (\"%s\")\n" -#: src/common/weeconfig.c:870 +#: src/common/weeconfig.c:865 #, c-format msgid "%s unable to assign default color (\"%s\")\n" msgstr "%s impossible d'assigner la couleur par défaut (\"%s\")\n" -#: src/common/weeconfig.c:909 +#: src/common/weeconfig.c:904 #, c-format msgid "%s config file \"%s\" not found.\n" msgstr "%s fichier de configuration \"%s\" non trouvé.\n" -#: src/common/weeconfig.c:941 +#: src/common/weeconfig.c:936 #, c-format msgid "%s %s, line %d: invalid syntax, missing \"]\"\n" msgstr "%s %s, ligne %d: syntaxe invalide, il manque \"]\"\n" -#: src/common/weeconfig.c:958 +#: src/common/weeconfig.c:953 #, c-format msgid "%s %s, line %d: unknown section identifier (\"%s\")\n" msgstr "%s %s, ligne %d: section inconnue (\"%s\")\n" -#: src/common/weeconfig.c:976 +#: src/common/weeconfig.c:971 #, c-format msgid "%s %s, line %d: invalid syntax, missing \"=\"\n" msgstr "%s %s, ligne %d: syntaxe invalide, il manque \"=\"\n" -#: src/common/weeconfig.c:1010 +#: src/common/weeconfig.c:1005 #, c-format msgid "%s %s, line %d: invalid option \"%s\"\n" msgstr "%s %s, ligne %d: option \"%s\" invalide\n" -#: src/common/weeconfig.c:1021 +#: src/common/weeconfig.c:1016 #, c-format msgid "" "%s %s, line %d: invalid value foroption '%s'\n" @@ -3095,7 +3096,7 @@ msgstr "" "%s %s, ligne %d: valeur invalide pour l'option '%s'\n" "Attendu: valeur booléenne: 'off' ou 'on'\n" -#: src/common/weeconfig.c:1030 +#: src/common/weeconfig.c:1025 #, c-format msgid "" "%s %s, line %d: invalid value for option '%s'\n" @@ -3104,7 +3105,7 @@ msgstr "" "%s %s, ligne %d: valeur invalide pour l'option '%s'\n" "Attendu: entier compris entre %d et %d\n" -#: src/common/weeconfig.c:1041 +#: src/common/weeconfig.c:1036 #, c-format msgid "" "%s %s, line %d: invalid value for option '%s'\n" @@ -3113,26 +3114,26 @@ msgstr "" "%s %s, ligne %d: valeur invalide pour l'option '%s'\n" "Attendu: une de ces chaînes: " -#: src/common/weeconfig.c:1057 +#: src/common/weeconfig.c:1052 #, c-format msgid "%s %s, line %d: invalid color name for option '%s'\n" msgstr "%s %s, ligne %d: nom de couleur invalide pour l'option '%s'\n" -#: src/common/weeconfig.c:1116 src/common/weeconfig.c:1284 +#: src/common/weeconfig.c:1111 src/common/weeconfig.c:1279 #, c-format msgid "%s cannot create file \"%s\"\n" msgstr "%s impossible de créer le fichier \"%s\"\n" -#: src/common/weeconfig.c:1122 +#: src/common/weeconfig.c:1117 #, c-format msgid "%s: creating default config file...\n" msgstr "%s: création du fichier de configuration par défaut...\n" -#: src/common/weeconfig.c:1123 +#: src/common/weeconfig.c:1118 msgid "creating default config file\n" msgstr "création du fichier de configuration par défaut\n" -#: src/common/weeconfig.c:1126 src/common/weeconfig.c:1293 +#: src/common/weeconfig.c:1121 src/common/weeconfig.c:1288 #, c-format msgid "" "#\n" @@ -3141,9 +3142,6 @@ msgstr "" "#\n" "# %s: fichier de configuration, créé par %s v%s le %s#\n" -#: src/common/weeconfig.c:1290 +#: src/common/weeconfig.c:1285 msgid "saving config to disk\n" msgstr "sauvegarde de la configuration sur disque\n" - -#~ msgid "color for active window" -#~ msgstr "couleur pour la fenêtre active" diff --git a/weechat/po/weechat.pot b/weechat/po/weechat.pot index 4934830d5..855d8ae8e 100644 --- a/weechat/po/weechat.pot +++ b/weechat/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2004-09-01 00:46+0200\n" +"POT-Creation-Date: 2004-09-09 23:11+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -20,7 +20,7 @@ msgstr "" msgid "%s cannot allocate new nick\n" msgstr "" -#: src/irc/irc-server.c:130 src/common/weeconfig.c:1235 +#: src/irc/irc-server.c:130 src/common/weeconfig.c:1230 msgid "Unable to get user's name" msgstr "" @@ -1456,35 +1456,45 @@ msgid "" "server!\n" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Waiting" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Connecting" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Active" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Done" msgstr "" -#: src/irc/irc-dcc.c:38 +#: src/irc/irc-dcc.c:43 msgid "Failed" msgstr "" -#: src/irc/irc-dcc.c:39 +#: src/irc/irc-dcc.c:44 msgid "Aborted" msgstr "" -#: src/irc/irc-dcc.c:85 +#: src/irc/irc-dcc.c:191 #, c-format msgid "%s not enough memory for new DCC\n" msgstr "" +#: src/irc/irc-dcc.c:259 +#, c-format +msgid "DCC: file \"%s\" received from \"%s\": ok!\n" +msgstr "" + +#: src/irc/irc-dcc.c:284 +#, c-format +msgid "aborting active DCC: \"%s\" from %s\n" +msgstr "" + #: src/plugins/perl/wee-perl.c:83 #, c-format msgid "" @@ -1540,32 +1550,32 @@ msgstr "" msgid "%s unable to add handler for \"%s\" message (not enough memory)\n" msgstr "" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "bytes" msgstr "" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Kb" msgstr "" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Mb" msgstr "" -#: src/gui/curses/gui-display.c:559 +#: src/gui/curses/gui-display.c:568 msgid "Gb" msgstr "" -#: src/gui/curses/gui-display.c:966 +#: src/gui/curses/gui-display.c:987 #, c-format msgid "%d:[not connected] " msgstr "" -#: src/gui/curses/gui-display.c:974 +#: src/gui/curses/gui-display.c:995 msgid "[Act: " msgstr "" -#: src/gui/curses/gui-display.c:1009 src/gui/curses/gui-display.c:1012 +#: src/gui/curses/gui-display.c:1030 src/gui/curses/gui-display.c:1033 msgid "-MORE-" msgstr "" @@ -1573,17 +1583,17 @@ msgstr "" msgid "server" msgstr "" -#: src/gui/gui-common.c:302 +#: src/gui/gui-common.c:304 #, c-format msgid "%s not enough memory for infobar message\n" msgstr "" -#: src/gui/gui-common.c:437 +#: src/gui/gui-common.c:439 #, c-format msgid "%s not enough memory for new line!\n" msgstr "" -#: src/gui/gui-common.c:480 +#: src/gui/gui-common.c:482 msgid "not enough memory!\n" msgstr "" @@ -2230,17 +2240,17 @@ msgstr "" msgid "%s unable to create ~/.weechat directory\n" msgstr "" -#: src/common/weechat.c:391 +#: src/common/weechat.c:388 #, c-format msgid "%s unable to create/append to log file (~/.weechat/%s)" msgstr "" -#: src/common/weechat.c:414 +#: src/common/weechat.c:411 #, c-format msgid "%sWelcome to " msgstr "" -#: src/common/weechat.c:427 +#: src/common/weechat.c:424 msgid "compiled on" msgstr "" @@ -2637,303 +2647,295 @@ msgid "" "text written when ending log file (see man strftime for date/time specifiers)" msgstr "" -#: src/common/weeconfig.c:461 +#: src/common/weeconfig.c:460 msgid "automatically accept dcc files" msgstr "" -#: src/common/weeconfig.c:462 +#: src/common/weeconfig.c:461 msgid "automatically accept incoming dcc files" msgstr "" -#: src/common/weeconfig.c:465 -msgid "max size when auto accepting file" -msgstr "" - -#: src/common/weeconfig.c:466 -msgid "maximum size for incoming file when automatically accepted" -msgstr "" - -#: src/common/weeconfig.c:469 +#: src/common/weeconfig.c:464 msgid "automatically accept dcc chats" msgstr "" -#: src/common/weeconfig.c:470 +#: src/common/weeconfig.c:465 msgid "automatically accept dcc chats (use carefully!)" msgstr "" -#: src/common/weeconfig.c:473 +#: src/common/weeconfig.c:468 msgid "timeout for dcc request" msgstr "" -#: src/common/weeconfig.c:474 +#: src/common/weeconfig.c:469 msgid "timeout for dcc request (in seconds)" msgstr "" -#: src/common/weeconfig.c:477 +#: src/common/weeconfig.c:472 msgid "block size for dcc packets" msgstr "" -#: src/common/weeconfig.c:478 +#: src/common/weeconfig.c:473 msgid "block size for dcc packets in bytes (default: 1024)" msgstr "" -#: src/common/weeconfig.c:481 +#: src/common/weeconfig.c:476 msgid "path for incoming files with dcc" msgstr "" -#: src/common/weeconfig.c:482 +#: src/common/weeconfig.c:477 msgid "path for writing incoming files with dcc (default: user home)" msgstr "" -#: src/common/weeconfig.c:485 +#: src/common/weeconfig.c:480 msgid "default path for sending files with dcc" msgstr "" -#: src/common/weeconfig.c:486 +#: src/common/weeconfig.c:481 msgid "" "path for reading files when sending thru dcc (when no path is specified)" msgstr "" -#: src/common/weeconfig.c:489 +#: src/common/weeconfig.c:484 msgid "automatically rename dcc files if already exists" msgstr "" -#: src/common/weeconfig.c:490 +#: src/common/weeconfig.c:485 msgid "rename incoming files if already exists (add '.1', '.2', ...)" msgstr "" -#: src/common/weeconfig.c:493 +#: src/common/weeconfig.c:488 msgid "automatically resume aborted transfers" msgstr "" -#: src/common/weeconfig.c:494 +#: src/common/weeconfig.c:489 msgid "" "automatically resume dcc transfer if connection with remote host is loosed" msgstr "" -#: src/common/weeconfig.c:508 +#: src/common/weeconfig.c:503 msgid "use proxy" msgstr "" -#: src/common/weeconfig.c:509 +#: src/common/weeconfig.c:504 msgid "use a proxy server to connect to irc server" msgstr "" -#: src/common/weeconfig.c:512 +#: src/common/weeconfig.c:507 msgid "proxy address" msgstr "" -#: src/common/weeconfig.c:513 +#: src/common/weeconfig.c:508 msgid "proxy server address (IP or hostname)" msgstr "" -#: src/common/weeconfig.c:516 +#: src/common/weeconfig.c:511 msgid "port for proxy" msgstr "" -#: src/common/weeconfig.c:517 +#: src/common/weeconfig.c:512 msgid "port for connecting to proxy server" msgstr "" -#: src/common/weeconfig.c:520 +#: src/common/weeconfig.c:515 msgid "proxy password" msgstr "" -#: src/common/weeconfig.c:521 +#: src/common/weeconfig.c:516 msgid "password for proxy server" msgstr "" -#: src/common/weeconfig.c:532 +#: src/common/weeconfig.c:527 msgid "server name" msgstr "" -#: src/common/weeconfig.c:533 +#: src/common/weeconfig.c:528 msgid "name associated to IRC server (for display only)" msgstr "" -#: src/common/weeconfig.c:536 +#: src/common/weeconfig.c:531 msgid "automatically connect to server" msgstr "" -#: src/common/weeconfig.c:537 +#: src/common/weeconfig.c:532 msgid "automatically connect to server when WeeChat is starting" msgstr "" -#: src/common/weeconfig.c:540 +#: src/common/weeconfig.c:535 msgid "server address or hostname" msgstr "" -#: src/common/weeconfig.c:541 +#: src/common/weeconfig.c:536 msgid "IP address or hostname of IRC server" msgstr "" -#: src/common/weeconfig.c:544 +#: src/common/weeconfig.c:539 msgid "port for IRC server" msgstr "" -#: src/common/weeconfig.c:545 +#: src/common/weeconfig.c:540 msgid "port for connecting to server" msgstr "" -#: src/common/weeconfig.c:548 +#: src/common/weeconfig.c:543 msgid "server password" msgstr "" -#: src/common/weeconfig.c:549 +#: src/common/weeconfig.c:544 msgid "password for IRC server" msgstr "" -#: src/common/weeconfig.c:552 +#: src/common/weeconfig.c:547 msgid "nickname for server" msgstr "" -#: src/common/weeconfig.c:553 +#: src/common/weeconfig.c:548 msgid "nickname to use on IRC server" msgstr "" -#: src/common/weeconfig.c:556 +#: src/common/weeconfig.c:551 msgid "alternate nickname for server" msgstr "" -#: src/common/weeconfig.c:557 +#: src/common/weeconfig.c:552 msgid "alternate nickname to use on IRC server (if nickname is already used)" msgstr "" -#: src/common/weeconfig.c:560 +#: src/common/weeconfig.c:555 msgid "2nd alternate nickname for server" msgstr "" -#: src/common/weeconfig.c:561 +#: src/common/weeconfig.c:556 msgid "" "2nd alternate nickname to use on IRC server (if alternate nickname is " "already used)" msgstr "" -#: src/common/weeconfig.c:564 +#: src/common/weeconfig.c:559 msgid "user name for server" msgstr "" -#: src/common/weeconfig.c:565 +#: src/common/weeconfig.c:560 msgid "user name to use on IRC server" msgstr "" -#: src/common/weeconfig.c:568 +#: src/common/weeconfig.c:563 msgid "real name for server" msgstr "" -#: src/common/weeconfig.c:569 +#: src/common/weeconfig.c:564 msgid "real name to use on IRC server" msgstr "" -#: src/common/weeconfig.c:572 src/common/weeconfig.c:573 +#: src/common/weeconfig.c:567 src/common/weeconfig.c:568 msgid "first command to run when connected to server" msgstr "" -#: src/common/weeconfig.c:576 +#: src/common/weeconfig.c:571 msgid "list of channels to join when connected to server" msgstr "" -#: src/common/weeconfig.c:577 +#: src/common/weeconfig.c:572 msgid "comma separated list of channels to join when connected to server" msgstr "" -#: src/common/weeconfig.c:799 +#: src/common/weeconfig.c:794 #, c-format msgid "%s %s, line %d: new server, but previous was incomplete\n" msgstr "" -#: src/common/weeconfig.c:808 +#: src/common/weeconfig.c:803 #, c-format msgid "%s %s, line %d: server '%s' already exists\n" msgstr "" -#: src/common/weeconfig.c:820 +#: src/common/weeconfig.c:815 #, c-format msgid "%s %s, line %d: unable to create server\n" msgstr "" -#: src/common/weeconfig.c:859 +#: src/common/weeconfig.c:854 #, c-format msgid "%s unable to assign default int with string (\"%s\")\n" msgstr "" -#: src/common/weeconfig.c:870 +#: src/common/weeconfig.c:865 #, c-format msgid "%s unable to assign default color (\"%s\")\n" msgstr "" -#: src/common/weeconfig.c:909 +#: src/common/weeconfig.c:904 #, c-format msgid "%s config file \"%s\" not found.\n" msgstr "" -#: src/common/weeconfig.c:941 +#: src/common/weeconfig.c:936 #, c-format msgid "%s %s, line %d: invalid syntax, missing \"]\"\n" msgstr "" -#: src/common/weeconfig.c:958 +#: src/common/weeconfig.c:953 #, c-format msgid "%s %s, line %d: unknown section identifier (\"%s\")\n" msgstr "" -#: src/common/weeconfig.c:976 +#: src/common/weeconfig.c:971 #, c-format msgid "%s %s, line %d: invalid syntax, missing \"=\"\n" msgstr "" -#: src/common/weeconfig.c:1010 +#: src/common/weeconfig.c:1005 #, c-format msgid "%s %s, line %d: invalid option \"%s\"\n" msgstr "" -#: src/common/weeconfig.c:1021 +#: src/common/weeconfig.c:1016 #, c-format msgid "" "%s %s, line %d: invalid value foroption '%s'\n" "Expected: boolean value: 'off' or 'on'\n" msgstr "" -#: src/common/weeconfig.c:1030 +#: src/common/weeconfig.c:1025 #, c-format msgid "" "%s %s, line %d: invalid value for option '%s'\n" "Expected: integer between %d and %d\n" msgstr "" -#: src/common/weeconfig.c:1041 +#: src/common/weeconfig.c:1036 #, c-format msgid "" "%s %s, line %d: invalid value for option '%s'\n" "Expected: one of these strings: " msgstr "" -#: src/common/weeconfig.c:1057 +#: src/common/weeconfig.c:1052 #, c-format msgid "%s %s, line %d: invalid color name for option '%s'\n" msgstr "" -#: src/common/weeconfig.c:1116 src/common/weeconfig.c:1284 +#: src/common/weeconfig.c:1111 src/common/weeconfig.c:1279 #, c-format msgid "%s cannot create file \"%s\"\n" msgstr "" -#: src/common/weeconfig.c:1122 +#: src/common/weeconfig.c:1117 #, c-format msgid "%s: creating default config file...\n" msgstr "" -#: src/common/weeconfig.c:1123 +#: src/common/weeconfig.c:1118 msgid "creating default config file\n" msgstr "" -#: src/common/weeconfig.c:1126 src/common/weeconfig.c:1293 +#: src/common/weeconfig.c:1121 src/common/weeconfig.c:1288 #, c-format msgid "" "#\n" "# %s configuration file, created by %s v%s on %s#\n" msgstr "" -#: src/common/weeconfig.c:1290 +#: src/common/weeconfig.c:1285 msgid "saving config to disk\n" msgstr "" diff --git a/weechat/src/common/hotlist.c b/weechat/src/common/hotlist.c index e8be5659c..b784fda11 100644 --- a/weechat/src/common/hotlist.c +++ b/weechat/src/common/hotlist.c @@ -80,6 +80,9 @@ hotlist_add (int priority, t_gui_buffer *buffer) { t_weechat_hotlist *new_hotlist, *pos_hotlist; + if (!buffer) + return; + if ((pos_hotlist = hotlist_search (buffer))) { /* return if priority is greater or equal than the one to add */ diff --git a/weechat/src/common/weechat.h b/weechat/src/common/weechat.h index 51b0cf9e9..95c8a24ed 100644 --- a/weechat/src/common/weechat.h +++ b/weechat/src/common/weechat.h @@ -91,9 +91,11 @@ /* directory separator, depending on OS */ #ifdef _WIN32 - #define DIR_SEPARATOR "\\" + #define DIR_SEPARATOR "\\" + #define DIR_SEPARATOR_CHAR '\\' #else - #define DIR_SEPARATOR "/" + #define DIR_SEPARATOR "/" + #define DIR_SEPARATOR_CHAR '/' #endif /* global variables and functions */ diff --git a/weechat/src/common/weeconfig.c b/weechat/src/common/weeconfig.c index 4936443c8..98d889330 100644 --- a/weechat/src/common/weeconfig.c +++ b/weechat/src/common/weeconfig.c @@ -448,7 +448,6 @@ t_config_option weechat_options_log[] = /* config, dcc section */ int cfg_dcc_auto_accept_files; -int cfg_dcc_auto_accept_max_size; int cfg_dcc_auto_accept_chats; int cfg_dcc_timeout; int cfg_dcc_blocksize; @@ -460,40 +459,36 @@ int cfg_dcc_auto_resume; t_config_option weechat_options_dcc[] = { { "dcc_auto_accept_files", N_("automatically accept dcc files"), N_("automatically accept incoming dcc files"), - OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, - NULL, NULL, &cfg_dcc_auto_accept_files, NULL, NULL }, - { "dcc_auto_accept_max_size", N_("max size when auto accepting file"), - N_("maximum size for incoming file when automatically accepted"), - OPTION_TYPE_INT, 0, INT_MAX, 0, - NULL, NULL, &cfg_dcc_auto_accept_max_size, NULL, NULL }, + OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_FALSE, + NULL, NULL, &cfg_dcc_auto_accept_files, NULL, config_change_noop }, { "dcc_auto_accept_chats", N_("automatically accept dcc chats"), N_("automatically accept dcc chats (use carefully!)"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, - NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, NULL }, + NULL, NULL, &cfg_dcc_auto_accept_chats, NULL, config_change_noop }, { "dcc_timeout", N_("timeout for dcc request"), N_("timeout for dcc request (in seconds)"), OPTION_TYPE_INT, 1, INT_MAX, 300, - NULL, NULL, &cfg_dcc_timeout, NULL, NULL }, + NULL, NULL, &cfg_dcc_timeout, NULL, config_change_noop }, { "dcc_blocksize", N_("block size for dcc packets"), N_("block size for dcc packets in bytes (default: 1024)"), OPTION_TYPE_INT, 1024, 102400, 1024, - NULL, NULL, &cfg_dcc_blocksize, NULL, NULL }, + NULL, NULL, &cfg_dcc_blocksize, NULL, config_change_noop }, { "dcc_download_path", N_("path for incoming files with dcc"), N_("path for writing incoming files with dcc (default: user home)"), OPTION_TYPE_STRING, 0, 0, 0, - "~", NULL, NULL, &cfg_dcc_download_path, NULL }, + "~", NULL, NULL, &cfg_dcc_download_path, config_change_noop }, { "dcc_upload_path", N_("default path for sending files with dcc"), N_("path for reading files when sending thru dcc (when no path is specified)"), OPTION_TYPE_STRING, 0, 0, 0, "~", - NULL, NULL, &cfg_dcc_upload_path, NULL }, + NULL, NULL, &cfg_dcc_upload_path, config_change_noop }, { "dcc_auto_rename", N_("automatically rename dcc files if already exists"), N_("rename incoming files if already exists (add '.1', '.2', ...)"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, - NULL, NULL, &cfg_dcc_auto_rename, NULL, NULL }, + NULL, NULL, &cfg_dcc_auto_rename, NULL, config_change_noop }, { "dcc_auto_resume", N_("automatically resume aborted transfers"), N_("automatically resume dcc transfer if connection with remote host is loosed"), OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE, - NULL, NULL, &cfg_dcc_auto_resume, NULL, NULL }, + NULL, NULL, &cfg_dcc_auto_resume, NULL, config_change_noop }, { NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL } }; diff --git a/weechat/src/common/weeconfig.h b/weechat/src/common/weeconfig.h index 91ddcdf7a..a94c5bb65 100644 --- a/weechat/src/common/weeconfig.h +++ b/weechat/src/common/weeconfig.h @@ -146,7 +146,6 @@ extern char *cfg_log_start_string; extern char *cfg_log_end_string; extern int cfg_dcc_auto_accept_files; -extern int cfg_dcc_auto_accept_max_size; extern int cfg_dcc_auto_accept_chats; extern int cfg_dcc_timeout; extern int cfg_dcc_blocksize; diff --git a/weechat/src/gui/curses/gui-display.c b/weechat/src/gui/curses/gui-display.c index 0c1fdcab5..b978bb38d 100644 --- a/weechat/src/gui/curses/gui-display.c +++ b/weechat/src/gui/curses/gui-display.c @@ -604,6 +604,9 @@ gui_draw_buffer_chat (t_gui_buffer *buffer, int erase) gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT); mvwprintw (ptr_win->win_chat, i, 0, " %-16s %s", ptr_dcc->nick, ptr_dcc->filename); + if (ptr_dcc->filename_suffix > 0) + wprintw (ptr_win->win_chat, " (.%d)", + ptr_dcc->filename_suffix); gui_window_set_color (ptr_win->win_chat, COLOR_WIN_CHAT); mvwprintw (ptr_win->win_chat, i + 1, 0, " %s ", (ptr_dcc->type == DCC_FILE_RECV) ? @@ -1008,8 +1011,12 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase) COLOR_WIN_STATUS_DATA_HIGHLIGHT); break; } - wprintw (ptr_win->win_status, "%d", - ptr_hotlist->buffer->number); + if (ptr_hotlist->buffer->dcc) + wprintw (ptr_win->win_status, "%d/DCC", + ptr_hotlist->buffer->number); + else + wprintw (ptr_win->win_status, "%d", + ptr_hotlist->buffer->number); gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS); if (ptr_hotlist->next_hotlist) @@ -1341,6 +1348,27 @@ gui_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer) } /* + * gui_get_dcc_buffer: get pointer to DCC buffer (DCC buffer created if not existing) + */ + +t_gui_buffer * +gui_get_dcc_buffer () +{ + t_gui_buffer *ptr_buffer; + + /* check if dcc buffer exists */ + for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer) + { + if (BUFFER_IS_DCC (ptr_buffer)) + break; + } + if (ptr_buffer) + return ptr_buffer; + else + return gui_buffer_new (gui_current_window, NULL, NULL, 1, 0); +} + +/* * gui_switch_to_dcc_buffer: switch to dcc buffer (create it if it does not exist) */ diff --git a/weechat/src/gui/gui.h b/weechat/src/gui/gui.h index 4f44ba8d8..aca1d2620 100644 --- a/weechat/src/gui/gui.h +++ b/weechat/src/gui/gui.h @@ -263,6 +263,7 @@ extern void gui_draw_buffer_infobar (t_gui_buffer *, int); extern void gui_draw_buffer_input (t_gui_buffer *, int); extern void gui_redraw_buffer (t_gui_buffer *); extern void gui_switch_to_buffer (t_gui_window *, t_gui_buffer *); +extern t_gui_buffer *gui_get_dcc_buffer (); extern void gui_switch_to_dcc_buffer (); extern void gui_switch_to_previous_buffer (t_gui_window *); extern void gui_switch_to_next_buffer (t_gui_window *); diff --git a/weechat/src/irc/irc-dcc.c b/weechat/src/irc/irc-dcc.c index 136a21a1b..a8063cf8a 100644 --- a/weechat/src/irc/irc-dcc.c +++ b/weechat/src/irc/irc-dcc.c @@ -109,6 +109,83 @@ dcc_close (t_dcc *ptr_dcc, int status) } /* + * dcc_accept: accepts a DCC file or chat request + */ + +void +dcc_accept (t_dcc *ptr_dcc) +{ + char *ptr_home, *filename2; + + dcc_connect (ptr_dcc); + if (ptr_dcc->sock == -1) + ptr_dcc->status = DCC_FAILED; + else + { + ptr_dcc->status = DCC_ACTIVE; + ptr_home = getenv ("HOME"); + gui_printf (NULL, "home = %s\n", ptr_home); + ptr_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) + + strlen (ptr_dcc->nick) + + strlen (ptr_dcc->filename) + + ((cfg_dcc_download_path[0] == '~') ? + strlen (ptr_home) : 0) + + 4); + if (!ptr_dcc->local_filename) + { + ptr_dcc->status = DCC_FAILED; + return; + } + if (cfg_dcc_download_path[0] == '~') + { + strcpy (ptr_dcc->local_filename, ptr_home); + strcat (ptr_dcc->local_filename, cfg_dcc_download_path + 1); + } + else + strcpy (ptr_dcc->local_filename, cfg_dcc_download_path); + if (ptr_dcc->local_filename[strlen (ptr_dcc->local_filename) - 1] != DIR_SEPARATOR) + strcat (ptr_dcc->local_filename, DIR_SEPARATOR); + strcat (ptr_dcc->local_filename, ptr_dcc->nick); + strcat (ptr_dcc->local_filename, "."); + strcat (ptr_dcc->local_filename, ptr_dcc->filename); + + /* file already exists? */ + if (access (ptr_dcc->local_filename, F_OK) == 0) + { + /* if auto rename is not set, then abort DCC */ + if (!cfg_dcc_auto_rename) + { + ptr_dcc->status = DCC_FAILED; + return; + } + + filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16); + if (!filename2) + { + ptr_dcc->status = DCC_FAILED; + return; + } + ptr_dcc->filename_suffix = 0; + do + { + ptr_dcc->filename_suffix++; + sprintf (filename2, "%s.%d", + ptr_dcc->local_filename, + ptr_dcc->filename_suffix); + } + while (access (filename2, F_OK) == 0); + + free (ptr_dcc->local_filename); + ptr_dcc->local_filename = strdup (filename2); + free (filename2); + } + ptr_dcc->file = open (ptr_dcc->local_filename, + O_CREAT | O_TRUNC | O_WRONLY, + 0644); + } +} + +/* * dcc_add: add a DCC file to queue */ @@ -117,8 +194,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic unsigned int size) { t_dcc *new_dcc; - int num; - char *filename2; + t_gui_buffer *dcc_buffer; if ((new_dcc = (t_dcc *) malloc (sizeof (t_dcc))) == NULL) { @@ -135,6 +211,7 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic new_dcc->file = -1; new_dcc->filename = strdup (filename); new_dcc->local_filename = NULL; + new_dcc->filename_suffix = -1; new_dcc->size = size; new_dcc->pos = 0; new_dcc->next_dcc = dcc_list; @@ -146,53 +223,17 @@ dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char *nic addr >> 24, (addr >> 16) & 0xff, (addr >> 8) & 0xff, addr & 0xff, port, filename, size); - if (type == DCC_FILE_RECV) + dcc_buffer = gui_get_dcc_buffer (); + + if ( ( (type == DCC_CHAT_RECV) && (cfg_dcc_auto_accept_chats) ) + || ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) ) { - dcc_connect (new_dcc); - if (new_dcc->sock == -1) - new_dcc->status = DCC_FAILED; - else - { - new_dcc->status = DCC_ACTIVE; - new_dcc->local_filename = (char *) malloc (strlen (cfg_dcc_download_path) + - strlen (nick) + - strlen (filename) + 4); - if (!new_dcc->local_filename) - { - new_dcc->status = DCC_FAILED; - return NULL; - } - strcpy (new_dcc->local_filename, cfg_dcc_download_path); - if (new_dcc->local_filename[strlen (new_dcc->local_filename) - 1] != '/') - strcat (new_dcc->local_filename, "/"); - strcat (new_dcc->local_filename, nick); - strcat (new_dcc->local_filename, "."); - strcat (new_dcc->local_filename, filename); - if (access (new_dcc->local_filename, F_OK) == 0) - { - filename2 = (char *) malloc (strlen (new_dcc->local_filename) + 16); - if (!filename2) - { - new_dcc->status = DCC_FAILED; - return NULL; - } - num = 0; - do - { - num++; - sprintf (filename2, "%s.%d", new_dcc->local_filename, num); - } - while (access (filename2, F_OK) == 0); - - free (new_dcc->local_filename); - new_dcc->local_filename = strdup (filename2); - free (filename2); - } - new_dcc->file = open (new_dcc->local_filename, - O_CREAT | O_TRUNC | O_WRONLY, - 0644); - } + dcc_accept (new_dcc); + hotlist_add (1, dcc_buffer); } + else + hotlist_add (2, dcc_buffer); + gui_draw_buffer_status (dcc_buffer, 0); return new_dcc; } @@ -233,7 +274,7 @@ dcc_handle () if (ptr_dcc->pos >= ptr_dcc->size) { gui_printf (NULL, - _("DCC: file \"%s\" received from \"%s\": done!\n"), + _("DCC: file \"%s\" received from \"%s\": ok!\n"), ptr_dcc->filename, ptr_dcc->nick); dcc_close (ptr_dcc, DCC_DONE); } @@ -260,7 +301,7 @@ dcc_end () if (ptr_dcc->status == DCC_ACTIVE) wee_log_printf (_("aborting active DCC: \"%s\" from %s\n"), ptr_dcc->filename, ptr_dcc->nick); - close (ptr_dcc->sock); + dcc_close (ptr_dcc, DCC_FAILED); } } } diff --git a/weechat/src/irc/irc.h b/weechat/src/irc/irc.h index fb0f03b56..0d1057e67 100644 --- a/weechat/src/irc/irc.h +++ b/weechat/src/irc/irc.h @@ -188,6 +188,7 @@ struct t_dcc int file; /* local file (for reading or writing) */ char *filename; /* filename */ char *local_filename; /* local filename */ + int filename_suffix; /* suffix (.1 for ex) if renaming file */ unsigned long size; /* file size */ unsigned long pos; /* number of bytes received/sent */ t_dcc *next_dcc; /* link to next dcc file/chat */ |