1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

Send channel topic to relay client when joining a channel

This commit is contained in:
Sebastien Helleu
2010-09-20 22:49:11 +02:00
parent 1d3c3ffb92
commit 051788f731
15 changed files with 115 additions and 36 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
| alias | alias | Liste der Alias | Alias Pointer (optional) | Alias Name (darf mit einem "*" als Platzhalter beginnen oder enden) (optional)
| irc | irc_channel | Liste der Channels eines IRC-Servers | Channel Pointer (optional) | Servername
| irc | irc_channel | Liste der Channels eines IRC-Servers | Channel Pointer (optional) | server,channel (channel is optional)
| irc | irc_ignore | Liste von ignorierten IRCs | Ignore Pointer (optional) | -
+1 -1
View File
@@ -4,7 +4,7 @@
| alias | alias | list of aliases | alias pointer (optional) | alias name (can start or end with "*" as wildcard) (optional)
| irc | irc_channel | list of channels for an IRC server | channel pointer (optional) | server name
| irc | irc_channel | list of channels for an IRC server | channel pointer (optional) | server,channel (channel is optional)
| irc | irc_ignore | list of IRC ignores | ignore pointer (optional) | -
+1 -1
View File
@@ -4,7 +4,7 @@
| alias | alias | liste des alias | pointeur vers l'alias (optionnel) | nom d'alias (peut démarrer ou se terminer par "*" comme joker) (optionnel)
| irc | irc_channel | liste des canaux pour un serveur IRC | pointeur vers le canal (optionnel) | nom de serveur
| irc | irc_channel | liste des canaux pour un serveur IRC | pointeur vers le canal (optionnel) | serveur,canal (le canal est optionnel)
| irc | irc_ignore | liste des ignores IRC | pointeur vers l'ignore (optionnel) | -
+1 -1
View File
@@ -4,7 +4,7 @@
| alias | alias | elenco di alias | puntatore all'alias (opzionale) | nome alias (può iniziare o terminare con "*" come carattere jolly) (opzionale)
| irc | irc_channel | elenco dei canali per un server IRC | puntatore al canale (opzionale) | nome server
| irc | irc_channel | elenco dei canali per un server IRC | puntatore al canale (opzionale) | server,channel (channel is optional)
| irc | irc_ignore | elenco di ignore IRC | puntatore all'ignore (opzionale) | -
+5 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-09-18 09:24+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4873,6 +4873,10 @@ msgstr "seznam kanálů pro IRC server"
msgid "channel pointer (optional)"
msgstr "ukazatel kanálu (volitelné)"
#, fuzzy
msgid "server,channel (channel is optional)"
msgstr "server,kanál,přezdívka (kanál a přezdívka jsou volitelné)"
msgid "list of nicks for an IRC channel"
msgstr "seznam uživatelů pro IRC kanál"
+5 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.3-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-09-18 09:24+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+0200\n"
"PO-Revision-Date: 2010-09-08 22:15+0200\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5081,6 +5081,10 @@ msgstr "Liste der Channels eines IRC-Servers"
msgid "channel pointer (optional)"
msgstr "Channel Pointer (optional)"
#, fuzzy
msgid "server,channel (channel is optional)"
msgstr "server,channel,nick (Channel und Nicks sind optional)"
msgid "list of nicks for an IRC channel"
msgstr "Liste der Nicks im IRC-Channel"
+5 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-09-18 09:24+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4938,6 +4938,10 @@ msgstr "lista de canales de un servidor IRC"
msgid "channel pointer (optional)"
msgstr "puntero del canal (opcional)"
#, fuzzy
msgid "server,channel (channel is optional)"
msgstr "servidor,canal,apodo (canal y apodo es opcional)"
msgid "list of nicks for an IRC channel"
msgstr "lista de apodos de un canal IRC"
+5 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-09-18 09:24+0200\n"
"PO-Revision-Date: 2010-09-18 09:21+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+0200\n"
"PO-Revision-Date: 2010-09-20 22:26+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -4983,6 +4983,9 @@ msgstr "liste des canaux pour un serveur IRC"
msgid "channel pointer (optional)"
msgstr "pointeur vers le canal (optionnel)"
msgid "server,channel (channel is optional)"
msgstr "serveur,canal (le canal est optionnel)"
msgid "list of nicks for an IRC channel"
msgstr "liste des pseudos pour un canal IRC"
+5 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-09-18 09:24+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4657,6 +4657,10 @@ msgstr "szobák listája ahová be akarunk lépni csatlakozás után"
msgid "channel pointer (optional)"
msgstr ""
#, fuzzy
msgid "server,channel (channel is optional)"
msgstr "szoba: szoba neve"
#, fuzzy
msgid "list of nicks for an IRC channel"
msgstr "felhasználók listája a szobában"
+5 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-09-18 09:24+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4947,6 +4947,10 @@ msgstr "elenco dei canali per un server IRC"
msgid "channel pointer (optional)"
msgstr "puntatore al canale (opzionale)"
#, fuzzy
msgid "server,channel (channel is optional)"
msgstr "server,canale,nick (canale e nick sono opzionali)"
msgid "list of nicks for an IRC channel"
msgstr "elenco dei nick per un canale IRC"
+5 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-09-18 09:24+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4911,6 +4911,10 @@ msgstr "lista kanałów IRC"
msgid "channel pointer (optional)"
msgstr "wskaźnik kanału (opcjonalne)"
#, fuzzy
msgid "server,channel (channel is optional)"
msgstr "serwer,kanał,nick (kanał oraz nick są opcjonalne)"
msgid "list of nicks for an IRC channel"
msgstr "lista nicków na kanale IRC"
+5 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-09-18 09:24+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+0200\n"
"PO-Revision-Date: 2010-08-07 10:46+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4665,6 +4665,10 @@ msgstr "Список каналов, на которые заходить при
msgid "channel pointer (optional)"
msgstr ""
#, fuzzy
msgid "server,channel (channel is optional)"
msgstr "канал: название канала"
#, fuzzy
msgid "list of nicks for an IRC channel"
msgstr "список ников на канале"
+4 -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: 2010-09-18 09:24+0200\n"
"POT-Creation-Date: 2010-09-20 22:26+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"
@@ -3984,6 +3984,9 @@ msgstr ""
msgid "channel pointer (optional)"
msgstr ""
msgid "server,channel (channel is optional)"
msgstr ""
msgid "list of nicks for an IRC channel"
msgstr ""
+45 -19
View File
@@ -324,39 +324,65 @@ irc_info_get_infolist_cb (void *data, const char *infolist_name,
{
if (arguments && arguments[0])
{
ptr_server = irc_server_search (arguments);
if (ptr_server)
ptr_server = NULL;
ptr_channel = NULL;
argv = weechat_string_split (arguments, ",", 0, 0, &argc);
if (argv)
{
if (pointer && !irc_channel_valid (ptr_server, pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (ptr_infolist)
if (argc >= 1)
{
if (pointer)
ptr_server = irc_server_search (argv[0]);
if (!ptr_server)
{
/* build list with only one channel */
if (!irc_channel_add_to_infolist (ptr_infolist, pointer))
weechat_string_free_split (argv);
return NULL;
}
if (!pointer && (argc >= 2))
{
pointer = irc_channel_search (ptr_server, argv[1]);
if (!pointer)
{
weechat_infolist_free (ptr_infolist);
weechat_string_free_split (argv);
return NULL;
}
return ptr_infolist;
}
else
}
weechat_string_free_split (argv);
if (ptr_server)
{
if (pointer && !irc_channel_valid (ptr_server, pointer))
return NULL;
ptr_infolist = weechat_infolist_new ();
if (ptr_infolist)
{
/* build list with all channels of server */
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
if (pointer)
{
/* build list with only one channel */
if (!irc_channel_add_to_infolist (ptr_infolist,
ptr_channel))
pointer))
{
weechat_infolist_free (ptr_infolist);
return NULL;
}
return ptr_infolist;
}
else
{
/* build list with all channels of server */
for (ptr_channel = ptr_server->channels;
ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
if (!irc_channel_add_to_infolist (ptr_infolist,
ptr_channel))
{
weechat_infolist_free (ptr_infolist);
return NULL;
}
}
return ptr_infolist;
}
return ptr_infolist;
}
}
}
@@ -539,7 +565,7 @@ irc_info_init ()
weechat_hook_infolist ("irc_channel",
N_("list of channels for an IRC server"),
N_("channel pointer (optional)"),
N_("server name"),
N_("server,channel (channel is optional)"),
&irc_info_get_infolist_cb, NULL);
weechat_hook_infolist ("irc_nick",
N_("list of nicks for an IRC channel"),
+22 -3
View File
@@ -444,10 +444,10 @@ relay_client_irc_send_join (struct t_relay_client *client,
const char *channel)
{
char *infolist_name, *nicks;
const char *nick, *prefix;
const char *nick, *prefix, *topic;
char *host;
int length, length_nicks;
struct t_infolist *infolist_nick, *infolist_nicks;
struct t_infolist *infolist_nick, *infolist_channel, *infolist_nicks;
length = strlen (client->protocol_args) + 1 + strlen (channel) + 1
+ strlen (RELAY_IRC_DATA(client, nick)) + 1;
@@ -481,7 +481,26 @@ relay_client_irc_send_join (struct t_relay_client *client,
snprintf (infolist_name, length, "%s,%s",
client->protocol_args,
channel);
infolist_nicks = weechat_infolist_get ("irc_nick", NULL, infolist_name);
infolist_channel = weechat_infolist_get ("irc_channel", NULL,
infolist_name);
if (infolist_channel)
{
if (weechat_infolist_next (infolist_channel))
{
topic = weechat_infolist_string (infolist_channel, "topic");
if (topic && topic[0])
{
relay_client_irc_sendf (client,
":%s 332 %s %s :%s",
RELAY_IRC_DATA(client, address),
RELAY_IRC_DATA(client, nick),
channel, topic);
}
}
weechat_infolist_free (infolist_channel);
}
infolist_nicks = weechat_infolist_get ("irc_nick", NULL,
infolist_name);
if (infolist_nicks)
{
length_nicks = 0;