summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.asciidoc1
-rw-r--r--ReleaseNotes.asciidoc12
-rw-r--r--doc/de/autogen/user/irc_options.txt5
-rw-r--r--doc/en/autogen/user/irc_options.txt5
-rw-r--r--doc/fr/autogen/user/irc_options.txt5
-rw-r--r--doc/it/autogen/user/irc_options.txt5
-rw-r--r--doc/ja/autogen/user/irc_options.txt5
-rw-r--r--doc/pl/autogen/user/irc_options.txt5
-rw-r--r--po/cs.po8
-rw-r--r--po/de.po8
-rw-r--r--po/es.po8
-rw-r--r--po/fr.po14
-rw-r--r--po/hu.po8
-rw-r--r--po/it.po8
-rw-r--r--po/ja.po30
-rw-r--r--po/pl.po8
-rw-r--r--po/pt_BR.po8
-rw-r--r--po/ru.po8
-rw-r--r--po/tr.po8
-rw-r--r--po/weechat.pot8
-rw-r--r--src/plugins/irc/irc-channel.c33
-rw-r--r--src/plugins/irc/irc-channel.h2
-rw-r--r--src/plugins/irc/irc-command.c11
-rw-r--r--src/plugins/irc/irc-config.c10
-rw-r--r--src/plugins/irc/irc-config.h1
25 files changed, 192 insertions, 32 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc
index 90e8bd1a1..9440d4e68 100644
--- a/ChangeLog.asciidoc
+++ b/ChangeLog.asciidoc
@@ -97,6 +97,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* alias: change default command for alias /beep to "/print -beep"
* exec: add exec plugin: new command /exec and file exec.conf
* guile: fix module used after unload of a script
+* irc: add option irc.look.join_auto_add_chantype (closes #65)
* irc: add alias "whois" for target buffer of messages 401/402 (closes #54)
* irc: add tag with host ("host_xxx") in IRC messages displayed (task #12018)
* irc: allow many fingerprints in server option ssl_fingerprint (closes #49)
diff --git a/ReleaseNotes.asciidoc b/ReleaseNotes.asciidoc
index cee6c3be9..4daf00f9f 100644
--- a/ReleaseNotes.asciidoc
+++ b/ReleaseNotes.asciidoc
@@ -17,6 +17,18 @@ http://weechat.org/files/changelog/ChangeLog-devel.html[ChangeLog]
== Version 1.0 (under dev)
+=== Channel type not added by default on /join
+
+The channel type is not any more automatically added to a channel name on join
+(for example `/join weechat` will not send `/join #weechat`).
+
+If you are lazy and want to automatically add the channel type, you can turn on
+the new option:
+
+----
+/set irc.look.join_auto_add_chantype on
+----
+
=== Hide IRC channel modes arguments
The option 'irc.look.item_channel_modes_hide_key' has been renamed to
diff --git a/doc/de/autogen/user/irc_options.txt b/doc/de/autogen/user/irc_options.txt
index 06c78d586..544431f7d 100644
--- a/doc/de/autogen/user/irc_options.txt
+++ b/doc/de/autogen/user/irc_options.txt
@@ -203,6 +203,11 @@
** Typ: boolesch
** Werte: on, off (Standardwert: `on`)
+* [[option_irc.look.join_auto_add_chantype]] *irc.look.join_auto_add_chantype*
+** Beschreibung: `automatically add channel type in front of channel name on command /join if the channel name does not start with a valid channel type for the server; for example: "/join weechat" will in fact send: "/join #weechat"`
+** Typ: boolesch
+** Werte: on, off (Standardwert: `off`)
+
* [[option_irc.look.msgbuffer_fallback]] *irc.look.msgbuffer_fallback*
** Beschreibung: `Standardbuffer der für Ausgaben genutzt werden soll, falls ein privater Buffer nicht gefunden wird`
** Typ: integer
diff --git a/doc/en/autogen/user/irc_options.txt b/doc/en/autogen/user/irc_options.txt
index 023e361c9..1177dd409 100644
--- a/doc/en/autogen/user/irc_options.txt
+++ b/doc/en/autogen/user/irc_options.txt
@@ -203,6 +203,11 @@
** type: boolean
** values: on, off (default value: `on`)
+* [[option_irc.look.join_auto_add_chantype]] *irc.look.join_auto_add_chantype*
+** description: `automatically add channel type in front of channel name on command /join if the channel name does not start with a valid channel type for the server; for example: "/join weechat" will in fact send: "/join #weechat"`
+** type: boolean
+** values: on, off (default value: `off`)
+
* [[option_irc.look.msgbuffer_fallback]] *irc.look.msgbuffer_fallback*
** description: `default target buffer for msgbuffer options when target is private and that private buffer is not found`
** type: integer
diff --git a/doc/fr/autogen/user/irc_options.txt b/doc/fr/autogen/user/irc_options.txt
index fb006dfcb..900d3f625 100644
--- a/doc/fr/autogen/user/irc_options.txt
+++ b/doc/fr/autogen/user/irc_options.txt
@@ -203,6 +203,11 @@
** type: booléen
** valeurs: on, off (valeur par défaut: `on`)
+* [[option_irc.look.join_auto_add_chantype]] *irc.look.join_auto_add_chantype*
+** description: `ajouter automatiquement le type de canal devant le nom du canal sur la commande /join si le nom du canal ne commence pas par un type de canal valide pour le serveur ; par exemple "/join weechat" enverra en fait : "/join #weechat"`
+** type: booléen
+** valeurs: on, off (valeur par défaut: `off`)
+
* [[option_irc.look.msgbuffer_fallback]] *irc.look.msgbuffer_fallback*
** description: `tampon cible par défaut pour les options msgbuffer quand la cible est "private" et que le tampon privé n'est pas trouvé`
** type: entier
diff --git a/doc/it/autogen/user/irc_options.txt b/doc/it/autogen/user/irc_options.txt
index 04cc0cf81..df3ce3a16 100644
--- a/doc/it/autogen/user/irc_options.txt
+++ b/doc/it/autogen/user/irc_options.txt
@@ -203,6 +203,11 @@
** tipo: bool
** valori: on, off (valore predefinito: `on`)
+* [[option_irc.look.join_auto_add_chantype]] *irc.look.join_auto_add_chantype*
+** descrizione: `automatically add channel type in front of channel name on command /join if the channel name does not start with a valid channel type for the server; for example: "/join weechat" will in fact send: "/join #weechat"`
+** tipo: bool
+** valori: on, off (valore predefinito: `off`)
+
* [[option_irc.look.msgbuffer_fallback]] *irc.look.msgbuffer_fallback*
** descrizione: `buffer di destinazione predefinito per le opzioni di msgbuffer quando la destinazione è privata ed il buffer privato non viene trovato`
** tipo: intero
diff --git a/doc/ja/autogen/user/irc_options.txt b/doc/ja/autogen/user/irc_options.txt
index d4993b95d..7713fc296 100644
--- a/doc/ja/autogen/user/irc_options.txt
+++ b/doc/ja/autogen/user/irc_options.txt
@@ -203,6 +203,11 @@
** タイプ: ブール
** 値: on, off (デフォルト値: `on`)
+* [[option_irc.look.join_auto_add_chantype]] *irc.look.join_auto_add_chantype*
+** 説明: `automatically add channel type in front of channel name on command /join if the channel name does not start with a valid channel type for the server; for example: "/join weechat" will in fact send: "/join #weechat"`
+** タイプ: ブール
+** 値: on, off (デフォルト値: `off`)
+
* [[option_irc.look.msgbuffer_fallback]] *irc.look.msgbuffer_fallback*
** 説明: `ターゲットがプライベートでプライベートバッファが見つからない場合の msgbuffer オプション用のデフォルトのターゲットバッファ`
** タイプ: 整数
diff --git a/doc/pl/autogen/user/irc_options.txt b/doc/pl/autogen/user/irc_options.txt
index 918cbe814..93e6f2ba1 100644
--- a/doc/pl/autogen/user/irc_options.txt
+++ b/doc/pl/autogen/user/irc_options.txt
@@ -203,6 +203,11 @@
** typ: bool
** wartości: on, off (domyślna wartość: `on`)
+* [[option_irc.look.join_auto_add_chantype]] *irc.look.join_auto_add_chantype*
+** opis: `automatically add channel type in front of channel name on command /join if the channel name does not start with a valid channel type for the server; for example: "/join weechat" will in fact send: "/join #weechat"`
+** typ: bool
+** wartości: on, off (domyślna wartość: `off`)
+
* [[option_irc.look.msgbuffer_fallback]] *irc.look.msgbuffer_fallback*
** opis: `domyślny bufor docelowy dla bufora wiadomości, kiedy cel jest prywatny i nie odnaleziono tego prywatnego bufora`
** typ: liczba
diff --git a/po/cs.po b/po/cs.po
index ab6063652..18d28d465 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6826,6 +6826,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "zobrazovat předponu přezdívky v položce pole \"input_prompt\""
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/de.po b/po/de.po
index b7392d78c..c46ca6bb1 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-21 09:42+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -7805,6 +7805,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "der Nick-Präfix wird im Bar-Item \"input_prompt\" angezeigt"
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/es.po b/po/es.po
index 4437b3ea4..5e45bae8b 100644
--- a/po/es.po
+++ b/po/es.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7098,6 +7098,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "mostrar el prefijo del apodo en el elemento de barra \"input_prompt\""
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/fr.po b/po/fr.po
index e69f9f90d..eeb6280fe 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
-"PO-Revision-Date: 2014-04-19 15:49+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
+"PO-Revision-Date: 2014-05-06 21:18+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -7628,6 +7628,16 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "afficher le préfixe du pseudo dans l'objet de barre \"input_prompt\""
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+"ajouter automatiquement le type de canal devant le nom du canal sur la "
+"commande /join si le nom du canal ne commence pas par un type de canal "
+"valide pour le serveur ; par exemple \"/join weechat\" enverra en fait : \"/"
+"join #weechat\""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/hu.po b/po/hu.po
index 991cb581e..5e3fdca2c 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6320,6 +6320,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "névkiegészítés után beszúrt szöveg"
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/it.po b/po/it.po
index d243d6c08..d75402d4f 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7253,6 +7253,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "visualizza il prefisso del nick nell'elemento barra \"input_prompt\""
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/ja.po b/po/ja.po
index c5ec10949..5079191b9 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-21 00:44+0900\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n"
@@ -40,11 +40,11 @@ msgid "max chars"
msgstr "最大文字数"
msgid ""
-"a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)"
-"green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal "
-"color number or an alias; attributes are allowed before color (for text "
-"color only, not background): \"*\" for bold, \"!\" for reverse, \"/\" for "
-"italic, \"_\" for underline"
+"a WeeChat color name (default, black, (dark)gray, white, (light)red, "
+"(light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a "
+"terminal color number or an alias; attributes are allowed before color (for "
+"text color only, not background): \"*\" for bold, \"!\" for reverse, \"/\" "
+"for italic, \"_\" for underline"
msgstr ""
"WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、"
"brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号ま"
@@ -5799,8 +5799,8 @@ msgstr ""
" - 内部サーバ名 (/server add で作成されたもの、利用推奨)\n"
" - ホスト名/ポート番号、又は IP アドレス/ポート番号 (これは一時的"
"サーバを作る)、デフォルトのポート番号は 6667\n"
-" - 次のフォーマットに従う URL: irc[6][s]://[nickname[:password]@]"
-"irc.example.org[:port][/#channel1][,#channel2[...]]\n"
+" - 次のフォーマットに従う URL: irc[6][s]://[nickname[:"
+"password]@]irc.example.org[:port][/#channel1][,#channel2[...]]\n"
" option: サーバに関するオプション (ブール型オプションでは、value は無視さ"
"れる)\n"
" nooption: ブール型オプションを 'off' にする (例: -nossl)\n"
@@ -7321,6 +7321,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "\"input_prompt\" バーアイテムではニックネームプレフィックスを表示"
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
@@ -10659,8 +10665,8 @@ msgid ""
"Examples (you can also look at default triggers with /trigger listdefault):\n"
" add text attributes *bold*, _underline_ and /italic/ (only in user "
"messages):\n"
-" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==\\*"
-"(\\S+)\\*==*${color:bold}$1${color:-bold}*== ==_(\\S+)_==_${color:"
+" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"=="
+"\\*(\\S+)\\*==*${color:bold}$1${color:-bold}*== ==_(\\S+)_==_${color:"
"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-"
"italic}/\"\n"
" hide nicklist bar on small terminals:\n"
@@ -10734,8 +10740,8 @@ msgstr ""
"\n"
"例 (/trigger listdefault でデフォルトトリガを見ることができます):\n"
" テキスト属性 *太字*、_下線_、/イタリック/ を追加 (ユーザメッセージのみ):\n"
-" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"==\\*"
-"(\\S+)\\*==*${color:bold}$1${color:-bold}*== ==_(\\S+)_==_${color:"
+" /trigger add effects modifier weechat_print \"${tg_tag_nick}\" \"=="
+"\\*(\\S+)\\*==*${color:bold}$1${color:-bold}*== ==_(\\S+)_==_${color:"
"underline}$1${color:-underline}_== ==/(\\S+)/==/${color:italic}$1${color:-"
"italic}/\"\n"
" 狭い端末ではニックネームリストバーを隠す:\n"
diff --git a/po/pl.po b/po/pl.po
index 2b6833560..5462a0d3e 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-19 13:08+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7408,6 +7408,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "wyświetl przedrostek nicka w elemencie paska \"input_prompt\""
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 1fee1851f..a372bc557 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6568,6 +6568,12 @@ msgstr ""
"cor para o sufixo do apelido (string exibida depois do apelido no prefixo)"
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/ru.po b/po/ru.po
index e020f252b..e5dabfe04 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-04-05 16:12+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6342,6 +6342,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "строка, вставляемая после автодополнения ника"
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/tr.po b/po/tr.po
index 5a446acdc..3feefd465 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2014-03-24 14:23+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5635,6 +5635,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr "sohbet penceresindeki rumuzlar için metin rengi"
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index 512ef883f..022ab828c 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.1-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2014-04-19 15:48+0200\n"
+"POT-Creation-Date: 2014-05-06 21:17+0200\n"
"PO-Revision-Date: 2013-02-14 18:20+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -5579,6 +5579,12 @@ msgid "display nick prefix in bar item \"input_prompt\""
msgstr ""
msgid ""
+"automatically add channel type in front of channel name on command /join if "
+"the channel name does not start with a valid channel type for the server; "
+"for example: \"/join weechat\" will in fact send: \"/join #weechat\""
+msgstr ""
+
+msgid ""
"default target buffer for msgbuffer options when target is private and that "
"private buffer is not found"
msgstr ""
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index 9dbf3b794..739e7cc80 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -464,6 +464,39 @@ irc_channel_is_channel (struct t_irc_server *server, const char *string)
}
/*
+ * Returns a string with a channel type to add in front of a channel name,
+ * if it doesn't have a valid channel type for the given server.
+ *
+ * It returns an empty string if the channel already has a valid channel type,
+ * or if the option irc.look.join_auto_add_chantype is off.
+ */
+
+const char *
+irc_channel_get_auto_chantype (struct t_irc_server *server,
+ const char *channel_name)
+{
+ static char chantype[2];
+
+ chantype[0] = '\0';
+ chantype[1] = '\0';
+
+ if (weechat_config_boolean (irc_config_look_join_auto_add_chantype)
+ && !irc_channel_is_channel (server, channel_name)
+ && server->chantypes
+ && server->chantypes[0])
+ {
+ /*
+ * use '#' if it's in chantypes (anywhere in the string), because it is
+ * the most common channel type, and fallback on first channel type
+ */
+ chantype[0] = (strchr (server->chantypes, '#')) ?
+ '#' : server->chantypes[0];
+ }
+
+ return chantype;
+}
+
+/*
* Removes away for all nicks on a channel.
*/
diff --git a/src/plugins/irc/irc-channel.h b/src/plugins/irc/irc-channel.h
index f7b4314d9..65d319320 100644
--- a/src/plugins/irc/irc-channel.h
+++ b/src/plugins/irc/irc-channel.h
@@ -96,6 +96,8 @@ extern struct t_irc_channel *irc_channel_search (struct t_irc_server *server,
const char *channel_name);
extern int irc_channel_is_channel (struct t_irc_server *server,
const char *string);
+extern const char *irc_channel_get_auto_chantype (struct t_irc_server *server,
+ const char *channel_name);
extern void irc_channel_remove_away (struct t_irc_server *server,
struct t_irc_channel *channel);
extern void irc_channel_check_away (struct t_irc_server *server,
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index b56371486..21870de3e 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -2224,9 +2224,6 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments,
free (new_args);
}
- /*
- * add "#" in front of each channel if no prefix is given
- */
if (channels)
{
length = strlen (arguments) + num_channels + 1;
@@ -2236,7 +2233,7 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments,
if (manual_join)
{
snprintf (new_args, length, "%s%s",
- (irc_channel_is_channel (server, channels[0])) ? "" : "#",
+ irc_channel_get_auto_chantype (server, channels[0]),
channels[0]);
ptr_channel = irc_channel_search (server, new_args);
if (ptr_channel)
@@ -2255,10 +2252,8 @@ irc_command_join_server (struct t_irc_server *server, const char *arguments,
if (i > 0)
strcat (new_args, ",");
pos_channel = new_args + strlen (new_args);
- if (!irc_channel_is_channel (server, channels[i]))
- {
- strcat (new_args, "#");
- }
+ strcat (new_args,
+ irc_channel_get_auto_chantype (server, channels[i]));
strcat (new_args, channels[i]);
if (manual_join || noswitch)
{
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index b73f9981c..1d7ad9cfd 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -75,6 +75,7 @@ struct t_config_option *irc_config_look_item_channel_modes_hide_args;
struct t_config_option *irc_config_look_item_display_server;
struct t_config_option *irc_config_look_item_nick_modes;
struct t_config_option *irc_config_look_item_nick_prefix;
+struct t_config_option *irc_config_look_join_auto_add_chantype;
struct t_config_option *irc_config_look_msgbuffer_fallback;
struct t_config_option *irc_config_look_new_channel_position;
struct t_config_option *irc_config_look_new_pv_position;
@@ -2443,6 +2444,15 @@ irc_config_init ()
N_("display nick prefix in bar item \"input_prompt\""),
NULL, 0, 0, "on", NULL, 0, NULL, NULL,
&irc_config_change_bar_item_input_prompt, NULL, NULL, NULL);
+ irc_config_look_join_auto_add_chantype = weechat_config_new_option (
+ irc_config_file, ptr_section,
+ "join_auto_add_chantype", "boolean",
+ N_("automatically add channel type in front of channel name on "
+ "command /join if the channel name does not start with a valid "
+ "channel type for the server; for example: \"/join weechat\" will "
+ "in fact send: \"/join #weechat\""),
+ NULL, 0, 0, "off", NULL, 0, NULL, NULL,
+ NULL, NULL, NULL, NULL);
irc_config_look_msgbuffer_fallback = weechat_config_new_option (
irc_config_file, ptr_section,
"msgbuffer_fallback", "integer",
diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h
index 5e2bebfc0..7da924010 100644
--- a/src/plugins/irc/irc-config.h
+++ b/src/plugins/irc/irc-config.h
@@ -123,6 +123,7 @@ extern struct t_config_option *irc_config_look_item_channel_modes_hide_args;
extern struct t_config_option *irc_config_look_item_display_server;
extern struct t_config_option *irc_config_look_item_nick_modes;
extern struct t_config_option *irc_config_look_item_nick_prefix;
+extern struct t_config_option *irc_config_look_join_auto_add_chantype;
extern struct t_config_option *irc_config_look_msgbuffer_fallback;
extern struct t_config_option *irc_config_look_new_channel_position;
extern struct t_config_option *irc_config_look_new_pv_position;