diff options
-rw-r--r-- | ChangeLog.asciidoc | 1 | ||||
-rw-r--r-- | doc/de/autogen/user/irc_commands.asciidoc | 2 | ||||
-rw-r--r-- | doc/en/autogen/user/irc_commands.asciidoc | 2 | ||||
-rw-r--r-- | doc/fr/autogen/user/irc_commands.asciidoc | 2 | ||||
-rw-r--r-- | doc/it/autogen/user/irc_commands.asciidoc | 2 | ||||
-rw-r--r-- | doc/ja/autogen/user/irc_commands.asciidoc | 2 | ||||
-rw-r--r-- | doc/pl/autogen/user/irc_commands.asciidoc | 2 | ||||
-rw-r--r-- | po/cs.po | 5 | ||||
-rw-r--r-- | po/de.po | 5 | ||||
-rw-r--r-- | po/es.po | 5 | ||||
-rw-r--r-- | po/fr.po | 8 | ||||
-rw-r--r-- | po/hu.po | 4 | ||||
-rw-r--r-- | po/it.po | 5 | ||||
-rw-r--r-- | po/ja.po | 5 | ||||
-rw-r--r-- | po/pl.po | 5 | ||||
-rw-r--r-- | po/pt_BR.po | 5 | ||||
-rw-r--r-- | po/ru.po | 4 | ||||
-rw-r--r-- | po/tr.po | 5 | ||||
-rw-r--r-- | po/weechat.pot | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-command.c | 72 | ||||
-rw-r--r-- | src/plugins/irc/irc-command.h | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 2 |
22 files changed, 100 insertions, 48 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 4f88fc20d..c92abbb60 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -26,6 +26,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * api: add regex replace feature in function string_eval_expression * api: use microseconds instead of milliseconds in functions util_timeval_diff and util_timeval_add +* irc: automatically add current channel in command /samode (closes #241) * irc: display own nick changes in server buffer (closes #188) * irc: disable creation of temporary servers by default with command /connect, new option irc.look.temporary_servers diff --git a/doc/de/autogen/user/irc_commands.asciidoc b/doc/de/autogen/user/irc_commands.asciidoc index 86b05cc6c..de5b99534 100644 --- a/doc/de/autogen/user/irc_commands.asciidoc +++ b/doc/de/autogen/user/irc_commands.asciidoc @@ -632,7 +632,7 @@ channel: Name des Channels [command]*`samode`* ändert den Modus des Channels ohne das Operator-Privilegien vorliegen:: ---- -/samode <channel> <mode> +/samode [<channel>] <mode> Channel: Name des Channel Mode: neuer Modus für Channel diff --git a/doc/en/autogen/user/irc_commands.asciidoc b/doc/en/autogen/user/irc_commands.asciidoc index 804ac5fab..2c5e91026 100644 --- a/doc/en/autogen/user/irc_commands.asciidoc +++ b/doc/en/autogen/user/irc_commands.asciidoc @@ -632,7 +632,7 @@ channel: channel name [command]*`samode`* change mode on channel, without having operator status:: ---- -/samode <channel> <mode> +/samode [<channel>] <mode> channel: channel name mode: mode for channel diff --git a/doc/fr/autogen/user/irc_commands.asciidoc b/doc/fr/autogen/user/irc_commands.asciidoc index 08191c491..45d1512ea 100644 --- a/doc/fr/autogen/user/irc_commands.asciidoc +++ b/doc/fr/autogen/user/irc_commands.asciidoc @@ -632,7 +632,7 @@ pseudo : pseudo [command]*`samode`* changer le mode du canal, sans avoir le statut d'opérateur:: ---- -/samode <canal> <mode> +/samode [<canal>] <mode> canal : nom du canal mode : mode pour le canal diff --git a/doc/it/autogen/user/irc_commands.asciidoc b/doc/it/autogen/user/irc_commands.asciidoc index f78faae7a..6e7837b30 100644 --- a/doc/it/autogen/user/irc_commands.asciidoc +++ b/doc/it/autogen/user/irc_commands.asciidoc @@ -632,7 +632,7 @@ canale: nome del canale [command]*`samode`* cambia modalità sul canale, senza avere lo status di operatore:: ---- -/samode <canale> <modalità> +/samode [<channel>] <mode> canale: nome del canale modalità: modalità per il canale diff --git a/doc/ja/autogen/user/irc_commands.asciidoc b/doc/ja/autogen/user/irc_commands.asciidoc index 8a3469373..2db5f664d 100644 --- a/doc/ja/autogen/user/irc_commands.asciidoc +++ b/doc/ja/autogen/user/irc_commands.asciidoc @@ -632,7 +632,7 @@ channel: チャンネル名 [command]*`samode`* チャンネルモードを変更、オペレータ権無しに:: ---- -/samode <channel> <mode> +/samode [<channel>] <mode> channel: チャンネル名 mode: チャンネルモード diff --git a/doc/pl/autogen/user/irc_commands.asciidoc b/doc/pl/autogen/user/irc_commands.asciidoc index 9a3e84b05..740b8cb12 100644 --- a/doc/pl/autogen/user/irc_commands.asciidoc +++ b/doc/pl/autogen/user/irc_commands.asciidoc @@ -632,7 +632,7 @@ kanał: nazwa kanału [command]*`samode`* zmienia atrybuty kanału, bez posiadania statusu operatora:: ---- -/samode <kanał> <atrybuty> +/samode [<channel>] <mode> kanał: nazwa kanału atrybuty: atrybuty kanału @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6151,7 +6151,8 @@ msgstr "<přezdívka> <kanál>[,<kanál>...]" msgid "change mode on channel, without having operator status" msgstr "změnit mód kanálu, bez nutnosti mít operátorské oprávnění" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<kanál> <mód>" msgid "" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-10-25 08:36+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <weechatter@arcor.de>\n" @@ -7035,7 +7035,8 @@ msgstr "<nick> <channel>[,<channel>...]" msgid "change mode on channel, without having operator status" msgstr "ändert den Modus des Channels ohne das Operator-Privilegien vorliegen" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<channel> <mode>" msgid "" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6388,7 +6388,8 @@ msgstr "<apodo> <canal>[,<canal>...]" msgid "change mode on channel, without having operator status" msgstr "cambiar el modo del canal, sin tener el estado de operador" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<canal> <modo>" msgid "" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" -"PO-Revision-Date: 2014-10-26 13:09+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" +"PO-Revision-Date: 2014-10-26 19:20+0100\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -6900,8 +6900,8 @@ msgstr "<pseudo> <canal>[,<canal>...]" msgid "change mode on channel, without having operator status" msgstr "changer le mode du canal, sans avoir le statut d'opérateur" -msgid "<channel> <mode>" -msgstr "<canal> <mode>" +msgid "[<channel>] <mode>" +msgstr "[<canal>] <mode>" msgid "" "channel: channel name\n" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5619,7 +5619,7 @@ msgid "change mode on channel, without having operator status" msgstr "" #, fuzzy -msgid "<channel> <mode>" +msgid "[<channel>] <mode>" msgstr "%d szoba" #, fuzzy @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6527,7 +6527,8 @@ msgstr "<nick> <canale>[,<canale>...]" msgid "change mode on channel, without having operator status" msgstr "cambia modalità sul canale, senza avere lo status di operatore" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<canale> <modalità>" msgid "" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-10-25 08:29+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n" @@ -6618,7 +6618,8 @@ msgstr "<nick> <channel>[,<channel>...]" msgid "change mode on channel, without having operator status" msgstr "チャンネルモードを変更、オペレータ権無しに" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<channel> <mode>" msgid "" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-09-14 00:18+0100\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6757,7 +6757,8 @@ msgstr "<nick> <kanał>[,<kanał>...]" msgid "change mode on channel, without having operator status" msgstr "zmienia atrybuty kanału, bez posiadania statusu operatora" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<kanał> <atrybuty>" msgid "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 7b3242e10..3559f85f9 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-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5962,7 +5962,8 @@ msgstr "<apelido> <canal>[,<canal>...]" msgid "change mode on channel, without having operator status" msgstr "alterar modo de canal, sem ter status de operador" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<canal> <modo>" msgid "" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5651,7 +5651,7 @@ msgid "change mode on channel, without having operator status" msgstr "" #, fuzzy -msgid "<channel> <mode>" +msgid "[<channel>] <mode>" msgstr "%d канал" #, fuzzy @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-07-25 07:50+0200\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5050,7 +5050,8 @@ msgstr "<rumuz> <kanal>[,<kanal>...]" msgid "change mode on channel, without having operator status" msgstr "" -msgid "<channel> <mode>" +#, fuzzy +msgid "[<channel>] <mode>" msgstr "<kanal> <kip>" msgid "" diff --git a/po/weechat.pot b/po/weechat.pot index bc2402cb1..e2cd5de9c 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-26 13:07+0100\n" +"POT-Creation-Date: 2014-10-26 19:18+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -5034,7 +5034,7 @@ msgstr "" msgid "change mode on channel, without having operator status" msgstr "" -msgid "<channel> <mode>" +msgid "[<channel>] <mode>" msgstr "" msgid "" diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 1e8a31b6f..4efd80849 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -2822,21 +2822,24 @@ irc_command_me (void *data, struct t_gui_buffer *buffer, int argc, char **argv, void irc_command_mode_server (struct t_irc_server *server, - struct t_irc_channel *channel, const char *arguments, + const char *command, + struct t_irc_channel *channel, + const char *arguments, int flags) { - if (server && (channel || arguments)) + if (server && command && (channel || arguments)) { if (channel && arguments) { irc_server_sendf (server, flags, NULL, - "MODE %s %s", - channel->name, arguments); + "%s %s %s", + command, channel->name, arguments); } else { irc_server_sendf (server, flags, NULL, - "MODE %s", + "%s %s", + command, (channel) ? channel->name : arguments); } } @@ -2870,13 +2873,14 @@ irc_command_mode (void *data, struct t_gui_buffer *buffer, int argc, "mode"); return WEECHAT_RC_OK; } - irc_command_mode_server (ptr_server, ptr_channel, argv_eol[1], + irc_command_mode_server (ptr_server, "MODE", ptr_channel, + argv_eol[1], IRC_SERVER_SEND_OUTQ_PRIO_HIGH); } else { /* user gives channel, use arguments as-is */ - irc_command_mode_server (ptr_server, NULL, argv_eol[1], + irc_command_mode_server (ptr_server, "MODE", NULL, argv_eol[1], IRC_SERVER_SEND_OUTQ_PRIO_HIGH); } } @@ -2884,12 +2888,13 @@ irc_command_mode (void *data, struct t_gui_buffer *buffer, int argc, { if (ptr_channel) { - irc_command_mode_server (ptr_server, ptr_channel, NULL, + irc_command_mode_server (ptr_server, "MODE", ptr_channel, NULL, IRC_SERVER_SEND_OUTQ_PRIO_HIGH); } else { - irc_command_mode_server (ptr_server, NULL, ptr_server->nick, + irc_command_mode_server (ptr_server, "MODE", NULL, + ptr_server->nick, IRC_SERVER_SEND_OUTQ_PRIO_HIGH); } } @@ -4195,11 +4200,48 @@ irc_command_samode (void *data, struct t_gui_buffer *buffer, int argc, /* make C compiler happy */ (void) data; - if (argc < 3) - return WEECHAT_RC_ERROR; - - irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "SAMODE %s %s", argv[1], argv_eol[2]); + if (argc > 1) + { + if ((argv[1][0] == '+') || (argv[1][0] == '-')) + { + /* channel not specified, check we are on channel and use it */ + if (!ptr_channel) + { + weechat_printf (ptr_server->buffer, + _("%s%s: you must specify channel for \"%s\" " + "command if you're not in a channel"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "samode"); + return WEECHAT_RC_OK; + } + irc_command_mode_server (ptr_server, "SAMODE", ptr_channel, + argv_eol[1], + IRC_SERVER_SEND_OUTQ_PRIO_HIGH); + } + else + { + /* user gives channel, use arguments as-is */ + irc_command_mode_server (ptr_server, "SAMODE", NULL, argv_eol[1], + IRC_SERVER_SEND_OUTQ_PRIO_HIGH); + } + } + else + { + if (ptr_channel) + { + irc_command_mode_server (ptr_server, "SAMODE", ptr_channel, NULL, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH); + } + else + { + weechat_printf (ptr_server->buffer, + _("%s%s: you must specify channel for \"%s\" " + "command if you're not in a channel"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, + "samode"); + return WEECHAT_RC_OK; + } + } return WEECHAT_RC_OK; } @@ -6354,7 +6396,7 @@ irc_command_init () weechat_hook_command ( "samode", N_("change mode on channel, without having operator status"), - N_("<channel> <mode>"), + N_("[<channel>] <mode>"), N_("channel: channel name\n" " mode: mode for channel"), "%(irc_server_channels)", &irc_command_samode, NULL); diff --git a/src/plugins/irc/irc-command.h b/src/plugins/irc/irc-command.h index bb5c5342a..6ea8c2f08 100644 --- a/src/plugins/irc/irc-command.h +++ b/src/plugins/irc/irc-command.h @@ -51,6 +51,7 @@ extern void irc_command_join_server (struct t_irc_server *server, int manual_join, int noswitch); extern void irc_command_mode_server (struct t_irc_server *server, + const char *command, struct t_irc_channel *channel, const char *arguments, int flags); diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 3f4037319..707a4fb20 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -4419,7 +4419,7 @@ IRC_PROTOCOL_CALLBACK(366) if (!weechat_hashtable_has_key (ptr_channel->join_msg_received, command)) { - irc_command_mode_server (server, ptr_channel, NULL, + irc_command_mode_server (server, "MODE", ptr_channel, NULL, IRC_SERVER_SEND_OUTQ_PRIO_LOW); irc_channel_check_away (server, ptr_channel); } |