summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-10-09 21:33:09 +0200
committerSebastien Helleu <flashcode@flashtux.org>2012-10-09 21:33:09 +0200
commit5cfeb2f2bcad5a4b2c8350d386c28e131acfec30 (patch)
treedf603051c087fb1f051373c35ef425079a527a85
parentaa6b88638632343516f175fd572417b7d54d483e (diff)
downloadweechat-5cfeb2f2bcad5a4b2c8350d386c28e131acfec30.zip
irc: add option "-noswitch" for command /join (task #12275)
-rw-r--r--ChangeLog3
-rw-r--r--doc/de/autogen/plugin_api/hdata.txt5
-rw-r--r--doc/de/autogen/user/irc_commands.txt14
-rw-r--r--doc/en/autogen/plugin_api/hdata.txt5
-rw-r--r--doc/en/autogen/user/irc_commands.txt10
-rw-r--r--doc/fr/autogen/plugin_api/hdata.txt5
-rw-r--r--doc/fr/autogen/user/irc_commands.txt10
-rw-r--r--doc/it/autogen/plugin_api/hdata.txt5
-rw-r--r--doc/it/autogen/user/irc_commands.txt14
-rw-r--r--doc/ja/autogen/plugin_api/hdata.txt5
-rw-r--r--doc/ja/autogen/user/irc_commands.txt12
-rw-r--r--po/cs.po18
-rw-r--r--po/de.po18
-rw-r--r--po/es.po18
-rw-r--r--po/fr.po31
-rw-r--r--po/hu.po16
-rw-r--r--po/it.po18
-rw-r--r--po/ja.po18
-rw-r--r--po/pl.po18
-rw-r--r--po/pt_BR.po16
-rw-r--r--po/ru.po16
-rw-r--r--po/weechat.pot16
-rw-r--r--src/plugins/irc/irc-channel.c23
-rw-r--r--src/plugins/irc/irc-command.c86
-rw-r--r--src/plugins/irc/irc-command.h3
-rw-r--r--src/plugins/irc/irc-protocol.c6
-rw-r--r--src/plugins/irc/irc-server.c100
-rw-r--r--src/plugins/irc/irc-server.h5
28 files changed, 338 insertions, 176 deletions
diff --git a/ChangeLog b/ChangeLog
index f9673bd39..2eeb05480 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,13 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
-v0.4.0-dev, 2012-10-06
+v0.4.0-dev, 2012-10-09
Version 0.4.0 (under dev!)
--------------------------
* aspell: add bar item "aspell_dict" (dictionary used on current buffer)
+* irc: add option "-noswitch" for command /join (task #12275)
* irc: fix crash when message 352 has too few arguments (bug #37513)
* irc: remove unneeded server disconnect when server buffer is closed and server
is already disconnected
diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt
index f021b9f55..2a3a5bc09 100644
--- a/doc/de/autogen/plugin_api/hdata.txt
+++ b/doc/de/autogen/plugin_api/hdata.txt
@@ -189,8 +189,9 @@
'last_redirect' (pointer, hdata: "irc_redirect") +
'notify_list' (pointer, hdata: "irc_notify") +
'last_notify' (pointer, hdata: "irc_notify") +
- 'manual_joins' (hashtable) +
- 'channel_join_key' (hashtable) +
+ 'join_manual' (hashtable) +
+ 'join_channel_key' (hashtable) +
+ 'join_noswitch' (hashtable) +
'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
'channels' (pointer, hdata: "irc_channel") +
diff --git a/doc/de/autogen/user/irc_commands.txt b/doc/de/autogen/user/irc_commands.txt
index 1441cb703..69d148e1d 100644
--- a/doc/de/autogen/user/irc_commands.txt
+++ b/doc/de/autogen/user/irc_commands.txt
@@ -212,16 +212,18 @@ nick: Nickname
[[command_irc_join]]
[command]*`join`* einen Channel betreten::
........................................
-/join [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]
+/join [-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]
- server: Verbindung zu diesem Server (interner Name)
-channel: Name des Channels der betreten werden soll
- key: Zugriffsschlüssel für einen Channel (Channels die einen Zugriffsschlüssel benötigen müssen zuerst aufgeführt werden)
+-noswitch: do not switch to new buffer
+ server: send to this server (internal name)
+ channel: channel name to join
+ key: key to join the channel (channels with a key must be the first in list)
-Beispiele:
+Examples:
/join #weechat
- /join #geschützter_Channel,#weechat Zugriffsschlüssel
+ /join #protectedchan,#weechat key
/join -server freenode #weechat
+ /join -noswitch #weechat
........................................
[[command_irc_kick]]
diff --git a/doc/en/autogen/plugin_api/hdata.txt b/doc/en/autogen/plugin_api/hdata.txt
index 71439fdff..3b8bc5793 100644
--- a/doc/en/autogen/plugin_api/hdata.txt
+++ b/doc/en/autogen/plugin_api/hdata.txt
@@ -189,8 +189,9 @@
'last_redirect' (pointer, hdata: "irc_redirect") +
'notify_list' (pointer, hdata: "irc_notify") +
'last_notify' (pointer, hdata: "irc_notify") +
- 'manual_joins' (hashtable) +
- 'channel_join_key' (hashtable) +
+ 'join_manual' (hashtable) +
+ 'join_channel_key' (hashtable) +
+ 'join_noswitch' (hashtable) +
'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
'channels' (pointer, hdata: "irc_channel") +
diff --git a/doc/en/autogen/user/irc_commands.txt b/doc/en/autogen/user/irc_commands.txt
index 0b0c59769..f7509d988 100644
--- a/doc/en/autogen/user/irc_commands.txt
+++ b/doc/en/autogen/user/irc_commands.txt
@@ -212,16 +212,18 @@ nick: nick
[[command_irc_join]]
[command]*`join`* join a channel::
........................................
-/join [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]
+/join [-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]
- server: send to this server (internal name)
-channel: channel name to join
- key: key to join the channel (channels with a key must be the first in list)
+-noswitch: do not switch to new buffer
+ server: send to this server (internal name)
+ channel: channel name to join
+ key: key to join the channel (channels with a key must be the first in list)
Examples:
/join #weechat
/join #protectedchan,#weechat key
/join -server freenode #weechat
+ /join -noswitch #weechat
........................................
[[command_irc_kick]]
diff --git a/doc/fr/autogen/plugin_api/hdata.txt b/doc/fr/autogen/plugin_api/hdata.txt
index 8d14fb44f..80434d20e 100644
--- a/doc/fr/autogen/plugin_api/hdata.txt
+++ b/doc/fr/autogen/plugin_api/hdata.txt
@@ -189,8 +189,9 @@
'last_redirect' (pointer, hdata: "irc_redirect") +
'notify_list' (pointer, hdata: "irc_notify") +
'last_notify' (pointer, hdata: "irc_notify") +
- 'manual_joins' (hashtable) +
- 'channel_join_key' (hashtable) +
+ 'join_manual' (hashtable) +
+ 'join_channel_key' (hashtable) +
+ 'join_noswitch' (hashtable) +
'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
'channels' (pointer, hdata: "irc_channel") +
diff --git a/doc/fr/autogen/user/irc_commands.txt b/doc/fr/autogen/user/irc_commands.txt
index 25d83e41a..57aa044a1 100644
--- a/doc/fr/autogen/user/irc_commands.txt
+++ b/doc/fr/autogen/user/irc_commands.txt
@@ -212,16 +212,18 @@ pseudo: pseudo
[[command_irc_join]]
[command]*`join`* rejoindre un canal::
........................................
-/join [-server <serveur>] [<canal1>[,<canal2>...]] [<clé1>[,<clé2>...]]
+/join [-noswitch] [-server <serveur>] [<canal1>[,<canal2>...]] [<clé1>[,<clé2>...]]
-serveur: envoyer à ce serveur (nom interne)
- canal: nom du canal à rejoindre
- clé: clé pour rejoindre le canal (les canaux avec une clé doivent être les premiers dans la liste)
+-noswitch: ne pas basculer sur le nouveau tampon
+ serveur: envoyer à ce serveur (nom interne)
+ canal: nom du canal à rejoindre
+ clé: clé pour rejoindre le canal (les canaux avec une clé doivent être les premiers dans la liste)
Exemples:
/join #weechat
/join #protectedchan,#weechat key
/join -server freenode #weechat
+ /join -noswitch #weechat
........................................
[[command_irc_kick]]
diff --git a/doc/it/autogen/plugin_api/hdata.txt b/doc/it/autogen/plugin_api/hdata.txt
index 6d74895eb..e7d4896ae 100644
--- a/doc/it/autogen/plugin_api/hdata.txt
+++ b/doc/it/autogen/plugin_api/hdata.txt
@@ -189,8 +189,9 @@
'last_redirect' (pointer, hdata: "irc_redirect") +
'notify_list' (pointer, hdata: "irc_notify") +
'last_notify' (pointer, hdata: "irc_notify") +
- 'manual_joins' (hashtable) +
- 'channel_join_key' (hashtable) +
+ 'join_manual' (hashtable) +
+ 'join_channel_key' (hashtable) +
+ 'join_noswitch' (hashtable) +
'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
'channels' (pointer, hdata: "irc_channel") +
diff --git a/doc/it/autogen/user/irc_commands.txt b/doc/it/autogen/user/irc_commands.txt
index df12ba5d5..a9fc3909d 100644
--- a/doc/it/autogen/user/irc_commands.txt
+++ b/doc/it/autogen/user/irc_commands.txt
@@ -212,16 +212,18 @@ nick: nick
[[command_irc_join]]
[command]*`join`* entra in un canale::
........................................
-/join [-server <server>] [<canale1>[,<canale2>...]] [<chiave1>[,<chiave2>...]]
+/join [-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]
-server: invia a questo server (nome interno)
-canale: nome del canale in cui entrare
-chiave: chiave per entrare nel canale (i canali con una chiave devono essere primi nella lista)
+-noswitch: do not switch to new buffer
+ server: send to this server (internal name)
+ channel: channel name to join
+ key: key to join the channel (channels with a key must be the first in list)
-Esempi:
+Examples:
/join #weechat
- /join #canaleprotetto,#weechat chiave
+ /join #protectedchan,#weechat key
/join -server freenode #weechat
+ /join -noswitch #weechat
........................................
[[command_irc_kick]]
diff --git a/doc/ja/autogen/plugin_api/hdata.txt b/doc/ja/autogen/plugin_api/hdata.txt
index 6a680d21a..af48c6abb 100644
--- a/doc/ja/autogen/plugin_api/hdata.txt
+++ b/doc/ja/autogen/plugin_api/hdata.txt
@@ -189,8 +189,9 @@
'last_redirect' (pointer, hdata: "irc_redirect") +
'notify_list' (pointer, hdata: "irc_notify") +
'last_notify' (pointer, hdata: "irc_notify") +
- 'manual_joins' (hashtable) +
- 'channel_join_key' (hashtable) +
+ 'join_manual' (hashtable) +
+ 'join_channel_key' (hashtable) +
+ 'join_noswitch' (hashtable) +
'buffer' (pointer, hdata: "buffer") +
'buffer_as_string' (string) +
'channels' (pointer, hdata: "irc_channel") +
diff --git a/doc/ja/autogen/user/irc_commands.txt b/doc/ja/autogen/user/irc_commands.txt
index 3998edd5a..9c8591dfe 100644
--- a/doc/ja/autogen/user/irc_commands.txt
+++ b/doc/ja/autogen/user/irc_commands.txt
@@ -212,16 +212,18 @@ nick: nick
[[command_irc_join]]
[command]*`join`* チャンネルに参加::
........................................
-/join [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]
+/join [-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]
- server: 送信先サーバ (内部サーバ名)
-channel: 参加するチャンネルの名前
- key: チャンネルに参加するためのキー (キーが必要なチャンネルは最初に置くこと)
+-noswitch: do not switch to new buffer
+ server: send to this server (internal name)
+ channel: channel name to join
+ key: key to join the channel (channels with a key must be the first in list)
-例:
+Examples:
/join #weechat
/join #protectedchan,#weechat key
/join -server freenode #weechat
+ /join -noswitch #weechat
........................................
[[command_irc_kick]]
diff --git a/po/cs.po b/po/cs.po
index b91b200c4..3090489c7 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4590,19 +4590,25 @@ msgstr "přezdívka: přezdívka"
msgid "join a channel"
msgstr "připojit se ke kanálu"
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+#, fuzzy
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr "[-server <server>] [<kanál1>[,<kanál2>...]] [<klíč1>[,<klíč2>...]]"
+#, fuzzy
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
"server: poslat na tento server (interní jméno)\n"
" kanál: jméno kanálu pro připojení\n"
diff --git a/po/de.po b/po/de.po
index cf1d93cd6..52b5c4a19 100644
--- a/po/de.po
+++ b/po/de.po
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -5007,19 +5007,25 @@ msgstr "nick: Nickname"
msgid "join a channel"
msgstr "einen Channel betreten"
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+#, fuzzy
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+#, fuzzy
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
" server: Verbindung zu diesem Server (interner Name)\n"
"channel: Name des Channels der betreten werden soll\n"
diff --git a/po/es.po b/po/es.po
index 482c46fde..d0eb8e8e4 100644
--- a/po/es.po
+++ b/po/es.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4795,19 +4795,25 @@ msgstr "apodo: apodo"
msgid "join a channel"
msgstr "unirse a un canal"
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+#, fuzzy
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr "[-server <servidor>] [<canal1>[,<canal2>...]] [<clave1>[,<clave2>...]]"
+#, fuzzy
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
" servidor: enviar a este servidor (nombre interno)\n"
" canal: nombre del canal a unirse\n"
diff --git a/po/fr.po b/po/fr.po
index e952dc8fe..7a7a8d816 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
-"PO-Revision-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
+"PO-Revision-Date: 2012-10-09 21:22+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -4864,29 +4864,36 @@ msgstr "pseudo: pseudo"
msgid "join a channel"
msgstr "rejoindre un canal"
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
-msgstr "[-server <serveur>] [<canal1>[,<canal2>...]] [<clé1>[,<clé2>...]]"
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
+msgstr ""
+"[-noswitch] [-server <serveur>] [<canal1>[,<canal2>...]] [<clé1>[,<clé2>...]]"
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
-"serveur: envoyer à ce serveur (nom interne)\n"
-" canal: nom du canal à rejoindre\n"
-" clé: clé pour rejoindre le canal (les canaux avec une clé doivent être "
+"-noswitch: ne pas basculer sur le nouveau tampon\n"
+" serveur: envoyer à ce serveur (nom interne)\n"
+" canal: nom du canal à rejoindre\n"
+" clé: clé pour rejoindre le canal (les canaux avec une clé doivent être "
"les premiers dans la liste)\n"
"\n"
"Exemples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgid "forcibly remove a user from a channel"
msgstr "retirer par la force un utilisateur d'un canal"
diff --git a/po/hu.po b/po/hu.po
index 10cd143d2..fee4cc48e 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4175,19 +4175,23 @@ msgid "join a channel"
msgstr "belépés egy szobába"
#, fuzzy
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr "szoba[,szoba] [kulcs[,kulcs]]"
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
msgid "forcibly remove a user from a channel"
diff --git a/po/it.po b/po/it.po
index e2dccbbf2..6706a9df1 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4792,20 +4792,26 @@ msgstr "nick: nick"
msgid "join a channel"
msgstr "entra in un canale"
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+#, fuzzy
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr ""
"[-server <server>] [<canale1>[,<canale2>...]] [<chiave1>[,<chiave2>...]]"
+#, fuzzy
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
"server: invia a questo server (nome interno)\n"
"canale: nome del canale in cui entrare\n"
diff --git a/po/ja.po b/po/ja.po
index 36f8a63d3..edb74d5b0 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@@ -4692,19 +4692,25 @@ msgstr "nick: nick"
msgid "join a channel"
msgstr "チャンネルに参加"
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+#, fuzzy
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+#, fuzzy
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
" server: 送信先サーバ (内部サーバ名)\n"
"channel: 参加するチャンネルの名前\n"
diff --git a/po/pl.po b/po/pl.po
index dee9f4d61..4552ddf75 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4773,19 +4773,25 @@ msgstr "nick: nazwa użytkownika"
msgid "join a channel"
msgstr "wchodzi na kanał"
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+#, fuzzy
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr "[-server <serwer>] [<kanał1>[,<kanał2>...]] [<klucz>[,<klucz2>...]]"
+#, fuzzy
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
" serwer: wyślij na ten serwer (nazwa wewnętrzna)\n"
"kanał: nazwa kanału do wejścia\n"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 33212e9dc..618ed2691 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:43+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4529,19 +4529,23 @@ msgstr ""
msgid "join a channel"
msgstr ""
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr ""
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
msgid "forcibly remove a user from a channel"
diff --git a/po/ru.po b/po/ru.po
index d3bb6dfa0..88c131bfb 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+0200\n"
"PO-Revision-Date: 2012-09-29 11:43+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4204,19 +4204,23 @@ msgid "join a channel"
msgstr "зайти на канал"
#, fuzzy
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr "канал[,канал] [ключ[,ключ]]"
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
msgid "forcibly remove a user from a channel"
diff --git a/po/weechat.pot b/po/weechat.pot
index 7acfa34a6..17e7d76f8 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: 2012-10-05 15:20+0200\n"
+"POT-Creation-Date: 2012-10-09 21:22+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"
@@ -3699,19 +3699,23 @@ msgstr ""
msgid "join a channel"
msgstr ""
-msgid "[-server <server>] [<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"
+msgid ""
+"[-noswitch] [-server <server>] [<channel1>[,<channel2>...]] [<key1>[,"
+"<key2>...]]"
msgstr ""
msgid ""
-" server: send to this server (internal name)\n"
-"channel: channel name to join\n"
-" key: key to join the channel (channels with a key must be the first in "
+"-noswitch: do not switch to new buffer\n"
+" server: send to this server (internal name)\n"
+" channel: channel name to join\n"
+" key: key to join the channel (channels with a key must be the first in "
"list)\n"
"\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
-" /join -server freenode #weechat"
+" /join -server freenode #weechat\n"
+" /join -noswitch #weechat"
msgstr ""
msgid "forcibly remove a user from a channel"
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index 2fcf4bae6..ad99108c8 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -152,6 +152,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
struct t_irc_channel *new_channel;
struct t_gui_buffer *new_buffer;
int i, buffer_created, current_buffer_number, buffer_position, manual_join;
+ int noswitch;
char *buffer_name, str_number[32], str_group[32], *channel_name_lower;
const char *prefix_modes;
@@ -265,11 +266,11 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
new_channel->topic = NULL;
new_channel->modes = NULL;
new_channel->limit = 0;
- if (weechat_hashtable_has_key (server->channel_join_key, channel_name))
+ if (weechat_hashtable_has_key (server->join_channel_key, channel_name))
{
- new_channel->key = strdup (weechat_hashtable_get (server->channel_join_key,
+ new_channel->key = strdup (weechat_hashtable_get (server->join_channel_key,
channel_name));
- weechat_hashtable_remove (server->channel_join_key, channel_name);
+ weechat_hashtable_remove (server->join_channel_key, channel_name);
}
else
{
@@ -304,6 +305,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
server->last_channel = new_channel;
manual_join = 0;
+ noswitch = 0;
channel_name_lower = NULL;
if (channel_type == IRC_CHANNEL_TYPE_CHANNEL)
{
@@ -311,8 +313,10 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
if (channel_name_lower)
{
weechat_string_tolower (channel_name_lower);
- manual_join = weechat_hashtable_has_key (server->manual_joins,
+ manual_join = weechat_hashtable_has_key (server->join_manual,
channel_name_lower);
+ noswitch = weechat_hashtable_has_key (server->join_noswitch,
+ channel_name_lower);
}
}
@@ -320,7 +324,8 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
{
if (channel_type == IRC_CHANNEL_TYPE_CHANNEL)
{
- if ((manual_join && !weechat_config_boolean (irc_config_look_buffer_switch_join))
+ if (noswitch
+ || (manual_join && !weechat_config_boolean (irc_config_look_buffer_switch_join))
|| (!manual_join && !weechat_config_boolean (irc_config_look_buffer_switch_autojoin)))
switch_to_channel = 0;
}
@@ -332,10 +337,12 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
}
}
- if (manual_join)
- weechat_hashtable_remove (server->manual_joins, channel_name_lower);
if (channel_name_lower)
+ {
+ weechat_hashtable_remove (server->join_manual, channel_name_lower);
+ weechat_hashtable_remove (server->join_noswitch, channel_name_lower);
free (channel_name_lower);
+ }
weechat_hook_signal_send ((channel_type == IRC_CHANNEL_TYPE_CHANNEL) ?
"irc_channel_opened" : "irc_pv_opened",
@@ -720,7 +727,7 @@ irc_channel_rejoin (struct t_irc_server *server, struct t_irc_channel *channel)
(channel->key) ? " " : "",
(channel->key) ? channel->key : "");
- irc_command_join_server (server, join_args, 0);
+ irc_command_join_server (server, join_args, 0, 1);
}
/*
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 319976a4b..a3da67117 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -1856,7 +1856,7 @@ irc_command_ison (void *data, struct t_gui_buffer *buffer, int argc,
void
irc_command_join_server (struct t_irc_server *server, const char *arguments,
- int manual_join)
+ int manual_join, int noswitch)
{
char *new_args, **channels, **keys, *pos_space, *pos_keys, *pos_channel;
int i, num_channels, num_keys, length;
@@ -1920,8 +1920,11 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments,
ptr_channel = irc_channel_search (server, new_args);
if (ptr_channel)
{
- weechat_buffer_set (ptr_channel->buffer,
- "display", "1");
+ if (!noswitch)
+ {
+ weechat_buffer_set (ptr_channel->buffer,
+ "display", "1");
+ }
}
}
new_args[0] = '\0';
@@ -1937,12 +1940,21 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments,
strcat (new_args, "#");
}
strcat (new_args, channels[i]);
- if (manual_join)
+ if (manual_join || noswitch)
{
weechat_string_tolower (channels[i]);
- weechat_hashtable_set (server->manual_joins,
- channels[i],
- &time_now);
+ if (manual_join)
+ {
+ weechat_hashtable_set (server->join_manual,
+ channels[i],
+ &time_now);
+ }
+ if (noswitch)
+ {
+ weechat_hashtable_set (server->join_noswitch,
+ channels[i],
+ &time_now);
+ }
}
if (keys && (i < num_keys))
{
@@ -1955,7 +1967,7 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments,
}
else
{
- weechat_hashtable_set (server->channel_join_key,
+ weechat_hashtable_set (server->join_channel_key,
pos_channel, keys[i]);
}
}
@@ -1980,33 +1992,57 @@ int
irc_command_join (void *data, struct t_gui_buffer *buffer, int argc,
char **argv, char **argv_eol)
{
+ int i, arg_channels, noswitch;
+
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
/* make C compiler happy */
(void) data;
- if (argc > 1)
+ noswitch = 0;
+ arg_channels = 1;
+
+ for (i = 1; i < argc; i++)
{
- if ((argc >= 4) && (weechat_strcasecmp (argv[1], "-server") == 0))
+ if (weechat_strcasecmp (argv[i], "-server") == 0)
{
- ptr_server = irc_server_search (argv[2]);
+ if (argc <= i + 1)
+ {
+ IRC_COMMAND_TOO_FEW_ARGUMENTS((ptr_server) ? ptr_server->buffer : NULL,
+ "join");
+ }
+ ptr_server = irc_server_search (argv[i + 1]);
if (!ptr_server)
return WEECHAT_RC_ERROR;
- irc_command_join_server (ptr_server, argv_eol[3], 1);
+ arg_channels = i + 2;
+ i++;
+ }
+ else if (weechat_strcasecmp (argv[i], "-noswitch") == 0)
+ {
+ noswitch = 1;
+ arg_channels = i + 1;
}
else
{
- IRC_COMMAND_CHECK_SERVER("join", 1);
- irc_command_join_server (ptr_server, argv_eol[1], 1);
+ arg_channels = i;
+ break;
}
}
+
+ IRC_COMMAND_CHECK_SERVER("join", 1);
+
+ if (arg_channels < argc)
+ {
+ irc_command_join_server (ptr_server, argv_eol[arg_channels],
+ 1, noswitch);
+ }
else
{
- IRC_COMMAND_CHECK_SERVER("join", 1);
if (ptr_channel && (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
&& !ptr_channel->nicks)
{
- irc_command_join_server (ptr_server, ptr_channel->name, 1);
+ irc_command_join_server (ptr_server, ptr_channel->name,
+ 1, noswitch);
}
else
{
@@ -5121,18 +5157,20 @@ irc_command_init ()
"%(nicks)|%*", &irc_command_ison, NULL);
weechat_hook_command ("join",
N_("join a channel"),
- N_("[-server <server>] [<channel1>[,<channel2>...]] "
- "[<key1>[,<key2>...]]"),
- N_(" server: send to this server (internal name)\n"
- "channel: channel name to join\n"
- " key: key to join the channel (channels with "
+ N_("[-noswitch] [-server <server>] "
+ "[<channel1>[,<channel2>...]] [<key1>[,<key2>...]]"),
+ N_("-noswitch: do not switch to new buffer\n"
+ " server: send to this server (internal name)\n"
+ " channel: channel name to join\n"
+ " key: key to join the channel (channels with "
"a key must be the first in list)\n\n"
"Examples:\n"
" /join #weechat\n"
" /join #protectedchan,#weechat key\n"
- " /join -server freenode #weechat"),
- "-server %(irc_servers)"
- " || %(irc_channels)", &irc_command_join, NULL);
+ " /join -server freenode #weechat\n"
+ " /join -noswitch #weechat"),
+ "%(irc_channels)|-noswitch|-server|%(irc_servers)|%*",
+ &irc_command_join, NULL);
weechat_hook_command ("kick",
N_("forcibly remove a user from a channel"),
N_("[<channel>] <nick> [<reason>]"),
diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h
index 6938c0260..b3db40617 100644
--- a/src/plugins/irc/irc-command.h
+++ b/src/plugins/irc/irc-command.h
@@ -55,7 +55,8 @@ extern void irc_command_away_server (struct t_irc_server *server,
int reset_unread_marker);
extern void irc_command_join_server (struct t_irc_server *server,
const char *arguments,
- int manual_join);
+ int manual_join,
+ int noswitch);
extern void irc_command_mode_server (struct t_irc_server *server,
struct t_irc_channel *channel,
const char *arguments,
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index aeb82785a..40faffcf3 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -1343,14 +1343,14 @@ IRC_PROTOCOL_CALLBACK(part)
snprintf (join_string, join_length, "%s %s",
ptr_channel->name,
ptr_channel->key);
- irc_command_join_server (server, join_string, 1);
+ irc_command_join_server (server, join_string, 1, 1);
free (join_string);
}
else
- irc_command_join_server (server, ptr_channel->name, 1);
+ irc_command_join_server (server, ptr_channel->name, 1, 1);
}
else
- irc_command_join_server (server, ptr_channel->name, 1);
+ irc_command_join_server (server, ptr_channel->name, 1, 1);
}
else
{
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 9388160b2..6c7100fd8 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -106,7 +106,7 @@ char *irc_server_chanmodes_default = "beI,k,l";
const char *irc_server_send_default_tags = NULL; /* default tags when */
/* sending a message */
-time_t irc_server_last_check_manual_joins = 0;
+time_t irc_server_last_check_join_channels = 0;
void irc_server_reconnect (struct t_irc_server *server);
@@ -912,16 +912,21 @@ irc_server_alloc (const char *name)
new_server->last_redirect = NULL;
new_server->notify_list = NULL;
new_server->last_notify = NULL;
- new_server->manual_joins = weechat_hashtable_new (4,
- WEECHAT_HASHTABLE_STRING,
- WEECHAT_HASHTABLE_INTEGER,
- NULL,
- NULL);
- new_server->channel_join_key = weechat_hashtable_new (4,
+ new_server->join_manual = weechat_hashtable_new (4,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_INTEGER,
+ NULL,
+ NULL);
+ new_server->join_channel_key = weechat_hashtable_new (4,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_STRING,
NULL,
NULL);
+ new_server->join_noswitch = weechat_hashtable_new (4,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING,
+ NULL,
+ NULL);
new_server->buffer = NULL;
new_server->buffer_as_string = NULL;
new_server->channels = NULL;
@@ -1368,8 +1373,9 @@ irc_server_free_data (struct t_irc_server *server)
irc_server_outqueue_free_all (server, i);
}
irc_notify_free_all (server);
- weechat_hashtable_free (server->manual_joins);
- weechat_hashtable_free (server->channel_join_key);
+ weechat_hashtable_free (server->join_manual);
+ weechat_hashtable_free (server->join_channel_key);
+ weechat_hashtable_free (server->join_noswitch);
irc_redirect_free_all (server);
if (server->channels)
irc_channel_free_all (server);
@@ -2605,21 +2611,41 @@ irc_server_timer_sasl_cb (void *data, int remaining_calls)
}
/*
- * irc_server_check_manual_joins_cb: callback called for each manual join of a
- * server, it will delete old channels in
- * this hashtable
+ * irc_server_check_join_manual_cb: callback called for each manual join of a
+ * server, it will delete old channels in
+ * this hashtable
*/
void
-irc_server_check_manual_joins_cb (void *data, struct t_hashtable *hashtable,
- const void *key, const void *value)
+irc_server_check_join_manual_cb (void *data, struct t_hashtable *hashtable,
+ const void *key, const void *value)
{
struct t_irc_server *server;
server = (struct t_irc_server *)data;
if (server)
{
- if (*((int *)value) + 60 < time (NULL))
+ if (*((int *)value) + (60 * 5) < time (NULL))
+ weechat_hashtable_remove (hashtable, key);
+ }
+}
+
+/*
+ * irc_server_check_join_noswitch_cb: callback called for each join without
+ * switch of a server, it will delete old
+ * channels in this hashtable
+ */
+
+void
+irc_server_check_join_noswitch_cb (void *data, struct t_hashtable *hashtable,
+ const void *key, const void *value)
+{
+ struct t_irc_server *server;
+
+ server = (struct t_irc_server *)data;
+ if (server)
+ {
+ if (*((int *)value) + (60 * 5) < time (NULL))
weechat_hashtable_remove (hashtable, key);
}
}
@@ -2738,12 +2764,19 @@ irc_server_timer_cb (void *data, int remaining_calls)
ptr_redirect = ptr_next_redirect;
}
- /* remove old channels in "manual_joins" (each 60 seconds) */
- if (current_time > irc_server_last_check_manual_joins + 60)
+ /*
+ * remove old channels in "join_manual" and "join_noswitch"
+ * (every 5 minutes)
+ */
+ if (current_time > irc_server_last_check_join_channels + (60 * 5))
{
- weechat_hashtable_map (ptr_server->manual_joins,
- &irc_server_check_manual_joins_cb,
+ weechat_hashtable_map (ptr_server->join_manual,
+ &irc_server_check_join_manual_cb,
ptr_server);
+ weechat_hashtable_map (ptr_server->join_noswitch,
+ &irc_server_check_join_noswitch_cb,
+ ptr_server);
+ irc_server_last_check_join_channels = current_time;
}
}
}
@@ -2822,10 +2855,13 @@ irc_server_close_connection (struct t_irc_server *server)
irc_redirect_free_all (server);
/* remove all manual joins */
- weechat_hashtable_remove_all (server->manual_joins);
+ weechat_hashtable_remove_all (server->join_manual);
/* remove all keys for pending joins */
- weechat_hashtable_remove_all (server->channel_join_key);
+ weechat_hashtable_remove_all (server->join_channel_key);
+
+ /* remove all keys for joins without switch */
+ weechat_hashtable_remove_all (server->join_noswitch);
/* server is now disconnected */
server->is_connected = 0;
@@ -4030,7 +4066,7 @@ irc_server_autojoin_channels (struct t_irc_server *server)
/* auto-join when connecting to server for first time */
autojoin = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_AUTOJOIN);
if (!server->disable_autojoin && autojoin && autojoin[0])
- irc_command_join_server (server, autojoin, 0);
+ irc_command_join_server (server, autojoin, 0, 0);
}
server->disable_autojoin = 0;
@@ -4460,8 +4496,9 @@ irc_server_hdata_server_cb (void *data, const char *hdata_name)
WEECHAT_HDATA_VAR(struct t_irc_server, last_redirect, POINTER, 0, NULL, "irc_redirect");
WEECHAT_HDATA_VAR(struct t_irc_server, notify_list, POINTER, 0, NULL, "irc_notify");
WEECHAT_HDATA_VAR(struct t_irc_server, last_notify, POINTER, 0, NULL, "irc_notify");
- WEECHAT_HDATA_VAR(struct t_irc_server, manual_joins, HASHTABLE, 0, NULL, NULL);
- WEECHAT_HDATA_VAR(struct t_irc_server, channel_join_key, HASHTABLE, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, join_manual, HASHTABLE, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, join_channel_key, HASHTABLE, 0, NULL, NULL);
+ WEECHAT_HDATA_VAR(struct t_irc_server, join_noswitch, HASHTABLE, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, buffer, POINTER, 0, NULL, "buffer");
WEECHAT_HDATA_VAR(struct t_irc_server, buffer_as_string, STRING, 0, NULL, NULL);
WEECHAT_HDATA_VAR(struct t_irc_server, channels, POINTER, 0, NULL, "irc_channel");
@@ -4982,12 +5019,15 @@ irc_server_print_log ()
weechat_log_printf (" last_redirect. . . . : 0x%lx", ptr_server->last_redirect);
weechat_log_printf (" notify_list. . . . . : 0x%lx", ptr_server->notify_list);
weechat_log_printf (" last_notify. . . . . : 0x%lx", ptr_server->last_notify);
- weechat_log_printf (" manual_joins . . . . : 0x%lx (hashtable: '%s')",
- ptr_server->manual_joins,
- weechat_hashtable_get_string (ptr_server->manual_joins, "keys_values"));
- weechat_log_printf (" channel_join_key . . : 0x%lx (hashtable: '%s')",
- ptr_server->channel_join_key,
- weechat_hashtable_get_string (ptr_server->channel_join_key, "keys_values"));
+ weechat_log_printf (" join_manual. . . . . : 0x%lx (hashtable: '%s')",
+ ptr_server->join_manual,
+ weechat_hashtable_get_string (ptr_server->join_manual, "keys_values"));
+ weechat_log_printf (" join_channel_key . . : 0x%lx (hashtable: '%s')",
+ ptr_server->join_channel_key,
+ weechat_hashtable_get_string (ptr_server->join_channel_key, "keys_values"));
+ weechat_log_printf (" join_noswitch. . . . : 0x%lx (hashtable: '%s')",
+ ptr_server->join_noswitch,
+ weechat_hashtable_get_string (ptr_server->join_noswitch, "keys_values"));
weechat_log_printf (" buffer . . . . . . . : 0x%lx", ptr_server->buffer);
weechat_log_printf (" buffer_as_string . . : 0x%lx", ptr_server->buffer_as_string);
weechat_log_printf (" channels . . . . . . : 0x%lx", ptr_server->channels);
diff --git a/src/plugins/irc/irc-server.h b/src/plugins/irc/irc-server.h
index 6473d4d7a..ea2dd8b4d 100644
--- a/src/plugins/irc/irc-server.h
+++ b/src/plugins/irc/irc-server.h
@@ -197,8 +197,9 @@ struct t_irc_server
struct t_irc_redirect *last_redirect; /* last command redirection */
struct t_irc_notify *notify_list; /* list of notify */
struct t_irc_notify *last_notify; /* last notify */
- struct t_hashtable *manual_joins; /* manual joins pending */
- struct t_hashtable *channel_join_key; /* keys pending for joins */
+ struct t_hashtable *join_manual; /* manual joins pending */
+ struct t_hashtable *join_channel_key; /* keys pending for joins */
+ struct t_hashtable *join_noswitch; /* joins w/o switch to buffer */
struct t_gui_buffer *buffer; /* GUI buffer allocated for server */
char *buffer_as_string; /* used to return buffer info */
struct t_irc_channel *channels; /* opened channels on server */