1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 16:05:42 +02:00

Add nick completion in xfer dcc buffers, fix bug when opening xfer dcc buffer if it already exists

This commit is contained in:
Sebastien Helleu
2009-03-23 13:37:25 +01:00
parent 2a2f019cd8
commit fdf56fc7b0
16 changed files with 231 additions and 41 deletions
+2
View File
@@ -239,6 +239,8 @@
./src/plugins/xfer/xfer-chat.h
./src/plugins/xfer/xfer-command.c
./src/plugins/xfer/xfer-command.h
./src/plugins/xfer/xfer-completion.c
./src/plugins/xfer/xfer-completion.h
./src/plugins/xfer/xfer-config.c
./src/plugins/xfer/xfer-config.h
./src/plugins/xfer/xfer-dcc.c
+5 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-03-22 16:17+0100\n"
"POT-Creation-Date: 2009-03-23 11:08+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5334,6 +5334,10 @@ msgstr "Ruším aktivní DCC: \"%s\" od %s\n"
msgid "%s%s: error sending data to \"%s\" via xfer chat"
msgstr "%s chyba posílání dat k \"%s\" přes DCC CHAT\n"
#, fuzzy, c-format
msgid "%s%s: can't find xfer for buffer \"%s\""
msgstr "%s nemohu vytvořít nové soukromý buffer\"%s\"\n"
#, fuzzy, c-format
msgid "Connected to %s (%d.%d.%d.%d) via xfer chat"
msgstr "Připojeno na %s%s %s(%s%d.%d.%d.%d.%s)%s přes DCC rozhovor\n"
+5 -1
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-03-22 16:17+0100\n"
"POT-Creation-Date: 2009-03-23 11:08+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5272,6 +5272,10 @@ msgstr "Aktiver DCC wird abgebrochen: \"%s\" von %s\n"
msgid "%s%s: error sending data to \"%s\" via xfer chat"
msgstr "%s Fehler beim Senden von Daten an \"%s\" via DCC CHAT\n"
#, fuzzy, c-format
msgid "%s%s: can't find xfer for buffer \"%s\""
msgstr "%s kann kein neues privates Fenster \"%s\" erzeugen\n"
#, fuzzy, c-format
msgid "Connected to %s (%d.%d.%d.%d) via xfer chat"
msgstr "DCC Chat mit %s%s %s(%s%d.%d.%d.%d%s)%s aufgebaut\n"
+5 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-03-22 16:17+0100\n"
"POT-Creation-Date: 2009-03-23 11:08+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5265,6 +5265,10 @@ msgstr "Abandonar el DCC activo: \"%s\" de %s\n"
msgid "%s%s: error sending data to \"%s\" via xfer chat"
msgstr "%s error enviando datos al \"%s\" con DCC CHAT\n"
#, fuzzy, c-format
msgid "%s%s: can't find xfer for buffer \"%s\""
msgstr "%s no es posible crear una nueva ventana privada \"%s\"\n"
#, fuzzy, c-format
msgid "Connected to %s (%d.%d.%d.%d) via xfer chat"
msgstr "Conectado a %s%s %s(%s%d.%d.%d.%d%s)%s a través de una charla DCC\n"
+6 -2
View File
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-03-22 16:17+0100\n"
"PO-Revision-Date: 2009-03-22 16:17+0100\n"
"POT-Creation-Date: 2009-03-23 11:08+0100\n"
"PO-Revision-Date: 2009-03-23 11:08+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@@ -5463,6 +5463,10 @@ msgstr "%s%s: abandon du xfer actif: \"%s\" de %s"
msgid "%s%s: error sending data to \"%s\" via xfer chat"
msgstr "%s%s: erreur d'envoi de données à \"%s\" via discussion xfer"
#, c-format
msgid "%s%s: can't find xfer for buffer \"%s\""
msgstr "%s%s: impossible de trouver le xfer pour le tampon \"%s\""
#, c-format
msgid "Connected to %s (%d.%d.%d.%d) via xfer chat"
msgstr "Connecté à %s (%d.%d.%d.%d) via discussion xfer"
+5 -1
View File
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-03-22 16:17+0100\n"
"POT-Creation-Date: 2009-03-23 11:08+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5329,6 +5329,10 @@ msgstr "\"%s\" aktív DCC megszakítása a következővel: %s\n"
msgid "%s%s: error sending data to \"%s\" via xfer chat"
msgstr "%s hiba a(z) \"%s\" felé DCC CHAT-tel történő adatküldés közben\n"
#, fuzzy, c-format
msgid "%s%s: can't find xfer for buffer \"%s\""
msgstr "%s nem sikerült új privát ablakot nyitni \"%s\"\n"
#, fuzzy, c-format
msgid "Connected to %s (%d.%d.%d.%d) via xfer chat"
msgstr ""
+5 -1
View File
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.2.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-03-22 16:17+0100\n"
"POT-Creation-Date: 2009-03-23 11:08+0100\n"
"PO-Revision-Date: 2009-01-03 00:42+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5300,6 +5300,10 @@ msgstr "Отменяю активное DCC-сединение: \"%s\" от %s\n
msgid "%s%s: error sending data to \"%s\" via xfer chat"
msgstr "%s ошибка при отправке данных \"%s\" через DCC-чат\n"
#, fuzzy, c-format
msgid "%s%s: can't find xfer for buffer \"%s\""
msgstr "%s невозможно создать новый буфер привата \"%s\"\n"
#, fuzzy, c-format
msgid "Connected to %s (%d.%d.%d.%d) via xfer chat"
msgstr "Соединён с %s%s %s(%s%d.%d.%d.%d%s)%s DCC-чатом\n"
+2
View File
@@ -240,6 +240,8 @@ SET(WEECHAT_SOURCES
./src/plugins/xfer/xfer-chat.h
./src/plugins/xfer/xfer-command.c
./src/plugins/xfer/xfer-command.h
./src/plugins/xfer/xfer-completion.c
./src/plugins/xfer/xfer-completion.h
./src/plugins/xfer/xfer-config.c
./src/plugins/xfer/xfer-config.h
./src/plugins/xfer/xfer-dcc.c
+5 -1
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2009-03-22 16:17+0100\n"
"POT-Creation-Date: 2009-03-23 11:08+0100\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"
@@ -4597,6 +4597,10 @@ msgstr ""
msgid "%s%s: error sending data to \"%s\" via xfer chat"
msgstr ""
#, c-format
msgid "%s%s: can't find xfer for buffer \"%s\""
msgstr ""
#, c-format
msgid "Connected to %s (%d.%d.%d.%d) via xfer chat"
msgstr ""
+1
View File
@@ -19,6 +19,7 @@ xfer.c xfer.h
xfer-buffer.c xfer-buffer.h
xfer-chat.c xfer-chat.h
xfer-command.c xfer-command.h
xfer-completion.c xfer-completion.h
xfer-config.c xfer-config.h
xfer-dcc.c xfer-dcc.h
xfer-file.c xfer-file.h
+2
View File
@@ -28,6 +28,8 @@ xfer_la_SOURCES = xfer.c \
xfer-chat.h \
xfer-command.c \
xfer-command.h \
xfer-completion.c \
xfer-completion.h \
xfer-config.c \
xfer-config.h \
xfer-dcc.c \
File diff suppressed because it is too large Load Diff
+73
View File
@@ -0,0 +1,73 @@
/*
* Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* xfer-completion.c: nick completion for xfer chats */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "../weechat-plugin.h"
#include "xfer.h"
#include "xfer-completion.h"
/*
* xfer_completion_nick_cb: callback for completion with nick
*/
int
xfer_completion_nick_cb (void *data, const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_xfer *ptr_xfer;
/* make C compiler happy */
(void) data;
(void) completion_item;
ptr_xfer = xfer_search_by_buffer (buffer);
if (ptr_xfer)
{
/* remote nick */
weechat_hook_completion_list_add (completion,
ptr_xfer->remote_nick,
0,
WEECHAT_LIST_POS_SORT);
/* add self nick at the end */
weechat_hook_completion_list_add (completion,
ptr_xfer->local_nick,
1,
WEECHAT_LIST_POS_END);
}
return WEECHAT_RC_OK;
}
/*
* xfer_completion_init: init completion for xfer plugin
*/
void
xfer_completion_init ()
{
weechat_hook_completion ("nick",
&xfer_completion_nick_cb, NULL);
}
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org>
* See README for License detail, AUTHORS for developers list.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __WEECHAT_XFER_COMPLETION_H
#define __WEECHAT_XFER_COMPLETION_H 1
extern void xfer_completion_init ();
#endif /* xfer-completion.h */
+28 -1
View File
@@ -34,6 +34,7 @@
#include "xfer.h"
#include "xfer-buffer.h"
#include "xfer-command.h"
#include "xfer-completion.h"
#include "xfer-config.h"
#include "xfer-file.h"
#include "xfer-info.h"
@@ -230,6 +231,28 @@ xfer_search_by_number (int number)
return NULL;
}
/*
* xfer_search_by_buffer: search a xfer by buffer (for chat only)
*/
struct t_xfer *
xfer_search_by_buffer (struct t_gui_buffer *buffer)
{
struct t_xfer *ptr_xfer;
if (!buffer)
return NULL;
for (ptr_xfer = xfer_list; ptr_xfer; ptr_xfer = ptr_xfer->next_xfer)
{
if (ptr_xfer->buffer == buffer)
return ptr_xfer;
}
/* xfer not found */
return NULL;
}
/*
* xfer_close: close a xfer
*/
@@ -1393,13 +1416,17 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
xfer_create_directories ();
xfer_command_init ();
/* hook some signals */
weechat_hook_signal ("upgrade", &xfer_signal_upgrade_cb, NULL);
weechat_hook_signal ("xfer_add", &xfer_add_cb, NULL);
weechat_hook_signal ("xfer_start_resume", &xfer_start_resume_cb, NULL);
weechat_hook_signal ("xfer_accept_resume", &xfer_accept_resume_cb, NULL);
weechat_hook_signal ("debug_dump", &xfer_debug_dump_cb, NULL);
/* hook completions */
xfer_completion_init ();
xfer_info_init ();
return WEECHAT_RC_OK;
+1
View File
@@ -157,6 +157,7 @@ extern int xfer_count;
extern int xfer_valid (struct t_xfer *xfer);
extern struct t_xfer *xfer_search_by_number (int number);
extern struct t_xfer *xfer_search_by_buffer (struct t_gui_buffer *buffer);
extern void xfer_close (struct t_xfer *xfer, enum t_xfer_status status);
extern void xfer_send_signal (struct t_xfer *xfer, const char *signal);
extern void xfer_free (struct t_xfer *xfer);