diff options
-rw-r--r-- | ChangeLog.adoc | 2 | ||||
-rw-r--r-- | po/cs.po | 59 | ||||
-rw-r--r-- | po/de.po | 59 | ||||
-rw-r--r-- | po/es.po | 59 | ||||
-rw-r--r-- | po/fr.po | 54 | ||||
-rw-r--r-- | po/hu.po | 57 | ||||
-rw-r--r-- | po/it.po | 59 | ||||
-rw-r--r-- | po/ja.po | 59 | ||||
-rw-r--r-- | po/pl.po | 57 | ||||
-rw-r--r-- | po/pt.po | 57 | ||||
-rw-r--r-- | po/pt_BR.po | 49 | ||||
-rw-r--r-- | po/ru.po | 59 | ||||
-rw-r--r-- | po/sr.po | 57 | ||||
-rw-r--r-- | po/tr.po | 57 | ||||
-rw-r--r-- | po/weechat.pot | 42 | ||||
-rw-r--r-- | src/plugins/alias/alias-config.c | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-command.c | 535 | ||||
-rw-r--r-- | src/plugins/irc/irc-ctcp.c | 99 | ||||
-rw-r--r-- | src/plugins/irc/irc-ctcp.h | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-input.c | 337 | ||||
-rw-r--r-- | src/plugins/irc/irc-input.h | 10 | ||||
-rw-r--r-- | src/plugins/irc/irc-message.c | 41 | ||||
-rw-r--r-- | src/plugins/irc/irc-message.h | 2 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 15 | ||||
-rw-r--r-- | tests/unit/plugins/irc/test-irc-protocol.cpp | 1013 |
25 files changed, 1576 insertions, 1267 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 96fb8d980..c5329a9d4 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -40,7 +40,6 @@ New features:: * api: add optional argument with version in info "version_number" * alias: use lower case for default aliases, rename all aliases to lower case on upgrade (issue #1872) * alias: add `$&` to replace all arguments with double quotes escaped (issue #1140, issue #1190) - * alias: add alias `action` to send a CTCP ACTION to a channel or a nick (issue #1577) * alias: add option `missing` in command `/alias` * irc: rename "ssl" options to "tls", connect with TLS and port 6697 by default * irc: add support of capabilities "batch" and "draft/multiline" (issue #1292, issue #1923) @@ -50,6 +49,7 @@ New features:: * irc: add modifier "irc_cap_sync_req" (issue #1767) * irc: add support of "LINELEN" in message 005 (max message length in bytes) (issue #1927) * irc: add support of "UTF8ONLY" in message 005 (issue #1688) + * irc: add command `/action` (issue #201, issue #1577) * irc: add command `/rules` (issue #1864) * irc: add command `/knock` (issue #7) * irc: add server option "registered_mode", add fields "authentication_method" and "sasl_mechanism_used" in server (issue #1625) @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6707,6 +6707,13 @@ msgid "" "server" msgstr "" +#, c-format +msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: příkaz \"%s\" může být spuštěn pouze v bufferu kanálu nebo soukromého " +"rozhovoru" + #, fuzzy, c-format msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " @@ -6777,13 +6784,6 @@ msgid "" msgstr "" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: příkaz \"%s\" může být spuštěn pouze v bufferu kanálu nebo soukromého " -"rozhovoru" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: \"%s\" příkaz nemůže být spuštěn v bufferu serveru" @@ -7044,6 +7044,23 @@ msgstr "%s%s: nejste na kanálu \"%s\"" msgid "Notice" msgstr "Oznámení" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "poslat CTCP akci na aktuální kanál" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <server>] <příjemce>[,<příjemce>...] <text>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"server: poslat tomuto serveru (vnitřní jméno)\n" +"příjemce: přezdívka nebo kanál (může být maska, '*' = aktuální kanál)\n" +" text: text, který se má poslat" + msgid "find information about the administrator of the server" msgstr "najít informace o administrátorovi serveru" @@ -7804,18 +7821,6 @@ msgstr "získat \"Zprávu dne\"" msgid "send message to a nick or channel" msgstr "poslat zprávu přezdívce nebo kanálu" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <server>] <příjemce>[,<příjemce>...] <text>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"server: poslat tomuto serveru (vnitřní jméno)\n" -"příjemce: přezdívka nebo kanál (může být maska, '*' = aktuální kanál)\n" -" text: text, který se má poslat" - msgid "list nicks on channels" msgstr "vypsat přezdívky na kanálech" @@ -9513,6 +9518,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: neznámý DCC CHAT typ obdržen od %s%s%s: \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -9522,10 +9528,6 @@ msgstr "Volba" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%sNeznámý CTCP požadavek od %s%s%s: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sCTCP dotaz pro %s%s%s: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 pokud je řetězec validní jméno IRC kanálu na serveru" @@ -9719,6 +9721,10 @@ msgid "irc batch" msgstr "irc kanál" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP dotaz pro %s%s%s: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: nejste připojen k serveru" @@ -14097,3 +14103,8 @@ msgstr "%s%s: vypršel časový limit \"%s\" pro %s" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: nemohu se připojit\" neočekávaná chyba (%d)" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "poslat zprávu přezdívce nebo kanálu" @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-25 22:34+0200\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <kde-i18n-de@kde.org>\n" @@ -8518,6 +8518,13 @@ msgstr "" #, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: Der Befehl \"%s\" kann nur in einem Kanal- oder einem privaten Buffer " +"ausgeführt werden" + +#, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "" @@ -8594,13 +8601,6 @@ msgstr "" "temporary_servers aktiviert werden" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: Der Befehl \"%s\" kann nur in einem Kanal- oder einem privaten Buffer " -"ausgeführt werden" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "" "%s%s: Der Befehl \"%s\" kann nicht in einem Server-Buffer ausgeführt werden" @@ -8868,6 +8868,23 @@ msgstr "%s%s: Sie befinden sich nicht in einem Kanal \"%s\"" msgid "Notice" msgstr "Hinweis" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "eine CTCP ACTION an den aktuellen Kanal senden" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <server>] <target>[,<target>...] <text>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"server: schicke an diesen Server (interner Servername)\n" +"target: Nick oder Kanal (darf eine Maske sein, '*' = aktueller c)\n" +" text: zu sendender Text" + msgid "find information about the administrator of the server" msgstr "Information über den Server-Administrator abfragen" @@ -9818,18 +9835,6 @@ msgstr "Die \"Mitteilung des Tages\" abfragen" msgid "send message to a nick or channel" msgstr "Nachricht an Nick/Kanal verschicken" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <server>] <target>[,<target>...] <text>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"server: schicke an diesen Server (interner Servername)\n" -"target: Nick oder Kanal (darf eine Maske sein, '*' = aktueller c)\n" -" text: zu sendender Text" - msgid "list nicks on channels" msgstr "Nicknamen des Kanals auflisten" @@ -11857,6 +11862,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: unbekannter DCC CHAT-Typ empfangen von %s%s%s: \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -11866,10 +11872,6 @@ msgstr "Einstellung" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%sunbekannte CTCP Anfrage von %s%s%s: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sCTCP Anfrage an %s%s%s: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "" "1, falls die Zeichenkette ein gültiger IRC-Kanalname für den Server ist" @@ -12076,6 +12078,10 @@ msgid "irc batch" msgstr "IRC-Batch" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP Anfrage an %s%s%s: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: Es besteht keine Verbindung zum Server" @@ -16929,3 +16935,8 @@ msgstr "%s%s: Zeitüberschreitung für \"%s\" mit %s" msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "" "%s%s: Verbindung konnte nicht hergestellt werden: unerwarteter Fehler (%d)" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "Nachricht an Nick/Kanal verschicken" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Santiago Forero <santiago@forero.xyz>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7344,6 +7344,13 @@ msgid "" "server" msgstr "" +#, c-format +msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: el comando \"%s\" sólo puede ser ejecutado en un canal o conversación " +"privada" + #, fuzzy, c-format msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " @@ -7416,13 +7423,6 @@ msgid "" msgstr "" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: el comando \"%s\" sólo puede ser ejecutado en un canal o conversación " -"privada" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: el comando \"%s\" no puede ejecutarse en el buffer del servidor" @@ -7679,6 +7679,23 @@ msgstr "%s%s: no estas presente en el canal \"%s\"" msgid "Notice" msgstr "Aviso" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "envía una acción CTCP al canal actual" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <servidor>] <destino>[,<destino>...] <texto>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"servidor: enviar a este servidor (nombre interno)\n" +" destino: apodo o canal (puede ser una máscara, '*' = canal actual)\n" +" texto: texto a enviar" + msgid "find information about the administrator of the server" msgstr "busca información sobre el administrador del servidor" @@ -8453,18 +8470,6 @@ msgstr "obtener el \"Mensaje del Día\" (MOTD)" msgid "send message to a nick or channel" msgstr "envía mensaje a un usuario o canal" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <servidor>] <destino>[,<destino>...] <texto>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"servidor: enviar a este servidor (nombre interno)\n" -" destino: apodo o canal (puede ser una máscara, '*' = canal actual)\n" -" texto: texto a enviar" - msgid "list nicks on channels" msgstr "listar apodos en los canales" @@ -10232,6 +10237,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: tipo de DCC CHAT desconocido recibido de %s%s%s: \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -10241,10 +10247,6 @@ msgstr "Opción" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%sCTCP desconocido solicitado por %s%s%s: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sconsulta CTCP a %s%s%s: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 si la cadena es un nombre de canal IRC válido para el servidor" @@ -10451,6 +10453,10 @@ msgid "irc batch" msgstr "canal irc" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sconsulta CTCP a %s%s%s: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: no estas conectado a ningún servidor" @@ -14769,3 +14775,8 @@ msgstr "%s%s: tiempo de espera máximo para \"%s\" con %s" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: no es posible conectarse: error (%d)" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "envía mensaje a un usuario o canal" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" -"PO-Revision-Date: 2023-05-27 20:18+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" +"PO-Revision-Date: 2023-05-29 09:40+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -8315,6 +8315,13 @@ msgstr "" #, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s : la commande \"%s\" peut seulement être exécutée dans un tampon canal " +"ou privé" + +#, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "" @@ -8390,13 +8397,6 @@ msgstr "" "temporaire (NON SAUVÉ), activez l'option irc.look.temporary_servers" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s : la commande \"%s\" peut seulement être exécutée dans un tampon canal " -"ou privé" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "" "%s%s : la commande \"%s\" ne peut pas être exécutée dans un tampon serveur" @@ -8659,6 +8659,21 @@ msgstr "%s%s : vous n'êtes pas sur le canal \"%s\"" msgid "Notice" msgstr "Notice" +msgid "send a CTCP action to a nick or channel" +msgstr "envoyer une action CTCP à un pseudo ou canal" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <serveur>] <cible>[,<cible>...] <texte>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"serveur : envoyer à ce serveur (nom interne)\n" +" cible : pseudo ou canal (peut-être un masque, '*' = canal courant)\n" +" texte : texte à envoyer" + msgid "find information about the administrator of the server" msgstr "trouver les informations sur l'administrateur du serveur" @@ -9603,18 +9618,6 @@ msgstr "obtenir le message du jour" msgid "send message to a nick or channel" msgstr "envoyer un message à un pseudo ou canal" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <serveur>] <cible>[,<cible>...] <texte>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"serveur : envoyer à ce serveur (nom interne)\n" -" cible : pseudo ou canal (peut-être un masque, '*' = canal courant)\n" -" texte : texte à envoyer" - msgid "list nicks on channels" msgstr "lister les pseudos sur des canaux" @@ -11576,6 +11579,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s : type de DCC CHAT inconnu reçu de %s%s%s : \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action msgid "Action" msgstr "Action" @@ -11583,10 +11587,6 @@ msgstr "Action" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%sCTCP inconnu demandé par %s%s%s : %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sDemande CTCP vers %s%s%s : %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 si la chaîne est un nom de canal IRC valide pour le serveur" @@ -11790,6 +11790,10 @@ msgid "irc batch" msgstr "batch irc" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sDemande CTCP vers %s%s%s : %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s : vous n'êtes pas connecté au serveur" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6207,6 +6207,11 @@ msgstr "" #, fuzzy, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "%s \"%s\" parancs csak a szobaablakban futtatható\n" + +#, fuzzy, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "%s \"%s\" parancs nem futtatható a szerverablakban\n" @@ -6271,11 +6276,6 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "%s \"%s\" parancs csak a szobaablakban futtatható\n" - -#, fuzzy, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s \"%s\" parancs nem futtatható a szerverablakban\n" @@ -6533,6 +6533,24 @@ msgstr "%s nem sikerült új szobát nyitni \"%s\"\n" msgid "Notice" msgstr "" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "CTCP parancs küldése az aktuális szobába" + +#, fuzzy +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "fogadó [,fogadó] szöveg" + +#, fuzzy +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"fogadó: név vagy szoba (esetleg maszk, '*' = aktuális szoba)\n" +"szöveg: küldendő üzenet" + msgid "find information about the administrator of the server" msgstr "információ lekérdezése a szerver adminisztrátorról" @@ -7246,19 +7264,6 @@ msgid "send message to a nick or channel" msgstr "üzenet küldése egy felhasználónak vagy szobának" #, fuzzy -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "fogadó [,fogadó] szöveg" - -#, fuzzy -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"fogadó: név vagy szoba (esetleg maszk, '*' = aktuális szoba)\n" -"szöveg: küldendő üzenet" - -#, fuzzy msgid "list nicks on channels" msgstr "felhasználók listája egy szobában" @@ -8954,6 +8959,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s usmeretlen DCC CHAT típus érkezett a következőtől:" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy msgid "Action" msgstr "[parancs]" @@ -8962,10 +8968,6 @@ msgstr "[parancs]" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "Ismeretlen CTCP %s%s%s érkezett innen: %s%s" -#, fuzzy, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%s Szerver: %s%s %s[%s%s%s]\n" - #, fuzzy msgid "1 if string is a valid IRC channel name for server" msgstr "felhasználók listája a szobában" @@ -9178,6 +9180,10 @@ msgid "irc batch" msgstr "%d szoba" #, fuzzy, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%s Szerver: %s%s %s[%s%s%s]\n" + +#, fuzzy, c-format msgid "%s%s: you are not connected to server" msgstr "%s nincs csatlakozva szerverhez!\n" @@ -13371,3 +13377,8 @@ msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n" #, fuzzy, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s DCC: nem sikerült kapcsolódni a küldőhöz\n" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "üzenet küldése egy felhasználónak vagy szobának" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -7040,6 +7040,13 @@ msgid "" "server" msgstr "" +#, c-format +msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: il comando \"%s\" può essere eseguito soltanto in un canale o in un " +"buffer privato" + #, fuzzy, c-format msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " @@ -7113,13 +7120,6 @@ msgid "" msgstr "" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: il comando \"%s\" può essere eseguito soltanto in un canale o in un " -"buffer privato" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: il comando \"%s\" non può essere eseguito sul buffer del server" @@ -7380,6 +7380,23 @@ msgstr "%s%s: non sei sul canale \"%s\"" msgid "Notice" msgstr "Notice" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "invia un'azione CTCP al canale corrente" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <server>] <destinazione>[,<destinazione>...] <testo>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +" server: invia a questo server (nome interno)\n" +"destinazione: nick o canale (può essere una mask, '*' = canale corrente)\n" +" testo: testo da inviare" + msgid "find information about the administrator of the server" msgstr "trova informazioni sull'amministratore del server" @@ -8157,18 +8174,6 @@ msgstr "riceve il \"Messaggio Del Giorno\"" msgid "send message to a nick or channel" msgstr "invia un messaggio ad un nick o a un canale" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <server>] <destinazione>[,<destinazione>...] <testo>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -" server: invia a questo server (nome interno)\n" -"destinazione: nick o canale (può essere una mask, '*' = canale corrente)\n" -" testo: testo da inviare" - msgid "list nicks on channels" msgstr "elenca i nick sul canale" @@ -9964,6 +9969,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: tipo di DCC CHAT sconosciuto ricevuto da %s%s%s: \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -9973,10 +9979,6 @@ msgstr "Opzione" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%sCTCP sconosciuto richiesto da %s%s%s: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sRichiesta CTCP a %s%s%s: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 se la stringa è il nome di un canale IRC valido per il server" @@ -10181,6 +10183,10 @@ msgid "irc batch" msgstr "canale irc" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sRichiesta CTCP a %s%s%s: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: non connesso al server" @@ -14541,3 +14547,8 @@ msgstr "%s%s: timeout per \"%s\" con %s" #, fuzzy, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: impossibile connettersi al mittente" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "invia un messaggio ad un nick o a un canale" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/" @@ -8044,6 +8044,12 @@ msgstr "" #, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: \"%s\" コマンドはチャンネル内かプライベートバッファで実行できます" + +#, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "" @@ -8117,12 +8123,6 @@ msgstr "" "に追加したい場合は、irc.look.temporary_servers オプションを on にしてください" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: \"%s\" コマンドはチャンネル内かプライベートバッファで実行できます" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: \"%s\" コマンドはサーババッファでは実行できません" @@ -8374,6 +8374,24 @@ msgstr "%s%s: あなたはチャンネル \"%s\" にいません" msgid "Notice" msgstr "Notice" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "現在のチャンネルに CTCP action を送信" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <server>] <target>[,<target>...] <text>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"server: このサーバに送信 (内部サーバ名)\n" +"target: ニックネームまたはチャンネル名 (マスクを使えるかもしれない、'*' = 現" +"在のチャンネル)\n" +" text: 送信するテキスト" + msgid "find information about the administrator of the server" msgstr "サーバ管理者に関する情報を探す" @@ -9244,19 +9262,6 @@ msgstr "\"今日のメッセージ\" を取得" msgid "send message to a nick or channel" msgstr "ニックネームかチャンネルにメッセージを送る" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <server>] <target>[,<target>...] <text>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"server: このサーバに送信 (内部サーバ名)\n" -"target: ニックネームまたはチャンネル名 (マスクを使えるかもしれない、'*' = 現" -"在のチャンネル)\n" -" text: 送信するテキスト" - msgid "list nicks on channels" msgstr "チャンネルに参加しているニックネームをリストアップ" @@ -11145,6 +11150,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: %s%s%s からの未知の DCC CHAT タイプ: \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -11154,10 +11160,6 @@ msgstr "オプション" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%s%s%s%s からの未知の CTCP 要求: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%s%s%s%s への CTCP クエリ: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "文字列がサーバの有効な IRC チャンネル名なら 1" @@ -11360,6 +11362,10 @@ msgid "irc batch" msgstr "irc チャンネル" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%s%s%s%s への CTCP クエリ: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: サーバに接続していません" @@ -15991,3 +15997,8 @@ msgstr "%s%s: \"%s\" のタイムアウト %s" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: 接続できません: 未定義のエラー (%d)" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "ニックネームかチャンネルにメッセージを送る" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Language-Team: Polish <kde-i18n-doc@kde.org>\n" @@ -8776,6 +8776,12 @@ msgstr "" #, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: komenda \"%s\" może być wykonana tylko na kanale lub prywatnym buforze" + +#, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "" @@ -8850,12 +8856,6 @@ msgstr "" "tymczasowy (NIE ZAPISANY), włącz opcję irc.look.temporary_servers" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: komenda \"%s\" może być wykonana tylko na kanale lub prywatnym buforze" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: komenda \"%s\" nie można być wykonana w buforze serwera" @@ -9118,6 +9118,23 @@ msgstr "%s%s: nie jesteś na kanale \"%s\"" msgid "Notice" msgstr "Powiadomienie" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "wysyła akcję CTCP na aktualny kanał" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <serwer>] <cel>[,<cel>...] <tekst>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"serwer: wyślij do tego serwera (nazwa wewnętrzna)\n" +"cel: nick lub kanał (może być maska, '*' = aktualny kanał)\n" +" tekst: wiadomość do wysłania" + msgid "find information about the administrator of the server" msgstr "wyszukuje informacje o administratorze serwera" @@ -10130,18 +10147,6 @@ msgstr "pobierz \"Wiadomość Dnia\" (motd)" msgid "send message to a nick or channel" msgstr "wysyła wiadomość do użytkownika albo kanału" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <serwer>] <cel>[,<cel>...] <tekst>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"serwer: wyślij do tego serwera (nazwa wewnętrzna)\n" -"cel: nick lub kanał (może być maska, '*' = aktualny kanał)\n" -" tekst: wiadomość do wysłania" - msgid "list nicks on channels" msgstr "wyświetla nazwy użytkowników na kanałach" @@ -12143,6 +12148,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: nieznany typ DCC CHAT otrzymano od %s%s%s: \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -12152,10 +12158,6 @@ msgstr "Opcja" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%sNieznane zażądane CTCP przez %s%s%s: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sZapytanie CTCP do %s%s%s: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 jeśli ciąg jest poprawną nazwą kanału IRC dla serwera" @@ -12358,6 +12360,10 @@ msgid "irc batch" msgstr "kanał irc" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sZapytanie CTCP do %s%s%s: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: nie jesteś połączony z serwerem" @@ -17160,3 +17166,8 @@ msgstr "%s%s: przekroczono czas na \"%s\" z %s" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: nie można połączyć: niespodziewany błąd (%d)" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "wysyła wiadomość do użytkownika albo kanału" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Language-Team: Portuguese <>\n" @@ -7801,6 +7801,12 @@ msgid "" "server" msgstr "" +#, c-format +msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: o comando \"%s\" só pode ser executado num buffer de canal ou privado" + #, fuzzy, c-format msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " @@ -7876,12 +7882,6 @@ msgstr "" "(NÃO GUARDADO), ative a opção irc.look.temporary_servers" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: o comando \"%s\" só pode ser executado num buffer de canal ou privado" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: o comando \"%s\" não pode ser executado num buffer de servidor" @@ -8141,6 +8141,23 @@ msgstr "%s%s: não está no canal \"%s\"" msgid "Notice" msgstr "Notice" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "enviar uma ação CTCP para o canal atual" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <servidor>] <destino>[,<destino>...] <texto>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"servidor: enviar para este servidor (nome interno)\n" +" destino: nick ou canal (pode ser uma máscara, '*' = canal atual)\n" +" texto: texto a enviar" + msgid "find information about the administrator of the server" msgstr "obter informação sobre o administrador do servidor" @@ -9001,18 +9018,6 @@ msgstr "obter a \"Message Of The Day\" (mensagem do dia)" msgid "send message to a nick or channel" msgstr "enviar mensagem para um nick ou canal" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <servidor>] <destino>[,<destino>...] <texto>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"servidor: enviar para este servidor (nome interno)\n" -" destino: nick ou canal (pode ser uma máscara, '*' = canal atual)\n" -" texto: texto a enviar" - msgid "list nicks on channels" msgstr "listar nicks em canais" @@ -10917,6 +10922,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: tipo desconhecido de DCC CHAT recebido de %s%s%s: \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -10926,10 +10932,6 @@ msgstr "Opção" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%spedido CTCP desconhecido por %s%s%s: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sconsulta CTCP a %s%s%s: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 se a cadeia for o nome dum canal de IRC válido no servidor" @@ -11140,6 +11142,10 @@ msgid "irc batch" msgstr "canal de irc" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sconsulta CTCP a %s%s%s: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: não está conectado ao servidor" @@ -15759,3 +15765,8 @@ msgstr "%s%s: tempo limite de \"%s\" com %s" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: não foi possível conectar: erro inesperado (%d)" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "enviar mensagem para um nick ou canal" diff --git a/po/pt_BR.po b/po/pt_BR.po index e6a0f7ae8..f45868386 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: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Érico Nogueira <ericonr@disroot.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6945,6 +6945,11 @@ msgid "" "server" msgstr "" +#, c-format +msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" + #, fuzzy, c-format msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " @@ -7015,11 +7020,6 @@ msgid "" msgstr "" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "" @@ -7268,6 +7268,20 @@ msgstr "" msgid "Notice" msgstr "" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "envia um CTCP action para o canal atual" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" + msgid "find information about the administrator of the server" msgstr "" @@ -7906,15 +7920,6 @@ msgstr "" msgid "send message to a nick or channel" msgstr "" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" - msgid "list nicks on channels" msgstr "" @@ -9498,6 +9503,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -9507,10 +9513,6 @@ msgstr "Opção" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%sRequisição CTCP desconhecida por %s%s%s: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 se string é um nome de canal IRC válido para o servidor" @@ -9714,6 +9716,10 @@ msgid "irc batch" msgstr "canal irc" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: você não está conectado ao servidor" @@ -13967,3 +13973,8 @@ msgstr "%s%s: tempo esgotado para \"%s\" com %s" #, fuzzy, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: não foi possível conectar ao remetente" + +#, fuzzy +#~| msgid "send a private message to a nick" +#~ msgid "send action message to a nick or channel" +#~ msgstr "enviar mensagem privada a um nick" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -6244,6 +6244,12 @@ msgstr "" #, fuzzy, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s \"%s\" команда может быть выполнена только в буфере канала или привата\n" + +#, fuzzy, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "%s \"%s\" команда может быть выполнена только в буфере сервера\n" @@ -6308,12 +6314,6 @@ msgid "" msgstr "" #, fuzzy, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s \"%s\" команда может быть выполнена только в буфере канала или привата\n" - -#, fuzzy, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s \"%s\" команда может быть выполнена только в буфере сервера\n" @@ -6575,6 +6575,24 @@ msgstr "%s не могу создать новый канал \"%s\"\n" msgid "Notice" msgstr "" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "отправить CTCP-действие на текущий канал" + +#, fuzzy +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "адресат[,адресат] текст" + +#, fuzzy +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"адресат: ник или канал (можно использовать маску, '*' = текущий канал)\n" +"текст: отправляаемый текст" + msgid "find information about the administrator of the server" msgstr "найти информацию об администрации сервера" @@ -7284,19 +7302,6 @@ msgid "send message to a nick or channel" msgstr "отправить сообщение нику или на канал" #, fuzzy -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "адресат[,адресат] текст" - -#, fuzzy -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"адресат: ник или канал (можно использовать маску, '*' = текущий канал)\n" -"текст: отправляаемый текст" - -#, fuzzy msgid "list nicks on channels" msgstr "перечислить ники на канале" @@ -8991,6 +8996,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s неизвестный режим DCC CHAT получен от " #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy msgid "Action" msgstr "[команда]" @@ -8999,10 +9005,6 @@ msgstr "[команда]" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "Получен неизвестный CTCP %s%s%s от %s%s" -#, fuzzy, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sСервер: %s%s %s[%s%s%s]\n" - #, fuzzy msgid "1 if string is a valid IRC channel name for server" msgstr "список ников на канале" @@ -9215,6 +9217,10 @@ msgid "irc batch" msgstr "%d канал" #, fuzzy, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sСервер: %s%s %s[%s%s%s]\n" + +#, fuzzy, c-format msgid "%s%s: you are not connected to server" msgstr "%s вы не подключены к серверу\n" @@ -13405,3 +13411,8 @@ msgstr "%s нет аргумента для параметра \"%s\"\n" #, fuzzy, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s DCC: не могу соединиться с отправителем\n" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "отправить сообщение нику или на канал" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-14 15:29+0200\n" "Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8139,6 +8139,12 @@ msgstr "%s%s: команда /%s не може да се изврши, серв #, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: команда „%s” може да се изврши само у каналу или приватном баферу" + +#, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "" @@ -8212,12 +8218,6 @@ msgstr "" "сервер (који се НЕ ЧУВА), укључите опцију irc.look.temporary_servers" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: команда „%s” може да се изврши само у каналу или приватном баферу" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: команда „%s” не може да се изврши у серверском баферу" @@ -8477,6 +8477,23 @@ msgstr "%s%s: нисте на каналу „%s”" msgid "Notice" msgstr "Notice" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "слање CTCP акције текућем каналу" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <сервер>] <циљ>[,<циљ>...] <текст>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"сервер: слање на овај сервер (интерно име)\n" +" циљ: надимак или канал (може бити и маска, ’*’ = текући канал)\n" +" текст: текст који се шаље" + msgid "find information about the administrator of the server" msgstr "проналажење информација о администратору сервера" @@ -9424,18 +9441,6 @@ msgstr "враћање „Message Of The Day” (поруке дана)" msgid "send message to a nick or channel" msgstr "слање поруке надимку или каналу" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <сервер>] <циљ>[,<циљ>...] <текст>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"сервер: слање на овај сервер (интерно име)\n" -" циљ: надимак или канал (може бити и маска, ’*’ = текући канал)\n" -" текст: текст који се шаље" - msgid "list nicks on channels" msgstr "листа надимака на каналима" @@ -11341,6 +11346,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: примљен је непознати DCC CHAT тип од %s%s%s: „%s”" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -11350,10 +11356,6 @@ msgstr "Опција" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%sСтигао је непознати CTCP од %s%s%s: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%sCTCP упит за %s%s%s: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 ако је стринг важеће име IRC канала за сервер" @@ -11553,6 +11555,10 @@ msgid "irc batch" msgstr "irc channel" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%sCTCP упит за %s%s%s: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: нисте повезани са сервером" @@ -16244,3 +16250,8 @@ msgstr "%s%s: тајмаут за „%s” са %s" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: повезивање није успело: неочекивана грешка (%d)" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "слање поруке надимку или каналу" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\n" "PO-Revision-Date: 2023-05-01 20:23+0200\n" "Last-Translator: Emir SARI <emir_sari@icloud.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -8379,6 +8379,12 @@ msgstr "" #, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" +"%s%s: \"%s\" komutu, yalnızca bir kanalda veya özel arabellekte yürütülebilir" + +#, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "" @@ -8453,12 +8459,6 @@ msgstr "" "istiyorsanız (KAYDEDİLMEZ), irc.look_temporary_servers seçeneğini açın" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" -"%s%s: \"%s\" komutu, yalnızca bir kanalda veya özel arabellekte yürütülebilir" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "%s%s: \"%s\" komutu, bir sunucu arabelleğinde yürütülemez" @@ -8716,6 +8716,23 @@ msgstr "%s%s: \"%s\" kanalında değilsiniz" msgid "Notice" msgstr "Notice" +#, fuzzy +#| msgid "send a CTCP action to the current channel" +msgid "send a CTCP action to a nick or channel" +msgstr "Geçerli kanala bir CTCP eylemi gönder" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "[-server <sunucu>] <hedef>[,<hedef>...] <metin>" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" +"sunucu: Bu kanala gönder (içsel ad)\n" +" hedef: Takma ad veya kanal (maske olabilir, '*' = geçerli kanal)\n" +" metin: Gönderilecek metin" + msgid "find information about the administrator of the server" msgstr "sunucu yöneticisi hakkında bilgi bul" @@ -9715,18 +9732,6 @@ msgstr "\"Günün İletisi\"ni al" msgid "send message to a nick or channel" msgstr "bir takma ada veya kanala ileti gönder" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "[-server <sunucu>] <hedef>[,<hedef>...] <metin>" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" -"sunucu: Bu kanala gönder (içsel ad)\n" -" hedef: Takma ad veya kanal (maske olabilir, '*' = geçerli kanal)\n" -" metin: Gönderilecek metin" - msgid "list nicks on channels" msgstr "kanaldaki takma adları listele" @@ -11704,6 +11709,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "%s%s: %s%s%s konumundan bilinmeyen DCC CHAT türü alındı: \"%s\"" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action #, fuzzy #| msgid "Option" msgid "Action" @@ -11713,10 +11719,6 @@ msgstr "Seçenek" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "%s%s%s%s tarafından bilinmeyen CTCP istendi: %s%s%s%s%s" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "%s%s%s%s konumuna CTCP sorgusu: %s%s%s%s%s" - msgid "1 if string is a valid IRC channel name for server" msgstr "1 eğer dizi sunucu için geçerli bir IRC kanal adıysa" @@ -11919,6 +11921,10 @@ msgid "irc batch" msgstr "irc kanalı" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "%s%s%s%s konumuna CTCP sorgusu: %s%s%s%s%s" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "%s%s: Sunucuya bağlı değilsiniz" @@ -16637,3 +16643,8 @@ msgstr "%s%s: \"%s\" için %s ile zaman aşımı" #, c-format msgid "%s%s: unable to connect: unexpected error (%d)" msgstr "%s%s: Bağlanılamıyor: Beklenmedik hata (%d)" + +#, fuzzy +#~| msgid "send message to a nick or channel" +#~ msgid "send action message to a nick or channel" +#~ msgstr "bir takma ada veya kanala ileti gönder" diff --git a/po/weechat.pot b/po/weechat.pot index e1767a36d..62b8d3dc2 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: 2023-05-27 20:17+0200\n" +"POT-Creation-Date: 2023-05-29 09:34+0200\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" @@ -5711,6 +5711,11 @@ msgstr "" #, c-format msgid "" +"%s%s: \"%s\" command can only be executed in a channel or private buffer" +msgstr "" + +#, c-format +msgid "" "%s%s: command \"%s\" with option \"%s\" must be executed on irc buffer " "(server, channel or private)" msgstr "" @@ -5775,11 +5780,6 @@ msgid "" msgstr "" #, c-format -msgid "" -"%s%s: \"%s\" command can only be executed in a channel or private buffer" -msgstr "" - -#, c-format msgid "%s%s: \"%s\" command can not be executed on a server buffer" msgstr "" @@ -6027,6 +6027,18 @@ msgstr "" msgid "Notice" msgstr "" +msgid "send a CTCP action to a nick or channel" +msgstr "" + +msgid "[-server <server>] <target>[,<target>...] <text>" +msgstr "" + +msgid "" +"server: send to this server (internal name)\n" +"target: nick or channel (may be mask, '*' = current channel)\n" +" text: text to send" +msgstr "" + msgid "find information about the administrator of the server" msgstr "" @@ -6621,15 +6633,6 @@ msgstr "" msgid "send message to a nick or channel" msgstr "" -msgid "[-server <server>] <target>[,<target>...] <text>" -msgstr "" - -msgid "" -"server: send to this server (internal name)\n" -"target: nick or channel (may be mask, '*' = current channel)\n" -" text: text to send" -msgstr "" - msgid "list nicks on channels" msgstr "" @@ -8036,6 +8039,7 @@ msgid "%s%s: unknown DCC CHAT type received from %s%s%s: \"%s\"" msgstr "" #. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me +#. TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action msgid "Action" msgstr "" @@ -8043,10 +8047,6 @@ msgstr "" msgid "%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s" msgstr "" -#, c-format -msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" -msgstr "" - msgid "1 if string is a valid IRC channel name for server" msgstr "" @@ -8229,6 +8229,10 @@ msgid "irc batch" msgstr "" #, c-format +msgid "%sCTCP query to %s%s%s: %s%s%s%s%s" +msgstr "" + +#, c-format msgid "%s%s: you are not connected to server" msgstr "" diff --git a/src/plugins/alias/alias-config.c b/src/plugins/alias/alias-config.c index 5aaf0206a..7d65a1c1b 100644 --- a/src/plugins/alias/alias-config.c +++ b/src/plugins/alias/alias-config.c @@ -34,7 +34,6 @@ struct t_config_section *alias_config_section_completion = NULL; char *alias_default[][3] = { { "aaway", "allserv /away", NULL }, - { "action", "ctcp $1 action $2-", NULL }, { "anick", "allserv /nick", NULL }, { "beep", "print -beep", NULL }, { "bye", "quit", NULL }, diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 707c4bd60..56c49ee10 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -355,6 +355,165 @@ irc_command_mode_masks (struct t_irc_server *server, } /* + * Sends a CTCP ACTION to a channel for a single message + * (internal function called by irc_command_me_channel). + */ + +void +irc_command_me_channel_message (struct t_irc_server *server, + const char *channel_name, + const char *message) +{ + struct t_arraylist *list_messages; + int i, list_size; + + list_messages = irc_server_sendf ( + server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_LIST, + NULL, + "PRIVMSG %s :\01ACTION%s%s\01", + channel_name, + (message && message[0]) ? " " : "", + (message && message[0]) ? message : ""); + if (list_messages) + { + /* display only if capability "echo-message" is NOT enabled */ + if (!weechat_hashtable_has_key (server->cap_list, "echo-message")) + { + list_size = weechat_arraylist_size (list_messages); + for (i = 0; i < list_size; i++) + { + irc_input_user_message_display ( + server, + channel_name, + NULL, /* address */ + "privmsg", + "action", + (const char *)weechat_arraylist_get (list_messages, i), + 1); /* decode_colors */ + } + } + weechat_arraylist_free (list_messages); + } +} + +/* + * Sends a CTCP ACTION to a channel. + */ + +void +irc_command_me_channel (struct t_irc_server *server, + const char *channel_name, + const char *arguments) +{ + char **list_arguments; + int i, count_arguments; + + list_arguments = weechat_string_split ((arguments) ? arguments : "", + "\n", NULL, 0, 0, &count_arguments); + if (list_arguments) + { + for (i = 0; i < count_arguments; i++) + { + irc_command_me_channel_message (server, channel_name, + list_arguments[i]); + } + } + else + { + irc_command_me_channel_message (server, channel_name, ""); + } + + weechat_string_free_split (list_arguments); +} + +/* + * Sends a CTCP ACTION to all channels of a server. + */ + +void +irc_command_me_all_channels (struct t_irc_server *server, const char *arguments) +{ + struct t_irc_channel *ptr_channel; + + for (ptr_channel = server->channels; ptr_channel; + ptr_channel = ptr_channel->next_channel) + { + if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) + irc_command_me_channel (server, ptr_channel->name, arguments); + } +} + +/* + * Callback for command "/action": sends an action message to a nick or channel. + */ + +IRC_COMMAND_CALLBACK(action) +{ + char **targets; + int num_targets, i, arg_target, arg_text; + + IRC_BUFFER_GET_SERVER_CHANNEL(buffer); + + /* make C compiler happy */ + (void) pointer; + (void) data; + + WEECHAT_COMMAND_MIN_ARGS(2, ""); + + arg_target = 1; + arg_text = 2; + + if ((argc >= 5) && (weechat_strcmp (argv[1], "-server") == 0)) + { + ptr_server = irc_server_search (argv[2]); + ptr_channel = NULL; + arg_target = 3; + arg_text = 4; + } + + IRC_COMMAND_CHECK_SERVER("action", 1, 1); + + targets = weechat_string_split (argv[arg_target], ",", NULL, + WEECHAT_STRING_SPLIT_STRIP_LEFT + | WEECHAT_STRING_SPLIT_STRIP_RIGHT + | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, + 0, &num_targets); + if (!targets) + WEECHAT_COMMAND_ERROR; + + for (i = 0; i < num_targets; i++) + { + if (strcmp (targets[i], "*") == 0) + { + if (!ptr_channel + || ((ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL) + && (ptr_channel->type != IRC_CHANNEL_TYPE_PRIVATE))) + { + weechat_printf ( + ptr_server->buffer, + _("%s%s: \"%s\" command can only be executed in a channel " + "or private buffer"), + weechat_prefix ("error"), IRC_PLUGIN_NAME, "action *"); + } + else + { + irc_command_me_channel (ptr_server, ptr_channel->name, + argv_eol[arg_text]); + } + } + else + { + irc_command_me_channel (ptr_server, targets[i], argv_eol[arg_text]); + } + } + + weechat_string_free_split (targets); + + return WEECHAT_RC_OK; +} + +/* * Callback for command "/admin": finds information about the administrator of * the server. */ @@ -1061,130 +1220,6 @@ end: } /* - * Displays a ctcp action on a channel. - */ - -void -irc_command_me_channel_display (struct t_irc_server *server, - struct t_irc_channel *channel, - const char *arguments) -{ - char *string; - struct t_irc_nick *ptr_nick; - - /* - * if capability "echo-message" is enabled, we don't display anything, - * the message will be displayed when server sends it back to us - */ - if (weechat_hashtable_has_key (server->cap_list, "echo-message")) - return; - - string = (arguments && arguments[0]) ? - irc_color_decode (arguments, - weechat_config_boolean (irc_config_network_colors_send)) : NULL; - ptr_nick = irc_nick_search (server, channel, server->nick); - weechat_printf_date_tags ( - channel->buffer, - 0, - irc_protocol_tags (server, - "privmsg", - NULL, - "irc_action,self_msg,notify_none,no_highlight", - server->nick, NULL), - "%s%s%s%s%s%s%s", - weechat_prefix ("action"), - irc_nick_mode_for_display (server, ptr_nick, 0), - IRC_COLOR_CHAT_NICK_SELF, - server->nick, - (string) ? IRC_COLOR_RESET : "", - (string) ? " " : "", - (string) ? string : ""); - if (string) - free (string); -} - -/* - * Sends a ctcp action to a channel for a single message - * (internal function called by irc_command_me_channel). - */ - -void -irc_command_me_channel_message (struct t_irc_server *server, - struct t_irc_channel *channel, - const char *message) -{ - struct t_arraylist *list_messages; - int i, list_size; - - list_messages = irc_server_sendf ( - server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_LIST, - NULL, - "PRIVMSG %s :\01ACTION%s%s\01", - channel->name, - (message && message[0]) ? " " : "", - (message && message[0]) ? message : ""); - if (list_messages) - { - list_size = weechat_arraylist_size (list_messages); - for (i = 0; i < list_size; i++) - { - irc_command_me_channel_display ( - server, - channel, - (const char *)weechat_arraylist_get (list_messages, i)); - } - weechat_arraylist_free (list_messages); - } -} - -/* - * Sends a ctcp action to a channel. - */ - -void -irc_command_me_channel (struct t_irc_server *server, - struct t_irc_channel *channel, - const char *arguments) -{ - char **list_arguments; - int i, count_arguments; - - list_arguments = weechat_string_split ((arguments) ? arguments : "", - "\n", NULL, 0, 0, &count_arguments); - if (list_arguments) - { - for (i = 0; i < count_arguments; i++) - { - irc_command_me_channel_message (server, channel, list_arguments[i]); - } - } - else - { - irc_command_me_channel_message (server, channel, ""); - } - - weechat_string_free_split (list_arguments); -} - -/* - * Sends a ctcp action to all channels of a server. - */ - -void -irc_command_me_all_channels (struct t_irc_server *server, const char *arguments) -{ - struct t_irc_channel *ptr_channel; - - for (ptr_channel = server->channels; ptr_channel; - ptr_channel = ptr_channel->next_channel) - { - if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) - irc_command_me_channel (server, ptr_channel, arguments); - } -} - -/* * Displays away on all channels of all servers. */ @@ -1851,7 +1886,6 @@ IRC_COMMAND_CALLBACK(connect) IRC_COMMAND_CALLBACK(ctcp) { - struct t_irc_channel *ptr_channel_target; char **targets, *ctcp_type, str_time[512]; const char *ctcp_target, *ctcp_args; int num_targets, arg_target, arg_type, arg_args, i; @@ -1931,17 +1965,17 @@ IRC_COMMAND_CALLBACK(ctcp) if (ctcp_target) { - /* display message only if capability "echo-message" is NOT enabled */ + /* display only if capability "echo-message" is NOT enabled */ if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message")) { - ptr_channel_target = irc_channel_search ( + irc_input_user_message_display ( ptr_server, - (irc_server_prefix_char_statusmsg (ptr_server, - ctcp_target[0]) - && irc_channel_is_channel (ptr_server, ctcp_target + 1)) ? - ctcp_target + 1 : ctcp_target); - irc_ctcp_display_send (ptr_server, ptr_channel_target, - ctcp_target, NULL, ctcp_type, ctcp_args); + ctcp_target, + NULL, /* address */ + "privmsg", + ctcp_type, + ctcp_args, + 1); /* decode_colors */ } irc_ctcp_send (ptr_server, ctcp_target, ctcp_type, ctcp_args); } @@ -3501,7 +3535,7 @@ IRC_COMMAND_CALLBACK(map) } /* - * Callback for command "/me": sends a ctcp action to the current channel. + * Callback for command "/me": sends a CTCP ACTION to the current channel. */ IRC_COMMAND_CALLBACK(me) @@ -3523,7 +3557,7 @@ IRC_COMMAND_CALLBACK(me) return WEECHAT_RC_OK; } - irc_command_me_channel (ptr_server, ptr_channel, + irc_command_me_channel (ptr_server, ptr_channel->name, (argc > 1) ? argv_eol[1] : NULL); return WEECHAT_RC_OK; @@ -3648,10 +3682,8 @@ IRC_COMMAND_CALLBACK(motd) IRC_COMMAND_CALLBACK(msg) { - char **targets, *msg_pwd_hidden, *string; - int num_targets, i, j, arg_target, arg_text, is_channel, status_msg; - int hide_password; - struct t_irc_channel *ptr_channel2; + char **targets; + int num_targets, i, arg_target, arg_text; IRC_BUFFER_GET_SERVER_CHANNEL(buffer); @@ -3698,9 +3730,18 @@ IRC_COMMAND_CALLBACK(msg) } else { - irc_input_user_message_display (ptr_channel->buffer, - 0, 0, NULL, 0, - argv_eol[arg_text]); + /* display only if capability "echo-message" is NOT enabled */ + if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message")) + { + irc_input_user_message_display ( + ptr_server, + ptr_channel->name, + NULL, /* address */ + "privmsg", + NULL, /* ctcp_type */ + argv_eol[arg_text], + 1); /* decode_colors */ + } irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, "PRIVMSG %s :%s", @@ -3709,135 +3750,22 @@ IRC_COMMAND_CALLBACK(msg) } else { - is_channel = 0; - ptr_channel2 = NULL; - status_msg = 0; - if (irc_server_prefix_char_statusmsg (ptr_server, - targets[i][0]) - && irc_channel_is_channel (ptr_server, targets[i] + 1)) - { - ptr_channel2 = irc_channel_search (ptr_server, targets[i] + 1); - is_channel = 1; - status_msg = 1; - } - else - { - ptr_channel2 = irc_channel_search (ptr_server, targets[i]); - if (ptr_channel2) - is_channel = 1; - } - if (is_channel) - { - if (ptr_channel2) - { - irc_input_user_message_display ( - ptr_channel2->buffer, - 0, /* action */ - 0, /* notice */ - (status_msg) ? targets[i] : NULL, - is_channel, - argv_eol[arg_text]); - } - irc_server_sendf (ptr_server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "PRIVMSG %s :%s", - targets[i], argv_eol[arg_text]); - } - else + /* display only if capability "echo-message" is NOT enabled */ + if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message")) { - /* check if the password must be hidden for this nick */ - hide_password = 0; - if (irc_config_nicks_hide_password) - { - for (j = 0; j < irc_config_num_nicks_hide_password; j++) - { - if (weechat_strcasecmp (irc_config_nicks_hide_password[j], - targets[i]) == 0) - { - hide_password = 1; - break; - } - } - } - if (hide_password) - { - /* hide password in message displayed using modifier */ - msg_pwd_hidden = weechat_hook_modifier_exec ( - "irc_message_auth", - ptr_server->name, - argv_eol[arg_text]); - string = irc_color_decode ( - (msg_pwd_hidden) ? msg_pwd_hidden : argv_eol[arg_text], - weechat_config_boolean (irc_config_network_colors_send)); - weechat_printf ( - ptr_server->buffer, - "%sMSG%s(%s%s%s)%s: %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_msg (ptr_server, 0, NULL, - targets[i]), - targets[i], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (string) ? - string : ((msg_pwd_hidden) ? - msg_pwd_hidden : argv_eol[arg_text])); - if (string) - free (string); - if (msg_pwd_hidden) - free (msg_pwd_hidden); - } - else - { - ptr_channel2 = irc_channel_search (ptr_server, - targets[i]); - if (ptr_channel2) - { - irc_input_user_message_display (ptr_channel2->buffer, - 0, 0, NULL, 0, - argv_eol[arg_text]); - } - else - { - /* - * display message only if capability "echo-message" - * is NOT enabled - */ - if (!weechat_hashtable_has_key (ptr_server->cap_list, - "echo-message")) - { - string = irc_color_decode ( - argv_eol[arg_text], - weechat_config_boolean ( - irc_config_network_colors_send)); - weechat_printf_date_tags ( - ptr_server->buffer, - 0, - irc_protocol_tags ( - ptr_server, - "privmsg", - NULL, - "self_msg,notify_none,no_highlight", - ptr_server->nick, NULL), - "%sMSG%s(%s%s%s)%s: %s", - weechat_prefix ("network"), - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_color_for_msg ( - ptr_server, 0, NULL, targets[i]), - targets[i], - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (string) ? string : argv_eol[arg_text]); - if (string) - free (string); - } - } - } - irc_server_sendf (ptr_server, - IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, - "PRIVMSG %s :%s", - targets[i], argv_eol[arg_text]); + irc_input_user_message_display ( + ptr_server, + targets[i], + NULL, /* address */ + "privmsg", + NULL, /* ctcp_type */ + argv_eol[arg_text], + 1); /* decode_colors */ } + irc_server_sendf (ptr_server, + IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, + "PRIVMSG %s :%s", + targets[i], argv_eol[arg_text]); } } @@ -3943,8 +3871,7 @@ IRC_COMMAND_CALLBACK(nick) IRC_COMMAND_CALLBACK(notice) { const char *ptr_message; - int i, arg_target, arg_text, is_channel, list_size; - struct t_irc_channel *ptr_channel; + int i, arg_target, arg_text, list_size; struct t_arraylist *list_messages; IRC_BUFFER_GET_SERVER(buffer); @@ -3965,19 +3892,7 @@ IRC_COMMAND_CALLBACK(notice) } IRC_COMMAND_CHECK_SERVER("notice", 1, 1); - is_channel = 0; - if (irc_server_prefix_char_statusmsg (ptr_server, argv[arg_target][0]) - && irc_channel_is_channel (ptr_server, argv[arg_target] + 1)) - { - ptr_channel = irc_channel_search (ptr_server, argv[arg_target] + 1); - is_channel = 1; - } - else - { - ptr_channel = irc_channel_search (ptr_server, argv[arg_target]); - if (ptr_channel) - is_channel = 1; - } + list_messages = irc_server_sendf ( ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH | IRC_SERVER_SEND_RETURN_LIST, @@ -3986,19 +3901,22 @@ IRC_COMMAND_CALLBACK(notice) argv[arg_target], argv_eol[arg_text]); if (list_messages) { - list_size = weechat_arraylist_size (list_messages); - for (i = 0; i < list_size; i++) + /* display only if capability "echo-message" is NOT enabled */ + if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message")) { - ptr_message = (const char *)weechat_arraylist_get (list_messages, i); - irc_input_user_message_display ( - irc_msgbuffer_get_target_buffer ( - ptr_server, argv[arg_target], "notice", NULL, - (ptr_channel) ? ptr_channel->buffer : NULL), - 0, /* action */ - 1, /* notice */ - argv[arg_target], - is_channel, - ptr_message); + list_size = weechat_arraylist_size (list_messages); + for (i = 0; i < list_size; i++) + { + ptr_message = (const char *)weechat_arraylist_get (list_messages, i); + irc_input_user_message_display ( + ptr_server, + argv[arg_target], + NULL, /* address */ + "notice", + NULL, /* ctcp_type */ + ptr_message, + 1); /* decode_colors */ + } } weechat_arraylist_free (list_messages); } @@ -4516,9 +4434,18 @@ IRC_COMMAND_CALLBACK(query) /* display text if given */ if (argv_eol[arg_text]) { - irc_input_user_message_display (ptr_channel->buffer, - 0, 0, NULL, 0, - argv_eol[arg_text]); + /* display only if capability "echo-message" is NOT enabled */ + if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message")) + { + irc_input_user_message_display ( + ptr_server, + ptr_channel->name, + NULL, /* address */ + "privmsg", + NULL, /* ctcp_type */ + argv_eol[arg_text], + 1); /* decode_colors */ + } irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL, "PRIVMSG %s :%s", @@ -6762,6 +6689,16 @@ void irc_command_init () { weechat_hook_command ( + "action", + N_("send a CTCP action to a nick or channel"), + N_("[-server <server>] <target>[,<target>...] <text>"), + N_("server: send to this server (internal name)\n" + "target: nick or channel (may be mask, '*' = current channel)\n" + " text: text to send"), + "-server %(irc_servers) %(nicks)|*" + " || %(nicks)|*", + &irc_command_action, NULL, NULL); + weechat_hook_command ( "admin", N_("find information about the administrator of the server"), N_("[<target>]"), diff --git a/src/plugins/irc/irc-ctcp.c b/src/plugins/irc/irc-ctcp.c index 92e50dfa3..0deeb6017 100644 --- a/src/plugins/irc/irc-ctcp.c +++ b/src/plugins/irc/irc-ctcp.c @@ -33,6 +33,7 @@ #include "irc-channel.h" #include "irc-color.h" #include "irc-config.h" +#include "irc-input.h" #include "irc-msgbuffer.h" #include "irc-nick.h" #include "irc-protocol.h" @@ -1291,104 +1292,6 @@ irc_ctcp_recv (struct t_irc_server *server, time_t date, } /* - * Displays an outgoing CTCP. - */ - -void -irc_ctcp_display_send (struct t_irc_server *server, - struct t_irc_channel *channel, - const char *target, const char *address, - const char *type, const char *args) -{ - struct t_irc_nick *ptr_nick; - int is_channel; - - if (weechat_strcasecmp (type, "action") == 0) - { - if (!channel || irc_server_prefix_char_statusmsg (server, target[0])) - { - /* no buffer or STATUSMSG action */ - is_channel = ((irc_server_prefix_char_statusmsg (server, target[0]) - && irc_channel_is_channel (server, target + 1)) - || irc_channel_is_channel (server, target)); - ptr_nick = irc_nick_search (server, channel, server->nick); - weechat_printf_date_tags ( - (channel) ? channel->buffer : irc_msgbuffer_get_target_buffer ( - server, target, NULL, "ctcp", NULL), - 0, - irc_protocol_tags ( - server, - "privmsg", - NULL, - "irc_action,self_msg,notify_none,no_highlight", - server->nick, - address), - "%s%s -> %s%s%s: %s%s%s%s%s%s", - weechat_prefix ("network"), - /* TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me */ - _("Action"), - (is_channel) ? - IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (server, 0, NULL, target), - target, - IRC_COLOR_RESET, - irc_nick_mode_for_display (server, ptr_nick, 0), - IRC_COLOR_CHAT_NICK_SELF, - server->nick, - (args && args[0]) ? IRC_COLOR_RESET : "", - (args && args[0]) ? " " : "", - (args && args[0]) ? args : ""); - } - else - { - /* standard action */ - weechat_printf_date_tags ( - (channel) ? channel->buffer : irc_msgbuffer_get_target_buffer ( - server, target, NULL, "ctcp", NULL), - 0, - irc_protocol_tags ( - server, - "privmsg", - NULL, - "irc_action,self_msg,notify_none,no_highlight", - server->nick, - address), - "%s%s%s%s%s%s", - weechat_prefix ("action"), - IRC_COLOR_CHAT_NICK_SELF, - server->nick, - (args && args[0]) ? IRC_COLOR_RESET : "", - (args && args[0]) ? " " : "", - (args && args[0]) ? args : ""); - } - } - else - { - weechat_printf_date_tags ( - irc_msgbuffer_get_target_buffer ( - server, target, NULL, "ctcp", NULL), - 0, - irc_protocol_tags ( - server, - "privmsg", - NULL, - "irc_ctcp,self_msg,notify_none,no_highlight", - NULL, - address), - _("%sCTCP query to %s%s%s: %s%s%s%s%s"), - weechat_prefix ("network"), - (channel) ? - IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (server, 0, NULL, target), - target, - IRC_COLOR_RESET, - IRC_COLOR_CHAT_CHANNEL, - type, - IRC_COLOR_RESET, - (args && args[0]) ? " " : "", - (args && args[0]) ? args : ""); - } -} - -/* * Sends a CTCP to a target. */ diff --git a/src/plugins/irc/irc-ctcp.h b/src/plugins/irc/irc-ctcp.h index 830bd038a..57a7ecb67 100644 --- a/src/plugins/irc/irc-ctcp.h +++ b/src/plugins/irc/irc-ctcp.h @@ -49,10 +49,6 @@ extern void irc_ctcp_recv (struct t_irc_server *server, time_t date, const char *address, const char *nick, const char *remote_nick, const char *arguments, const char *message); -extern void irc_ctcp_display_send (struct t_irc_server *server, - struct t_irc_channel *channel, - const char *target, const char *address, - const char *type, const char *args); extern void irc_ctcp_send (struct t_irc_server *server, const char *target, const char *type, const char *args); diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c index 2c4e244e2..78fe45aa5 100644 --- a/src/plugins/irc/irc-input.c +++ b/src/plugins/irc/irc-input.c @@ -28,9 +28,11 @@ #include "irc-buffer.h" #include "irc-server.h" #include "irc-channel.h" +#include "irc-message.h" #include "irc-nick.h" #include "irc-color.h" #include "irc-config.h" +#include "irc-msgbuffer.h" #include "irc-protocol.h" #include "irc-raw.h" @@ -42,170 +44,272 @@ * If action == 0, but message is detected as an action (beginning with * "\01ACTION "), then action is forced. * - * If notice == 1, the message is a notice, otherwise it's a privmsg. - * - * If target is NULL, the message is displayed like this (standard message - * then action): + * If target is a channel or a nick, the message is displayed like this + * (message, action): * * nick | test * * | nick is testing * - * If target is not NULL, the message is displayed with the target, like this - * (privmsg then notice): + * If target is a channel with STATUSMSG (for example "@#test"), the message + * is displayed with the target, like this (message, action, notice): * * Msg(nick) -> @#test: test message for ops + * Action -> @#test: nick is testing * Notice(nick) -> @#test: test notice for ops */ void -irc_input_user_message_display (struct t_gui_buffer *buffer, - int action, int notice, - const char *target, int target_is_channel, - const char *text) +irc_input_user_message_display (struct t_irc_server *server, + const char *target, + const char *address, + const char *command, + const char *ctcp_type, + const char *text, + int decode_colors) { + struct t_irc_channel *ptr_channel; + struct t_gui_buffer *ptr_buffer; struct t_irc_nick *ptr_nick; - char *pos, *text2, *text_decoded, str_tags[256], *str_color; + const char *ptr_target; + char *pos, *text2, *text3, *text_decoded, str_tags[256], *str_color; const char *ptr_text; + int is_notice, is_action, is_channel, display_target; - if (!buffer || !text) + if (!server || !target) return; - IRC_BUFFER_GET_SERVER_CHANNEL(buffer); + is_notice = (weechat_strcasecmp (command, "notice") == 0); + is_action = (ctcp_type && (weechat_strcasecmp (ctcp_type, "action") == 0)); - /* - * if capability "echo-message" is enabled, we don't display anything, - * the message will be displayed when server sends it back to us - */ - if (weechat_hashtable_has_key (ptr_server->cap_list, "echo-message")) - return; + is_channel = 0; + ptr_channel = NULL; + display_target = is_notice || (ctcp_type && !is_action); + ptr_target = target; + if (irc_server_prefix_char_statusmsg (server, target[0]) + && irc_channel_is_channel (server, target + 1)) + { + ptr_channel = irc_channel_search (server, target + 1); + is_channel = 1; + display_target = 1; + ptr_target = target + 1; + } + else + { + ptr_channel = irc_channel_search (server, target); + if (irc_channel_is_channel (server, target)) + is_channel = 1; + } - /* if message is an action, force "action" to 1 and extract message */ - if (strncmp (text, "\01ACTION ", 8) == 0) + if (ptr_channel) { - action = 1; - pos = strrchr (text + 8, '\01'); - if (pos) - text2 = weechat_strndup (text + 8, pos - text - 8); - else - text2 = strdup (text + 8); + ptr_buffer = ptr_channel->buffer; } else - text2 = strdup (text); + { + ptr_buffer = irc_msgbuffer_get_target_buffer ( + server, ptr_target, command, NULL, NULL); + if (!ptr_buffer) + ptr_buffer = server->buffer; + } - text_decoded = irc_color_decode ( - (text2) ? text2 : text, - weechat_config_boolean (irc_config_network_colors_send)); + if (ptr_buffer == server->buffer) + display_target = 1; - if (ptr_channel) + /* if message is an action, force "action" to 1 and extract message */ + if (text) { - ptr_nick = NULL; - if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL) + if (strncmp (text, "\01ACTION ", 8) == 0) + { + is_action = 1; + pos = strrchr (text + 8, '\01'); + if (pos) + text2 = weechat_strndup (text + 8, pos - text - 8); + else + text2 = strdup (text + 8); + } + else { - ptr_nick = irc_nick_search (ptr_server, ptr_channel, - ptr_server->nick); + text2 = strdup (text); } + text3 = irc_message_hide_password (server, target, (text2) ? text2 : text); + text_decoded = (decode_colors) ? + irc_color_decode ( + (text3) ? text3 : ((text2) ? text2 : text), + weechat_config_boolean (irc_config_network_colors_send)) : NULL; + } + else + { + text2 = NULL; + text3 = NULL; + text_decoded = NULL; + } + + ptr_nick = NULL; + if (ptr_channel && (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)) + ptr_nick = irc_nick_search (server, ptr_channel, server->nick); - if (action) + if (is_action) + { + snprintf (str_tags, sizeof (str_tags), + "irc_action,self_msg,notify_none,no_highlight"); + } + else + { + if (display_target) { snprintf (str_tags, sizeof (str_tags), - "irc_action,self_msg,notify_none,no_highlight"); + "%sself_msg,notify_none,no_highlight", + (ctcp_type) ? "irc_ctcp," : ""); } else { str_color = irc_color_for_tags ( weechat_config_color ( weechat_config_get ("weechat.color.chat_nick_self"))); - if (target) - { - snprintf (str_tags, sizeof (str_tags), - "self_msg,notify_none,no_highlight"); - } - else - { - snprintf (str_tags, sizeof (str_tags), - "self_msg,notify_none,no_highlight,prefix_nick_%s", - (str_color) ? str_color : "default"); - } + snprintf (str_tags, sizeof (str_tags), + "%sself_msg,notify_none,no_highlight,prefix_nick_%s", + (ctcp_type) ? "irc_ctcp," : "", + (str_color) ? str_color : "default"); if (str_color) free (str_color); } - ptr_text = (text_decoded) ? text_decoded : ((text2) ? text2 : text); - if (action) - { - weechat_printf_date_tags ( - buffer, - 0, - irc_protocol_tags ( - ptr_server, - (notice) ? "notice" : "privmsg", - NULL, - str_tags, - (ptr_nick) ? ptr_nick->name : ptr_server->nick, - NULL), - "%s%s%s%s%s %s", - weechat_prefix ("action"), - irc_nick_mode_for_display (ptr_server, ptr_nick, 0), - IRC_COLOR_CHAT_NICK_SELF, - ptr_server->nick, - IRC_COLOR_RESET, - ptr_text); - } - else if (target) + } + + ptr_text = (text_decoded) ? + text_decoded : ((text3) ? text3 : ((text2) ? text2 : text)); + + if (is_action) + { + if (display_target) { weechat_printf_date_tags ( - buffer, + ptr_buffer, 0, irc_protocol_tags ( - ptr_server, - (notice) ? "notice" : "privmsg", + server, + command, NULL, str_tags, - (ptr_nick) ? ptr_nick->name : ptr_server->nick, - NULL), - "%s%s%s%s%s(%s%s%s%s)%s -> %s%s%s: %s", + (ptr_nick) ? ptr_nick->name : server->nick, + address), + "%s%s -> %s%s%s: %s%s%s%s%s%s", weechat_prefix ("network"), - (notice) ? IRC_COLOR_NOTICE : "", - (notice) ? - /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ - _("Notice") : - "Msg", - (notice) ? IRC_COLOR_RESET : "", - IRC_COLOR_CHAT_DELIMITERS, - irc_nick_mode_for_display (ptr_server, ptr_nick, 0), - IRC_COLOR_CHAT_NICK_SELF, - ptr_server->nick, - IRC_COLOR_CHAT_DELIMITERS, - IRC_COLOR_RESET, - (target_is_channel) ? - IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (ptr_server, 0, NULL, target), + /* TRANSLATORS: "Action" is an IRC CTCP "ACTION" sent with /me or /action */ + _("Action"), + (is_channel) ? + IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (server, 0, NULL, target), target, IRC_COLOR_RESET, - ptr_text); + irc_nick_mode_for_display (server, ptr_nick, 0), + IRC_COLOR_CHAT_NICK_SELF, + server->nick, + (ptr_text && ptr_text[0]) ? IRC_COLOR_RESET : "", + (ptr_text && ptr_text[0]) ? " " : "", + (ptr_text && ptr_text[0]) ? ptr_text : ""); } else { weechat_printf_date_tags ( - buffer, + ptr_buffer, 0, irc_protocol_tags ( - ptr_server, - "privmsg", + server, + command, NULL, str_tags, - (ptr_nick) ? ptr_nick->name : ptr_server->nick, - NULL), - "%s%s", - irc_nick_as_prefix ( - ptr_server, - (ptr_nick) ? ptr_nick : NULL, - (ptr_nick) ? NULL : ptr_server->nick, - IRC_COLOR_CHAT_NICK_SELF), - ptr_text); + (ptr_nick) ? ptr_nick->name : server->nick, + address), + "%s%s%s%s%s%s%s", + weechat_prefix ("action"), + irc_nick_mode_for_display (server, ptr_nick, 0), + IRC_COLOR_CHAT_NICK_SELF, + server->nick, + IRC_COLOR_RESET, + (ptr_text && ptr_text[0]) ? " " : "", + (ptr_text && ptr_text[0]) ? ptr_text : ""); } } + else if (ctcp_type) + { + weechat_printf_date_tags ( + ptr_buffer, + 0, + irc_protocol_tags ( + server, + command, + NULL, + str_tags, + (ptr_nick) ? ptr_nick->name : server->nick, + address), + _("%sCTCP query to %s%s%s: %s%s%s%s%s"), + weechat_prefix ("network"), + (is_channel) ? + IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (server, 0, NULL, target), + target, + IRC_COLOR_RESET, + IRC_COLOR_CHAT_CHANNEL, + ctcp_type, + IRC_COLOR_RESET, + (ptr_text && ptr_text[0]) ? " " : "", + (ptr_text && ptr_text[0]) ? ptr_text : ""); + } + else if (display_target) + { + weechat_printf_date_tags ( + ptr_buffer, + 0, + irc_protocol_tags ( + server, + command, + NULL, + str_tags, + (ptr_nick) ? ptr_nick->name : server->nick, + address), + "%s%s%s%s%s(%s%s%s%s)%s -> %s%s%s: %s", + weechat_prefix ("network"), + (is_notice) ? IRC_COLOR_NOTICE : "", + (is_notice) ? + /* TRANSLATORS: "Notice" is command name in IRC protocol (translation is frequently the same word) */ + _("Notice") : + "Msg", + (is_notice) ? IRC_COLOR_RESET : "", + IRC_COLOR_CHAT_DELIMITERS, + irc_nick_mode_for_display (server, ptr_nick, 0), + IRC_COLOR_CHAT_NICK_SELF, + server->nick, + IRC_COLOR_CHAT_DELIMITERS, + IRC_COLOR_RESET, + (is_channel) ? + IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (server, 0, NULL, target), + target, + IRC_COLOR_RESET, + (ptr_text) ? ptr_text : ""); + } + else + { + weechat_printf_date_tags ( + ptr_buffer, + 0, + irc_protocol_tags ( + server, + command, + NULL, + str_tags, + (ptr_nick) ? ptr_nick->name : server->nick, + address), + "%s%s", + irc_nick_as_prefix ( + server, + (ptr_nick) ? ptr_nick : NULL, + (ptr_nick) ? NULL : server->nick, + IRC_COLOR_CHAT_NICK_SELF), + (ptr_text) ? ptr_text : ""); + } if (text2) free (text2); + if (text3) + free (text3); if (text_decoded) free (text_decoded); } @@ -243,17 +347,22 @@ irc_input_send_user_message (struct t_gui_buffer *buffer, int flags, ptr_channel->name, message); if (list_messages) { - action = (strncmp (message, "\01ACTION ", 8) == 0); - list_size = weechat_arraylist_size (list_messages); - for (i = 0; i < list_size; i++) + /* display only if capability "echo-message" is NOT enabled */ + if (!weechat_hashtable_has_key (ptr_server->cap_list, "echo-message")) { - irc_input_user_message_display ( - buffer, - action, - 0, /* notice */ - NULL, /* target */ - 0, /* target_is_channel */ - (const char *)weechat_arraylist_get (list_messages, i)); + action = (strncmp (message, "\01ACTION ", 8) == 0); + list_size = weechat_arraylist_size (list_messages); + for (i = 0; i < list_size; i++) + { + irc_input_user_message_display ( + ptr_server, + ptr_channel->name, + NULL, /* address */ + "privmsg", + (action) ? "action" : NULL, + (const char *)weechat_arraylist_get (list_messages, i), + 1); /* decode_colors */ + } } weechat_arraylist_free (list_messages); } diff --git a/src/plugins/irc/irc-input.h b/src/plugins/irc/irc-input.h index fef8e93e7..f4f43c139 100644 --- a/src/plugins/irc/irc-input.h +++ b/src/plugins/irc/irc-input.h @@ -22,11 +22,13 @@ struct t_gui_buffer; -extern void irc_input_user_message_display (struct t_gui_buffer *buffer, - int action, int notice, +extern void irc_input_user_message_display (struct t_irc_server *server, const char *target, - int target_is_channel, - const char *text); + const char *address, + const char *command, + const char *ctcp_type, + const char *text, + int decode_colors); extern int irc_input_data_cb (const void *pointer, void *data, struct t_gui_buffer *buffer, const char *input_data); diff --git a/src/plugins/irc/irc-message.c b/src/plugins/irc/irc-message.c index d6fc572b0..a44b0f080 100644 --- a/src/plugins/irc/irc-message.c +++ b/src/plugins/irc/irc-message.c @@ -894,6 +894,47 @@ irc_message_replace_vars (struct t_irc_server *server, } /* + * Hides password in text, if the target is a nick configured in option + * irc.look.nicks_hide_password. + * + * Note: result must be freed after use. + */ + +char * +irc_message_hide_password (struct t_irc_server *server, const char *target, + const char *text) +{ + int i, hide_password; + + if (!text) + return NULL; + + /* check if the password must be hidden for this nick */ + hide_password = 0; + if (irc_config_nicks_hide_password) + { + for (i = 0; i < irc_config_num_nicks_hide_password; i++) + { + if (weechat_strcasecmp (irc_config_nicks_hide_password[i], + target) == 0) + { + hide_password = 1; + break; + } + } + } + + /* hide password in message displayed using modifier */ + if (hide_password) + { + return weechat_hook_modifier_exec ("irc_message_auth", server->name, + text); + } + + return strdup (text); +} + +/* * Adds a message + arguments in hashtable. */ diff --git a/src/plugins/irc/irc-message.h b/src/plugins/irc/irc-message.h index b0670fba5..5b73d4565 100644 --- a/src/plugins/irc/irc-message.h +++ b/src/plugins/irc/irc-message.h @@ -58,6 +58,8 @@ extern int irc_message_ignored (struct t_irc_server *server, extern char *irc_message_replace_vars (struct t_irc_server *server, const char *channel_name, const char *string); +extern char *irc_message_hide_password (struct t_irc_server *server, + const char *target, const char *text); extern struct t_hashtable *irc_message_split (struct t_irc_server *server, const char *message); diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index e62ad6d1e..951239815 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -49,6 +49,7 @@ #include "irc-config.h" #include "irc-ctcp.h" #include "irc-ignore.h" +#include "irc-input.h" #include "irc-join.h" #include "irc-message.h" #include "irc-mode.h" @@ -2959,7 +2960,6 @@ IRC_PROTOCOL_CALLBACK(pong) void irc_protocol_privmsg_display_ctcp_send (struct t_irc_server *server, - struct t_irc_channel *channel, const char *target, const char *address, const char *arguments) @@ -2983,7 +2983,14 @@ irc_protocol_privmsg_display_ctcp_send (struct t_irc_server *server, ctcp_args = (pos_space) ? weechat_strndup (pos_space + 1, pos_end - pos_space - 1) : NULL; - irc_ctcp_display_send (server, channel, target, address, ctcp_type, ctcp_args); + irc_input_user_message_display ( + server, + target, + address, + "privmsg", + ctcp_type, + ctcp_args, + 0); /* decode_colors */ if (ctcp_type) free (ctcp_type); @@ -3055,7 +3062,7 @@ IRC_PROTOCOL_CALLBACK(privmsg) if (nick_is_me) { irc_protocol_privmsg_display_ctcp_send ( - server, ptr_channel, params[0], address, msg_args); + server, params[0], address, msg_args); } else { @@ -3163,7 +3170,7 @@ IRC_PROTOCOL_CALLBACK(privmsg) if (nick_is_me) { irc_protocol_privmsg_display_ctcp_send ( - server, ptr_channel, remote_nick, address, msg_args); + server, remote_nick, address, msg_args); } else { diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp index 73b829c21..11ade2058 100644 --- a/tests/unit/plugins/irc/test-irc-protocol.cpp +++ b/tests/unit/plugins/irc/test-irc-protocol.cpp @@ -630,12 +630,24 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage) "irc_privmsg,self_msg,notify_none,no_highlight,prefix_nick_white," "nick_alice,log1"); + /* message to channel (with /msg <channel>), channel not joined */ + server_input_data (buffer_server, "/msg #zzz msg chan not joined"); + CHECK_SENT("PRIVMSG #zzz :msg chan not joined"); + CHECK_SRV("--", "Msg(alice) -> #zzz: msg chan not joined", + "irc_privmsg,self_msg,notify_none,no_highlight,nick_alice,log1"); + /* STATUSMSG message to channel (with /msg @<channel>) */ server_input_data (buffer_server, "/msg @#test msg chan ops"); CHECK_SENT("PRIVMSG @#test :msg chan ops"); CHECK_CHAN("--", "Msg(alice) -> @#test: msg chan ops", "irc_privmsg,self_msg,notify_none,no_highlight,nick_alice,log1"); + /* STATUSMSG message to channel (with /msg @<channel>), channel not joined */ + server_input_data (buffer_server, "/msg @#zzz msg chan ops not joined"); + CHECK_SENT("PRIVMSG @#zzz :msg chan ops not joined"); + CHECK_SRV("--", "Msg(alice) -> @#zzz: msg chan ops not joined", + "irc_privmsg,self_msg,notify_none,no_highlight,nick_alice,log1"); + /* message to a nick (text in private buffer) */ server_input_data (buffer_pv, "msg pv 1"); CHECK_SENT("PRIVMSG bob :msg pv 1"); @@ -650,6 +662,26 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage) "irc_privmsg,self_msg,notify_none,no_highlight,prefix_nick_white," "nick_alice,log1"); + /* message to a nick (with /msg <nick>), hidden password */ + server_input_data (buffer_server, "/msg nickserv identify secret"); + CHECK_SENT("PRIVMSG nickserv :identify secret"); + CHECK_SRV("--", "Msg(alice) -> nickserv: identify ******", + "irc_privmsg,self_msg,notify_none,no_highlight,nick_alice,log1"); + + /* message to a nick (with /query <nick>) */ + server_input_data (buffer_server, "/query bob msg pv 3"); + CHECK_SENT("PRIVMSG bob :msg pv 3"); + CHECK_PV("bob", "alice", "msg pv 3", + "irc_privmsg,self_msg,notify_none,no_highlight,prefix_nick_white," + "nick_alice,log1"); + + /* message to a nick (with /query <nick>), private buffer does not exist */ + server_input_data (buffer_server, "/query bob_query msg pv 4"); + CHECK_SENT("PRIVMSG bob_query :msg pv 4"); + CHECK_PV("bob_query", "alice", "msg pv 4", + "irc_privmsg,self_msg,notify_none,no_highlight,prefix_nick_white," + "nick_alice,log1"); + /* notice to channel */ server_input_data (buffer_server, "/notice #test notice chan"); CHECK_SENT("NOTICE #test :notice chan"); @@ -682,13 +714,48 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage) "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," "nick_alice,log1"); - /* action on channel (with /ctcp <channel> action) */ - server_input_data (buffer_server, "/ctcp #test action action chan 2"); + /* action on channel (with /action *) */ + server_input_data (buffer_chan, "/action * action chan 2"); CHECK_SENT("PRIVMSG #test :\01ACTION action chan 2\01"); CHECK_CHAN(" *", "alice action chan 2", "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," "nick_alice,log1"); + /* action on channel (with /action <channel>) */ + server_input_data (buffer_server, "/action #test action chan 3"); + CHECK_SENT("PRIVMSG #test :\01ACTION action chan 3\01"); + CHECK_CHAN(" *", "alice action chan 3", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,log1"); + + /* action on channel (with /action <channel>), no message */ + server_input_data (buffer_chan, "/action #test"); + CHECK_SENT("PRIVMSG #test :\01ACTION\01"); + CHECK_CHAN(" *", "alice", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,log1"); + + /* STATUSMSG action on channel (with /action @<channel>) */ + server_input_data (buffer_server, "/action @#test action chan 4"); + CHECK_SENT("PRIVMSG @#test :\01ACTION action chan 4\01"); + CHECK_CHAN("--", "Action -> @#test: alice action chan 4", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,log1"); + + /* STATUSMSG action on channel (with /action @<channel>), no message */ + server_input_data (buffer_server, "/action @#test"); + CHECK_SENT("PRIVMSG @#test :\01ACTION\01"); + CHECK_CHAN("--", "Action -> @#test: alice", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,log1"); + + /* action on channel (with /ctcp <channel> action) */ + server_input_data (buffer_server, "/ctcp #test action action chan 5"); + CHECK_SENT("PRIVMSG #test :\01ACTION action chan 5\01"); + CHECK_CHAN(" *", "alice action chan 5", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,log1"); + /* action on channel (with /ctcp <channel> action), no message */ server_input_data (buffer_server, "/ctcp #test action"); CHECK_SENT("PRIVMSG #test :\01ACTION\01"); @@ -727,26 +794,37 @@ TEST(IrcProtocolWithServer, SendMessagesWithoutEchoMessage) /* CTCP version to channel */ server_input_data (buffer_server, "/ctcp #test version"); CHECK_SENT("PRIVMSG #test :\01VERSION\01"); - CHECK_SRV("--", "CTCP query to #test: VERSION", - "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight,log1"); + CHECK_CHAN("--", "CTCP query to #test: VERSION", + "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," + "nick_alice,log1"); /* unknown CTCP to channel */ server_input_data (buffer_server, "/ctcp #test unknown1 some args"); CHECK_SENT("PRIVMSG #test :\01UNKNOWN1 some args\01"); - CHECK_SRV("--", "CTCP query to #test: UNKNOWN1 some args", - "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight,log1"); + CHECK_CHAN("--", "CTCP query to #test: UNKNOWN1 some args", + "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," + "nick_alice,log1"); /* CTCP version to nick */ server_input_data (buffer_server, "/ctcp bob version"); CHECK_SENT("PRIVMSG bob :\01VERSION\01"); - CHECK_SRV("--", "CTCP query to bob: VERSION", - "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight,log1"); + CHECK_PV("bob", "--", "CTCP query to bob: VERSION", + "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," + "nick_alice,log1"); + + /* CTCP version to other nick (no private buffer) */ + server_input_data (buffer_server, "/ctcp other_nick version"); + CHECK_SENT("PRIVMSG other_nick :\01VERSION\01"); + CHECK_SRV("--", "CTCP query to other_nick: VERSION", + "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," + "nick_alice,log1"); /* unknown CTCP to nick */ server_input_data (buffer_server, "/ctcp bob unknown2 some args"); CHECK_SENT("PRIVMSG bob :\01UNKNOWN2 some args\01"); - CHECK_SRV("--", "CTCP query to bob: UNKNOWN2 some args", - "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight,log1"); + CHECK_PV("bob", "--", "CTCP query to bob: UNKNOWN2 some args", + "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," + "nick_alice,log1"); } /* @@ -782,11 +860,21 @@ TEST(IrcProtocolWithServer, SendMessagesWithEchoMessage) CHECK_SENT("PRIVMSG #test :msg chan 2"); CHECK_NO_MSG; + /* message to channel (with /msg <channel>), channel not joined */ + server_input_data (buffer_server, "/msg #zzz msg chan not joined"); + CHECK_SENT("PRIVMSG #zzz :msg chan not joined"); + CHECK_NO_MSG; + /* STATUSMSG message to channel (with /msg @<channel>) */ server_input_data (buffer_server, "/msg @#test msg chan ops"); CHECK_SENT("PRIVMSG @#test :msg chan ops"); CHECK_NO_MSG; + /* STATUSMSG message to channel (with /msg @<channel>), channel not joined */ + server_input_data (buffer_server, "/msg @#zzz msg chan ops not joined"); + CHECK_SENT("PRIVMSG @#zzz :msg chan ops not joined"); + CHECK_NO_MSG; + /* message to a nick (text in private buffer) */ server_input_data (buffer_pv, "msg pv 1"); CHECK_SENT("PRIVMSG bob :msg pv 1"); @@ -797,6 +885,21 @@ TEST(IrcProtocolWithServer, SendMessagesWithEchoMessage) CHECK_SENT("PRIVMSG bob :msg pv 2"); CHECK_NO_MSG; + /* message to a nick (with /msg <nick>), hidden password */ + server_input_data (buffer_server, "/msg nickserv identify secret"); + CHECK_SENT("PRIVMSG nickserv :identify secret"); + CHECK_NO_MSG; + + /* message to a nick (with /query <nick>) */ + server_input_data (buffer_server, "/query bob msg pv 3"); + CHECK_SENT("PRIVMSG bob :msg pv 3"); + CHECK_NO_MSG; + + /* message to a nick (with /query <nick>), private buffer does not exist */ + server_input_data (buffer_server, "/query bob_query msg pv 4"); + CHECK_SENT("PRIVMSG bob_query :msg pv 4"); + CHECK_NO_MSG; + /* notice to channel */ server_input_data (buffer_server, "/notice #test notice chan"); CHECK_SENT("NOTICE #test :notice chan"); @@ -822,11 +925,36 @@ TEST(IrcProtocolWithServer, SendMessagesWithEchoMessage) CHECK_SENT("PRIVMSG #test :\01ACTION\01"); CHECK_NO_MSG; - /* action on channel (with /ctcp <channel> action) */ - server_input_data (buffer_server, "/ctcp #test action action chan 2"); + /* action on channel (with /action *) */ + server_input_data (buffer_chan, "/action * action chan 2"); CHECK_SENT("PRIVMSG #test :\01ACTION action chan 2\01"); CHECK_NO_MSG; + /* action on channel (with /action <channel>) */ + server_input_data (buffer_server, "/action #test action chan 3"); + CHECK_SENT("PRIVMSG #test :\01ACTION action chan 3\01"); + CHECK_NO_MSG; + + /* action on channel (with /action <channel>), no message */ + server_input_data (buffer_chan, "/action #test"); + CHECK_SENT("PRIVMSG #test :\01ACTION\01"); + CHECK_NO_MSG; + + /* STATUSMSG action on channel (with /action @<channel>) */ + server_input_data (buffer_server, "/action @#test action chan 4"); + CHECK_SENT("PRIVMSG @#test :\01ACTION action chan 4\01"); + CHECK_NO_MSG; + + /* STATUSMSG action on channel (with /action @<channel>), no message */ + server_input_data (buffer_server, "/action @#test"); + CHECK_SENT("PRIVMSG @#test :\01ACTION\01"); + CHECK_NO_MSG; + + /* action on channel (with /ctcp <channel> action) */ + server_input_data (buffer_server, "/ctcp #test action action chan 5"); + CHECK_SENT("PRIVMSG #test :\01ACTION action chan 5\01"); + CHECK_NO_MSG; + /* STATUSMSG action on channel (with /ctcp @<channel> action) */ server_input_data (buffer_server, "/ctcp @#test action action chan ops"); CHECK_SENT("PRIVMSG @#test :\01ACTION action chan ops\01"); @@ -862,6 +990,11 @@ TEST(IrcProtocolWithServer, SendMessagesWithEchoMessage) CHECK_SENT("PRIVMSG bob :\01VERSION\01"); CHECK_NO_MSG; + /* CTCP version to other nick (no private buffer) */ + server_input_data (buffer_server, "/ctcp other_nick version"); + CHECK_SENT("PRIVMSG other_nick :\01VERSION\01"); + CHECK_NO_MSG; + /* unknown CTCP to nick */ server_input_data (buffer_server, "/ctcp bob unknown2 some args"); CHECK_SENT("PRIVMSG bob :\01UNKNOWN2 some args\01"); @@ -2210,195 +2343,210 @@ TEST(IrcProtocolWithServer, note) TEST(IrcProtocolWithServer, notice) { + int i; + SRV_INIT_JOIN; - /* not enough parameters */ - RECV("NOTICE"); - CHECK_ERROR_PARAMS("notice", 0, 2); - RECV("NOTICE AUTH"); - CHECK_ERROR_PARAMS("notice", 1, 2); - RECV(":bob!user@host NOTICE"); - CHECK_ERROR_PARAMS("notice", 0, 2); - RECV(":bob!user@host NOTICE #test"); - CHECK_ERROR_PARSE("notice", ":bob!user@host NOTICE #test"); - RECV(":bob!user@host NOTICE alice"); - CHECK_ERROR_PARSE("notice", ":bob!user@host NOTICE alice"); - - /* notice from server */ - RECV("NOTICE AUTH :*** Looking up your hostname... "); - CHECK_SRV("--", "*** Looking up your hostname... ", "irc_notice,log1"); - RECV(":server.address NOTICE AUTH :*** Looking up your hostname... "); - CHECK_SRV("--", "server.address: *** Looking up your hostname... ", - "irc_notice,notify_private,nick_server.address,log1"); - RECV(":server.address NOTICE * :*** Looking up your hostname... "); - CHECK_SRV("--", "server.address: *** Looking up your hostname... ", - "irc_notice,notify_private,nick_server.address,log1"); - - /* notice to channel/user */ - RECV(":server.address NOTICE #test :a notice "); - CHECK_CHAN("--", "Notice(server.address) -> #test: a notice ", - "irc_notice,notify_message,nick_server.address,log1"); - RECV(":server.address NOTICE alice :a notice "); - CHECK_SRV("--", "server.address: a notice ", - "irc_notice,notify_private,nick_server.address,log1"); - RECV(":bob!user@host NOTICE #test :a notice "); - CHECK_CHAN("--", "Notice(bob) -> #test: a notice ", - "irc_notice,notify_message,nick_bob,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :a notice "); - CHECK_SRV("--", "bob (user@host): a notice ", - "irc_notice,notify_private,nick_bob,host_user@host,log1"); + /* test without and with capability "echo-message" */ + for (i = 0; i < 2; i++) + { + if (i == 1) + { + /* assume "echo-message" capability is enabled in server */ + hashtable_set (ptr_server->cap_list, "echo-message", NULL); + } - /* - * notice to channel/user from self nick - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host NOTICE #test :a notice "); - CHECK_CHAN("--", "Notice(alice) -> #test: a notice ", - "irc_notice,self_msg,notify_none,no_highlight,nick_alice," - "host_user@host,log1"); - - /* notice to ops of channel */ - RECV(":server.address NOTICE @#test :a notice "); - CHECK_CHAN("--", "Notice(server.address) -> @#test: a notice ", - "irc_notice,notify_message,nick_server.address,log1"); - RECV(":bob!user@host NOTICE @#test :a notice "); - CHECK_CHAN("--", "Notice(bob) -> @#test: a notice ", - "irc_notice,notify_message,nick_bob,host_user@host,log1"); + /* not enough parameters */ + RECV("NOTICE"); + CHECK_ERROR_PARAMS("notice", 0, 2); + RECV("NOTICE AUTH"); + CHECK_ERROR_PARAMS("notice", 1, 2); + RECV(":bob!user@host NOTICE"); + CHECK_ERROR_PARAMS("notice", 0, 2); + RECV(":bob!user@host NOTICE #test"); + CHECK_ERROR_PARSE("notice", ":bob!user@host NOTICE #test"); + RECV(":bob!user@host NOTICE alice"); + CHECK_ERROR_PARSE("notice", ":bob!user@host NOTICE alice"); + + /* notice from server */ + RECV("NOTICE AUTH :*** Looking up your hostname... "); + CHECK_SRV("--", "*** Looking up your hostname... ", "irc_notice,log1"); + RECV(":server.address NOTICE AUTH :*** Looking up your hostname... "); + CHECK_SRV("--", "server.address: *** Looking up your hostname... ", + "irc_notice,notify_private,nick_server.address,log1"); + RECV(":server.address NOTICE * :*** Looking up your hostname... "); + CHECK_SRV("--", "server.address: *** Looking up your hostname... ", + "irc_notice,notify_private,nick_server.address,log1"); + + /* notice to channel/user */ + RECV(":server.address NOTICE #test :a notice "); + CHECK_CHAN("--", "Notice(server.address) -> #test: a notice ", + "irc_notice,notify_message,nick_server.address,log1"); + RECV(":server.address NOTICE alice :a notice "); + CHECK_SRV("--", "server.address: a notice ", + "irc_notice,notify_private,nick_server.address,log1"); + RECV(":bob!user@host NOTICE #test :a notice "); + CHECK_CHAN("--", "Notice(bob) -> #test: a notice ", + "irc_notice,notify_message,nick_bob,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :a notice "); + CHECK_SRV("--", "bob (user@host): a notice ", + "irc_notice,notify_private,nick_bob,host_user@host,log1"); - /* - * notice to ops of channel from self nick - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host NOTICE @#test :a notice "); - CHECK_CHAN("--", "Notice(alice) -> @#test: a notice ", - "irc_notice,self_msg,notify_none,no_highlight,nick_alice," - "host_user@host,log1"); + /* + * notice to channel/user from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host NOTICE #test :a notice "); + CHECK_CHAN("--", "Notice(alice) -> #test: a notice ", + "irc_notice,self_msg,notify_none,no_highlight,nick_alice," + "host_user@host,log1"); + + /* notice to ops of channel */ + RECV(":server.address NOTICE @#test :a notice "); + CHECK_CHAN("--", "Notice(server.address) -> @#test: a notice ", + "irc_notice,notify_message,nick_server.address,log1"); + RECV(":bob!user@host NOTICE @#test :a notice "); + CHECK_CHAN("--", "Notice(bob) -> @#test: a notice ", + "irc_notice,notify_message,nick_bob,host_user@host,log1"); - /* - * notice from self nick - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host NOTICE alice :a notice "); - CHECK_SRV("--", "Notice -> alice: a notice ", - "irc_notice,notify_private,nick_alice,host_user@host,log1"); - - /* notice with channel name at beginning */ - RECV(":server.address NOTICE alice :[#test] a notice "); - CHECK_CHAN("--", "PvNotice(server.address): a notice ", - "irc_notice,nick_server.address,log1"); - RECV(":server.address NOTICE alice :(#test) a notice "); - CHECK_CHAN("--", "PvNotice(server.address): a notice ", - "irc_notice,nick_server.address,log1"); - RECV(":server.address NOTICE alice :{#test} a notice "); - CHECK_CHAN("--", "PvNotice(server.address): a notice ", - "irc_notice,nick_server.address,log1"); - RECV(":server.address NOTICE alice :<#test> a notice "); - CHECK_CHAN("--", "PvNotice(server.address): a notice ", - "irc_notice,nick_server.address,log1"); - RECV(":bob!user@host NOTICE alice :[#test] a notice "); - CHECK_CHAN("--", "PvNotice(bob): a notice ", - "irc_notice,nick_bob,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :(#test) a notice "); - CHECK_CHAN("--", "PvNotice(bob): a notice ", - "irc_notice,nick_bob,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :{#test} a notice "); - CHECK_CHAN("--", "PvNotice(bob): a notice ", - "irc_notice,nick_bob,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :<#test> a notice "); - CHECK_CHAN("--", "PvNotice(bob): a notice ", - "irc_notice,nick_bob,host_user@host,log1"); - - /* broken CTCP to channel */ - RECV(":bob!user@host NOTICE #test :\01"); - CHECK_SRV("--", "CTCP reply from bob: ", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01TEST"); - CHECK_SRV("--", "CTCP reply from bob: TEST", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01ACTION"); - CHECK_SRV("--", "CTCP reply from bob: ACTION", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01ACTION is testing"); - CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", - "irc_notice,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01VERSION"); - CHECK_SRV("--", "CTCP reply from bob: VERSION", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01DCC"); - CHECK_SRV("--", "CTCP reply from bob: DCC", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01DCC SEND"); - CHECK_SRV("--", "CTCP reply from bob: DCC SEND", - "irc_notice,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt"); - CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt", - "irc_notice,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt 1 2 3"); - CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", - "irc_notice,irc_ctcp,host_user@host,log1"); - - /* broken CTCP to user */ - RECV(":bob!user@host NOTICE alice :\01"); - CHECK_SRV("--", "CTCP reply from bob: ", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01TEST"); - CHECK_SRV("--", "CTCP reply from bob: TEST", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01ACTION"); - CHECK_SRV("--", "CTCP reply from bob: ACTION", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01ACTION is testing"); - CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", - "irc_notice,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01VERSION"); - CHECK_SRV("--", "CTCP reply from bob: VERSION", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01DCC"); - CHECK_SRV("--", "CTCP reply from bob: DCC", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01DCC SEND"); - CHECK_SRV("--", "CTCP reply from bob: DCC SEND", - "irc_notice,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt"); - CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt", - "irc_notice,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt 1 2 3"); - CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", - "irc_notice,irc_ctcp,host_user@host,log1"); - - /* valid CTCP to channel */ - RECV(":bob!user@host NOTICE #test :\01TEST\01"); - CHECK_SRV("--", "CTCP reply from bob: TEST", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01ACTION\01"); - CHECK_SRV("--", "CTCP reply from bob: ACTION", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01ACTION is testing\01"); - CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", - "irc_notice,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01VERSION\01"); - CHECK_SRV("--", "CTCP reply from bob: VERSION", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt 1 2 3\01"); - CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", - "irc_notice,irc_ctcp,host_user@host,log1"); - - /* valid CTCP to user */ - RECV(":bob!user@host NOTICE alice :\01TEST\01"); - CHECK_SRV("--", "CTCP reply from bob: TEST", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01ACTION\01"); - CHECK_SRV("--", "CTCP reply from bob: ACTION", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01ACTION is testing\01"); - CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", - "irc_notice,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01VERSION\01"); - CHECK_SRV("--", "CTCP reply from bob: VERSION", - "irc_notice,host_user@host,log1"); - RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt 1 2 3\01"); - CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", - "irc_notice,irc_ctcp,host_user@host,log1"); + /* + * notice to ops of channel from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host NOTICE @#test :a notice "); + CHECK_CHAN("--", "Notice(alice) -> @#test: a notice ", + "irc_notice,self_msg,notify_none,no_highlight,nick_alice," + "host_user@host,log1"); + + /* + * notice from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host NOTICE alice :a notice "); + CHECK_SRV("--", "Notice -> alice: a notice ", + "irc_notice,notify_private,nick_alice,host_user@host,log1"); + + /* notice with channel name at beginning */ + RECV(":server.address NOTICE alice :[#test] a notice "); + CHECK_CHAN("--", "PvNotice(server.address): a notice ", + "irc_notice,nick_server.address,log1"); + RECV(":server.address NOTICE alice :(#test) a notice "); + CHECK_CHAN("--", "PvNotice(server.address): a notice ", + "irc_notice,nick_server.address,log1"); + RECV(":server.address NOTICE alice :{#test} a notice "); + CHECK_CHAN("--", "PvNotice(server.address): a notice ", + "irc_notice,nick_server.address,log1"); + RECV(":server.address NOTICE alice :<#test> a notice "); + CHECK_CHAN("--", "PvNotice(server.address): a notice ", + "irc_notice,nick_server.address,log1"); + RECV(":bob!user@host NOTICE alice :[#test] a notice "); + CHECK_CHAN("--", "PvNotice(bob): a notice ", + "irc_notice,nick_bob,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :(#test) a notice "); + CHECK_CHAN("--", "PvNotice(bob): a notice ", + "irc_notice,nick_bob,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :{#test} a notice "); + CHECK_CHAN("--", "PvNotice(bob): a notice ", + "irc_notice,nick_bob,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :<#test> a notice "); + CHECK_CHAN("--", "PvNotice(bob): a notice ", + "irc_notice,nick_bob,host_user@host,log1"); + + /* broken CTCP to channel */ + RECV(":bob!user@host NOTICE #test :\01"); + CHECK_SRV("--", "CTCP reply from bob: ", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01TEST"); + CHECK_SRV("--", "CTCP reply from bob: TEST", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01ACTION"); + CHECK_SRV("--", "CTCP reply from bob: ACTION", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01ACTION is testing"); + CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", + "irc_notice,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01VERSION"); + CHECK_SRV("--", "CTCP reply from bob: VERSION", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01DCC"); + CHECK_SRV("--", "CTCP reply from bob: DCC", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01DCC SEND"); + CHECK_SRV("--", "CTCP reply from bob: DCC SEND", + "irc_notice,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt"); + CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt", + "irc_notice,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt 1 2 3"); + CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", + "irc_notice,irc_ctcp,host_user@host,log1"); + + /* broken CTCP to user */ + RECV(":bob!user@host NOTICE alice :\01"); + CHECK_SRV("--", "CTCP reply from bob: ", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01TEST"); + CHECK_SRV("--", "CTCP reply from bob: TEST", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01ACTION"); + CHECK_SRV("--", "CTCP reply from bob: ACTION", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01ACTION is testing"); + CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", + "irc_notice,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01VERSION"); + CHECK_SRV("--", "CTCP reply from bob: VERSION", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01DCC"); + CHECK_SRV("--", "CTCP reply from bob: DCC", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01DCC SEND"); + CHECK_SRV("--", "CTCP reply from bob: DCC SEND", + "irc_notice,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt"); + CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt", + "irc_notice,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt 1 2 3"); + CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", + "irc_notice,irc_ctcp,host_user@host,log1"); + + /* valid CTCP to channel */ + RECV(":bob!user@host NOTICE #test :\01TEST\01"); + CHECK_SRV("--", "CTCP reply from bob: TEST", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01ACTION\01"); + CHECK_SRV("--", "CTCP reply from bob: ACTION", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01ACTION is testing\01"); + CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", + "irc_notice,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01VERSION\01"); + CHECK_SRV("--", "CTCP reply from bob: VERSION", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE #test :\01DCC SEND file.txt 1 2 3\01"); + CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", + "irc_notice,irc_ctcp,host_user@host,log1"); + + /* valid CTCP to user */ + RECV(":bob!user@host NOTICE alice :\01TEST\01"); + CHECK_SRV("--", "CTCP reply from bob: TEST", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01ACTION\01"); + CHECK_SRV("--", "CTCP reply from bob: ACTION", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01ACTION is testing\01"); + CHECK_SRV("--", "CTCP reply from bob: ACTION is testing", + "irc_notice,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01VERSION\01"); + CHECK_SRV("--", "CTCP reply from bob: VERSION", + "irc_notice,host_user@host,log1"); + RECV(":bob!user@host NOTICE alice :\01DCC SEND file.txt 1 2 3\01"); + CHECK_SRV("--", "CTCP reply from bob: DCC SEND file.txt 1 2 3", + "irc_notice,irc_ctcp,host_user@host,log1"); + + if (i == 1) + hashtable_remove (ptr_server->cap_list, "echo-message"); + } } /* @@ -2517,243 +2665,265 @@ TEST(IrcProtocolWithServer, pong) TEST(IrcProtocolWithServer, privmsg) { char *info, message[1024]; + int i; SRV_INIT_JOIN2; - /* not enough parameters */ - RECV(":bob!user@host PRIVMSG"); - CHECK_ERROR_PARAMS("privmsg", 0, 2); - RECV(":bob!user@host PRIVMSG #test"); - CHECK_ERROR_PARAMS("privmsg", 1, 2); - RECV(":bob!user@host PRIVMSG alice"); - CHECK_ERROR_PARAMS("privmsg", 1, 2); - - /* missing nick */ - RECV("PRIVMSG #test :this is the message"); - CHECK_ERROR_NICK("privmsg"); - - /* message to channel/user */ - RECV(":bob!user@host PRIVMSG #test :this is the message "); - CHECK_CHAN("bob", "this is the message ", - "irc_privmsg,notify_message,prefix_nick_248,nick_bob," - "host_user@host,log1"); - RECV(":bob!user@host PRIVMSG alice :this is the message "); - CHECK_PV("bob", "bob", "this is the message ", - "irc_privmsg,notify_private,prefix_nick_248,nick_bob," - "host_user@host,log1"); + /* test without and with capability "echo-message" */ + for (i = 0; i < 2; i++) + { + if (i == 1) + { + /* assume "echo-message" capability is enabled in server */ + hashtable_set (ptr_server->cap_list, "echo-message", NULL); + } - /* message with tags to channel/user */ - RECV("@tag1=value1;tag2=value2 :bob!user@host PRIVMSG #test " - ":this is the message "); - CHECK_CHAN("bob", "this is the message ", - "irc_privmsg,irc_tag_tag1=value1,irc_tag_tag2=value2," - "notify_message,prefix_nick_248,nick_bob,host_user@host,log1"); - RECV("@tag1=value1;tag2=value2 :bob!user@host PRIVMSG alice " - ":this is the message "); - CHECK_PV("bob", "bob", "this is the message ", - "irc_privmsg,irc_tag_tag1=value1,irc_tag_tag2=value2," - "notify_private,prefix_nick_248,nick_bob,host_user@host,log1"); + /* not enough parameters */ + RECV(":bob!user@host PRIVMSG"); + CHECK_ERROR_PARAMS("privmsg", 0, 2); + RECV(":bob!user@host PRIVMSG #test"); + CHECK_ERROR_PARAMS("privmsg", 1, 2); + RECV(":bob!user@host PRIVMSG alice"); + CHECK_ERROR_PARAMS("privmsg", 1, 2); + + /* missing nick */ + RECV("PRIVMSG #test :this is the message"); + CHECK_ERROR_NICK("privmsg"); + + /* message to channel/user */ + RECV(":bob!user@host PRIVMSG #test :this is the message "); + CHECK_CHAN("bob", "this is the message ", + "irc_privmsg,notify_message,prefix_nick_248,nick_bob," + "host_user@host,log1"); + RECV(":bob!user@host PRIVMSG alice :this is the message "); + CHECK_PV("bob", "bob", "this is the message ", + "irc_privmsg,notify_private,prefix_nick_248,nick_bob," + "host_user@host,log1"); + + /* message with tags to channel/user */ + RECV("@tag1=value1;tag2=value2 :bob!user@host PRIVMSG #test " + ":this is the message "); + CHECK_CHAN("bob", "this is the message ", + "irc_privmsg,irc_tag_tag1=value1,irc_tag_tag2=value2," + "notify_message,prefix_nick_248,nick_bob,host_user@host,log1"); + RECV("@tag1=value1;tag2=value2 :bob!user@host PRIVMSG alice " + ":this is the message "); + CHECK_PV("bob", "bob", "this is the message ", + "irc_privmsg,irc_tag_tag1=value1,irc_tag_tag2=value2," + "notify_private,prefix_nick_248,nick_bob,host_user@host,log1"); - /* - * message to channel/user from self nick - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host PRIVMSG #test :this is the message "); - CHECK_CHAN("alice", "this is the message ", - "irc_privmsg,self_msg,notify_none,no_highlight," - "prefix_nick_white,nick_alice,host_user@host,log1"); + /* + * message to channel/user from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host PRIVMSG #test :this is the message "); + CHECK_CHAN("alice", "this is the message ", + "irc_privmsg,self_msg,notify_none,no_highlight," + "prefix_nick_white,nick_alice,host_user@host,log1"); - /* message to ops of channel */ - RECV(":bob!user@host PRIVMSG @#test :this is the message "); - CHECK_CHAN("--", "Msg(bob) -> @#test: this is the message ", - "irc_privmsg,notify_message,nick_bob,host_user@host,log1"); + /* message to ops of channel */ + RECV(":bob!user@host PRIVMSG @#test :this is the message "); + CHECK_CHAN("--", "Msg(bob) -> @#test: this is the message ", + "irc_privmsg,notify_message,nick_bob,host_user@host,log1"); - /* - * message to ops of channel from self nick - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host PRIVMSG @#test :this is the message "); - CHECK_CHAN("--", "Msg(alice) -> @#test: this is the message ", - "irc_privmsg,self_msg,notify_none,no_highlight,nick_alice," - "host_user@host,log1"); + /* + * message to ops of channel from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host PRIVMSG @#test :this is the message "); + CHECK_CHAN("--", "Msg(alice) -> @#test: this is the message ", + "irc_privmsg,self_msg,notify_none,no_highlight,nick_alice," + "host_user@host,log1"); - /* - * message from self nick in private - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host PRIVMSG alice :this is the message "); - CHECK_PV("alice", "alice", "this is the message ", - "irc_privmsg,self_msg,notify_none,no_highlight," - "prefix_nick_white,nick_alice,host_user@host,log1"); - - /* broken CTCP to channel */ - RECV(":bob!user@host PRIVMSG #test :\01"); - CHECK_CHAN("--", "Unknown CTCP requested by bob: ", - "irc_privmsg,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host PRIVMSG #test :\01TEST"); - CHECK_CHAN("--", "Unknown CTCP requested by bob: TEST", - "irc_privmsg,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host PRIVMSG #test :\01ACTION"); - CHECK_CHAN(" *", "bob", - "irc_privmsg,irc_action,notify_message,nick_bob," - "host_user@host,log1"); - RECV(":bob!user@host PRIVMSG #test :\01ACTION is testing"); - CHECK_CHAN(" *", "bob is testing", - "irc_privmsg,irc_action,notify_message,nick_bob," - "host_user@host,log1"); - RECV(":bob!user@host PRIVMSG #test :\01VERSION"); - CHECK_CHAN("--", "CTCP requested by bob: VERSION", - "irc_privmsg,irc_ctcp,host_user@host,log1"); - info = irc_ctcp_replace_variables (ptr_server, - irc_ctcp_get_reply (ptr_server, - "VERSION")); - snprintf (message, sizeof (message), - "CTCP reply to bob: VERSION %s", info); - CHECK_CHAN("--", message, - "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight,log1"); - snprintf (message, sizeof (message), - "NOTICE bob :\01VERSION %s\01", info); - CHECK_SENT(message); - free (info); - RECV(":bob!user@host PRIVMSG #test :\01DCC"); - CHECK_NO_MSG; - RECV(":bob!user@host PRIVMSG #test :\01DCC SEND"); - CHECK_NO_MSG; - RECV(":bob!user@host PRIVMSG #test :\01DCC SEND file.txt"); - CHECK_SRV("=!=", "irc: cannot parse \"privmsg\" command", ""); - RECV(":bob!user@host PRIVMSG #test :\01DCC SEND file.txt 1 2 3"); - CHECK_CORE("", - "xfer: incoming file from bob (0.0.0.1, irc." IRC_FAKE_SERVER - "), name: file.txt, 3 bytes (protocol: dcc)"); - - /* broken CTCP to user */ - RECV(":bob!user@host PRIVMSG alice :\01"); - CHECK_SRV("--", "Unknown CTCP requested by bob: ", - "irc_privmsg,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host PRIVMSG alice :\01TEST"); - CHECK_SRV("--", "Unknown CTCP requested by bob: TEST", - "irc_privmsg,irc_ctcp,host_user@host,log1"); - RECV(":bob!user@host PRIVMSG alice :\01ACTION"); - CHECK_PV("bob", " *", "bob", - "irc_privmsg,irc_action,notify_private,nick_bob," - "host_user@host,log1"); - RECV(":bob!user@host PRIVMSG alice :\01ACTION is testing"); - CHECK_PV("bob", " *", "bob is testing", - "irc_privmsg,irc_action,notify_private,nick_bob," - "host_user@host,log1"); - RECV(":bob!user@host PRIVMSG alice :\01VERSION"); - info = irc_ctcp_replace_variables (ptr_server, - irc_ctcp_get_reply (ptr_server, - "VERSION")); - snprintf (message, sizeof (message), - "CTCP reply to bob: VERSION %s", info); - CHECK_SRV("--", message, - "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight,log1"); - free (info); - RECV(":bob!user@host PRIVMSG alice :\01DCC"); - CHECK_NO_MSG; - RECV(":bob!user@host PRIVMSG alice :\01DCC SEND"); - CHECK_NO_MSG; - RECV(":bob!user@host PRIVMSG alice :\01DCC SEND file.txt"); - CHECK_SRV("=!=", "irc: cannot parse \"privmsg\" command", ""); - RECV(":bob!user@host PRIVMSG alice :\01DCC SEND file.txt 1 2 3"); - CHECK_CORE("", - "xfer: incoming file from bob (0.0.0.1, irc." IRC_FAKE_SERVER - "), name: file.txt, 3 bytes (protocol: dcc)"); - - /* valid CTCP to channel */ - RECV(":bob!user@host PRIVMSG #test :\01TEST\01"); - RECV(":bob!user@host PRIVMSG #test :\01ACTION\01"); - CHECK_CHAN(" *", "bob", - "irc_privmsg,irc_action,notify_message,nick_bob," - "host_user@host,log1"); - RECV(":bob!user@host PRIVMSG #test :\01ACTION is testing\01"); - CHECK_CHAN(" *", "bob is testing", - "irc_privmsg,irc_action,notify_message,nick_bob," - "host_user@host,log1"); - RECV(":bob!user@host PRIVMSG #test :\01VERSION\01"); - RECV(":bob!user@host PRIVMSG #test :\01DCC SEND file.txt 1 2 3\01"); - - /* valid CTCP to ops of channel */ - RECV(":bob!user@host PRIVMSG @#test :\01ACTION\01"); - CHECK_CHAN("--", "Action -> @#test: bob", - "irc_privmsg,irc_action,notify_message,nick_bob," - "host_user@host,log1"); - RECV(":bob!user@host PRIVMSG @#test :\01ACTION is testing\01"); - CHECK_CHAN("--", "Action -> @#test: bob is testing", - "irc_privmsg,irc_action,notify_message,nick_bob," - "host_user@host,log1"); + /* + * message from self nick in private + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host PRIVMSG alice :this is the message "); + CHECK_PV("alice", "alice", "this is the message ", + "irc_privmsg,self_msg,notify_none,no_highlight," + "prefix_nick_white,nick_alice,host_user@host,log1"); + + /* broken CTCP to channel */ + RECV(":bob!user@host PRIVMSG #test :\01"); + CHECK_CHAN("--", "Unknown CTCP requested by bob: ", + "irc_privmsg,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host PRIVMSG #test :\01TEST"); + CHECK_CHAN("--", "Unknown CTCP requested by bob: TEST", + "irc_privmsg,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host PRIVMSG #test :\01ACTION"); + CHECK_CHAN(" *", "bob", + "irc_privmsg,irc_action,notify_message,nick_bob," + "host_user@host,log1"); + RECV(":bob!user@host PRIVMSG #test :\01ACTION is testing"); + CHECK_CHAN(" *", "bob is testing", + "irc_privmsg,irc_action,notify_message,nick_bob," + "host_user@host,log1"); + RECV(":bob!user@host PRIVMSG #test :\01VERSION"); + CHECK_CHAN("--", "CTCP requested by bob: VERSION", + "irc_privmsg,irc_ctcp,host_user@host,log1"); + info = irc_ctcp_replace_variables (ptr_server, + irc_ctcp_get_reply (ptr_server, + "VERSION")); + snprintf (message, sizeof (message), + "CTCP reply to bob: VERSION %s", info); + CHECK_CHAN("--", message, + "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," + "no_highlight,log1"); + snprintf (message, sizeof (message), + "NOTICE bob :\01VERSION %s\01", info); + CHECK_SENT(message); + free (info); + RECV(":bob!user@host PRIVMSG #test :\01DCC"); + CHECK_NO_MSG; + RECV(":bob!user@host PRIVMSG #test :\01DCC SEND"); + CHECK_NO_MSG; + RECV(":bob!user@host PRIVMSG #test :\01DCC SEND file.txt"); + CHECK_SRV("=!=", "irc: cannot parse \"privmsg\" command", ""); + RECV(":bob!user@host PRIVMSG #test :\01DCC SEND file.txt 1 2 3"); + CHECK_CORE("", + "xfer: incoming file from bob (0.0.0.1, irc." IRC_FAKE_SERVER + "), name: file.txt, 3 bytes (protocol: dcc)"); + + /* broken CTCP to user */ + RECV(":bob!user@host PRIVMSG alice :\01"); + CHECK_SRV("--", "Unknown CTCP requested by bob: ", + "irc_privmsg,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host PRIVMSG alice :\01TEST"); + CHECK_SRV("--", "Unknown CTCP requested by bob: TEST", + "irc_privmsg,irc_ctcp,host_user@host,log1"); + RECV(":bob!user@host PRIVMSG alice :\01ACTION"); + CHECK_PV("bob", " *", "bob", + "irc_privmsg,irc_action,notify_private,nick_bob," + "host_user@host,log1"); + RECV(":bob!user@host PRIVMSG alice :\01ACTION is testing"); + CHECK_PV("bob", " *", "bob is testing", + "irc_privmsg,irc_action,notify_private,nick_bob," + "host_user@host,log1"); + RECV(":bob!user@host PRIVMSG alice :\01VERSION"); + info = irc_ctcp_replace_variables (ptr_server, + irc_ctcp_get_reply (ptr_server, + "VERSION")); + snprintf (message, sizeof (message), + "CTCP reply to bob: VERSION %s", info); + CHECK_SRV("--", message, + "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," + "no_highlight,log1"); + free (info); + RECV(":bob!user@host PRIVMSG alice :\01DCC"); + CHECK_NO_MSG; + RECV(":bob!user@host PRIVMSG alice :\01DCC SEND"); + CHECK_NO_MSG; + RECV(":bob!user@host PRIVMSG alice :\01DCC SEND file.txt"); + CHECK_SRV("=!=", "irc: cannot parse \"privmsg\" command", ""); + RECV(":bob!user@host PRIVMSG alice :\01DCC SEND file.txt 1 2 3"); + CHECK_CORE("", + "xfer: incoming file from bob (0.0.0.1, irc." IRC_FAKE_SERVER + "), name: file.txt, 3 bytes (protocol: dcc)"); + + /* valid CTCP to channel */ + RECV(":bob!user@host PRIVMSG #test :\01TEST\01"); + RECV(":bob!user@host PRIVMSG #test :\01ACTION\01"); + CHECK_CHAN(" *", "bob", + "irc_privmsg,irc_action,notify_message,nick_bob," + "host_user@host,log1"); + RECV(":bob!user@host PRIVMSG #test :\01ACTION is testing\01"); + CHECK_CHAN(" *", "bob is testing", + "irc_privmsg,irc_action,notify_message,nick_bob," + "host_user@host,log1"); + RECV(":bob!user@host PRIVMSG #test :\01VERSION\01"); + RECV(":bob!user@host PRIVMSG #test :\01DCC SEND file.txt 1 2 3\01"); + + /* valid CTCP to ops of channel */ + RECV(":bob!user@host PRIVMSG @#test :\01ACTION\01"); + CHECK_CHAN("--", "Action -> @#test: bob", + "irc_privmsg,irc_action,notify_message,nick_bob," + "host_user@host,log1"); + RECV(":bob!user@host PRIVMSG @#test :\01ACTION is testing\01"); + CHECK_CHAN("--", "Action -> @#test: bob is testing", + "irc_privmsg,irc_action,notify_message,nick_bob," + "host_user@host,log1"); - /* - * valid CTCP to channel from self nick - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host PRIVMSG #test :\01VERSION\01"); - CHECK_SRV("--", "CTCP query to #test: VERSION", - "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," - "host_user@host,log1"); + /* + * valid CTCP to channel from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host PRIVMSG #test :\01VERSION\01"); + CHECK_CHAN("--", "CTCP query to #test: VERSION", + "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," + "nick_alice,host_user@host,log1"); + RECV(":alice!user@host PRIVMSG #test :\01ACTION\01"); + CHECK_CHAN(" *", "alice", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,host_user@host,log1"); + RECV(":alice!user@host PRIVMSG #test :\01ACTION is testing\01"); + CHECK_CHAN(" *", "alice is testing", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,host_user@host,log1"); - /* - * valid CTCP to ops of channel from self nick - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host PRIVMSG @#test :\01ACTION\01"); - CHECK_CHAN("--", "Action -> @#test: alice", - "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," - "nick_alice,host_user@host,log1"); - RECV(":alice!user@host PRIVMSG @#test :\01ACTION is testing\01"); - CHECK_CHAN("--", "Action -> @#test: alice is testing", - "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," - "nick_alice,host_user@host,log1"); + /* + * valid CTCP to ops of channel from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host PRIVMSG @#test :\01ACTION\01"); + CHECK_CHAN("--", "Action -> @#test: alice", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,host_user@host,log1"); + RECV(":alice!user@host PRIVMSG @#test :\01ACTION is testing\01"); + CHECK_CHAN("--", "Action -> @#test: alice is testing", + "irc_privmsg,irc_action,self_msg,notify_none,no_highlight," + "nick_alice,host_user@host,log1"); + + /* valid CTCP to user */ + RECV(":bob!user@host PRIVMSG alice :\01TEST\01"); + CHECK_SENT(NULL); + RECV(":bob!user@host PRIVMSG alice :\01ACTION\01"); + CHECK_SENT(NULL); + RECV(":bob!user@host PRIVMSG alice :\01ACTION is testing\01"); + CHECK_SENT(NULL); + RECV(":bob!user@host PRIVMSG alice :\01VERSION\01"); + CHECK_SRV("--", "CTCP requested by bob: VERSION", + "irc_privmsg,irc_ctcp,host_user@host,log1"); + info = irc_ctcp_replace_variables (ptr_server, + irc_ctcp_get_reply (ptr_server, + "VERSION")); + snprintf (message, sizeof (message), + "CTCP reply to bob: VERSION %s", info); + CHECK_SRV("--", message, + "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," + "no_highlight,log1"); + snprintf (message, sizeof (message), + "NOTICE bob :\01VERSION %s\01", info); + CHECK_SENT(message); + free (info); + RECV(":bob!user@host PRIVMSG alice :\01SOURCE\01"); + info = hook_info_get (NULL, "weechat_site_download", ""); + snprintf (message, sizeof (message), + "NOTICE bob :\01SOURCE %s\01", info); + CHECK_SENT(message); + free (info); + RECV(":bob!user@host PRIVMSG alice :\01DCC SEND file.txt 1 2 3\01"); + CHECK_CORE("", + "xfer: incoming file from bob (0.0.0.1, irc." IRC_FAKE_SERVER + "), name: file.txt, 3 bytes (protocol: dcc)"); + CHECK_SENT(NULL); - /* valid CTCP to user */ - RECV(":bob!user@host PRIVMSG alice :\01TEST\01"); - CHECK_SENT(NULL); - RECV(":bob!user@host PRIVMSG alice :\01ACTION\01"); - CHECK_SENT(NULL); - RECV(":bob!user@host PRIVMSG alice :\01ACTION is testing\01"); - CHECK_SENT(NULL); - RECV(":bob!user@host PRIVMSG alice :\01VERSION\01"); - CHECK_SRV("--", "CTCP requested by bob: VERSION", - "irc_privmsg,irc_ctcp,host_user@host,log1"); - info = irc_ctcp_replace_variables (ptr_server, - irc_ctcp_get_reply (ptr_server, - "VERSION")); - snprintf (message, sizeof (message), - "CTCP reply to bob: VERSION %s", info); - CHECK_SRV("--", message, - "irc_privmsg,irc_ctcp,irc_ctcp_reply,self_msg,notify_none," - "no_highlight,log1"); - snprintf (message, sizeof (message), - "NOTICE bob :\01VERSION %s\01", info); - CHECK_SENT(message); - free (info); - RECV(":bob!user@host PRIVMSG alice :\01SOURCE\01"); - info = hook_info_get (NULL, "weechat_site_download", ""); - snprintf (message, sizeof (message), - "NOTICE bob :\01SOURCE %s\01", info); - CHECK_SENT(message); - free (info); - RECV(":bob!user@host PRIVMSG alice :\01DCC SEND file.txt 1 2 3\01"); - CHECK_CORE("", - "xfer: incoming file from bob (0.0.0.1, irc." IRC_FAKE_SERVER - "), name: file.txt, 3 bytes (protocol: dcc)"); - CHECK_SENT(NULL); + /* + * valid CTCP to channel from self nick + * (case of bouncer of if echo-message capability is enabled) + */ + RECV(":alice!user@host PRIVMSG bob :\01VERSION\01"); + CHECK_PV("bob", "--", "CTCP query to bob: VERSION", + "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," + "nick_alice,host_user@host,log1"); - /* - * valid CTCP to channel from self nick - * (case of bouncer of if echo-message capability is enabled) - */ - RECV(":alice!user@host PRIVMSG bob :\01VERSION\01"); - CHECK_SRV("--", "CTCP query to bob: VERSION", - "irc_privmsg,irc_ctcp,self_msg,notify_none,no_highlight," - "host_user@host,log1"); + /* close xfer buffer */ + if (xfer_buffer) + gui_buffer_close (xfer_buffer); - /* close xfer buffer */ - if (xfer_buffer) - gui_buffer_close (xfer_buffer); + if (i == 1) + hashtable_remove (ptr_server->cap_list, "echo-message"); + } } /* @@ -4933,6 +5103,9 @@ TEST(IrcProtocolWithServer, 401) CHECK_SRV("--", "bob", "irc_401,irc_numeric,log3"); RECV(":server 401 alice bob :No such nick/channel"); CHECK_SRV("--", "bob: No such nick/channel", "irc_401,irc_numeric,log3"); + + RECV(":server 401 alice #unknown :No such nick/channel"); + CHECK_SRV("--", "#unknown: No such nick/channel", "irc_401,irc_numeric,log3"); } /* |