1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 13:56:37 +02:00

Added completion system for plugins/scripts commands, fixed plugins autoload

This commit is contained in:
Sebastien Helleu
2005-12-16 14:16:03 +00:00
parent 6eabc3aa61
commit d5b58ff068
48 changed files with 6694 additions and 6012 deletions
+3 -1
View File
@@ -1,10 +1,12 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-12-11
ChangeLog - 2005-12-16
Version 0.1.7 (under dev!):
* added completion system for plugins/scripts commands
* fixed plugins autoload
* added charset by server and channel, new command: /charset
* added Ruby script plugin
* added /upgrade command
+77 -13
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.7-cvs - December, 15 2005
@subtitle Documentation for WeeChat v0.1.7-cvs - December, 16 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -1525,18 +1525,14 @@ call next command in global history@*
scroll one page up@*
@item page_down
scroll one page down@*
@item infobar_clear
clear infobar@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item nick_beginning
display beginning of nicklist@*
@item nick_end
display end of nicklist@*
@item refresh
refresh screen@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item jump_smart
jump to buffer with activity@*
@item jump_dcc
@@ -1547,8 +1543,20 @@ jump to last buffer@*
jump to server buffer@*
@item jump_next_server
jump to next server@*
@item switch_server
switch active server on servers buffer@*
@item scroll_previous_highlight
scroll to previous highlight in buffer@*
@item scroll_next_highlight
scroll to next highlight in buffer@*
@item scroll_unread
scroll to first unread line in buffer@*
@item hotlist_clear
clear hotlist@*
@item infobar_clear
clear infobar@*
@item refresh
refresh screen@*
@item grab_key
grab a key@*
@end table
@@ -1920,8 +1928,9 @@ WeeChat neither other plugins
@item
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin
*plugin, char *command, char *description, char *arguments,
char *arguments_description, t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)}@*
char *arguments_description, char *completion_template,
t_plugin_handler_func *handler_func, char *handler_args,
void *handler_pointer)}@*
@*
Add a WeeChat command handler, called when user uses command
(for example /command).@*
@@ -1936,6 +1945,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@item @option{handler_func}: function called when comand is executed
@item @option{handler_args}: arguments given to function when called
@item @option{handler_pointer}: pointer given to function when called
@@ -2274,6 +2309,7 @@ int weechat_plugin_init (t_weechat_plugin *plugin)
"Display two times a message",
"msg",
"msg: message",
NULL,
&toto_cmd_double,
NULL, NULL);
return PLUGIN_RC_OK;
@@ -2468,9 +2504,11 @@ WeeChat neither other plugins
@item
Perl: @command{weechat::add_command_handler ( name, function,
[description, arguments, arguments_description] );}@*
[description, arguments, arguments_description,
completion_template] );}@*
Python: @command{weechat.add_command_handler ( name, function,
[description, arguments, arguments_description] )}@*
[description, arguments, arguments_description,
completion_template] )}@*
@*
Create new WeeChat command, linked with script function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -2488,6 +2526,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@end itemize
@*
@emph{Return value:}@*
+103 -39
View File
@@ -36,7 +36,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.7-cvs - 15 de diciembre de 2005
@subtitle Documentaci@'on para WeeChat v0.1.7-cvs - 16 de diciembre de 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -1480,75 +1480,83 @@ Internal functions for keys:@*
@table @kbd
@item return
terminar l@'inea@*
terminate line@*
@item tab
completar palabra@*
complete word@*
@item backspace
borrar el car@'acter anterior@*
delete previous char@*
@item delete
borrar el car@'acter siguiente@*
delete next char@*
@item delete_end_line
borrar hasta fin de l@'inea@*
delete until end of line@*
@item delete_beginning_line
borrar hasta principio de l@'inea@*
delete until beginning of line@*
@item delete_line
borrar l@'inea entera@*
delete entire line@*
@item delete_previous_word
borrar la palabra anterior@*
delete previous word@*
@item delete_next_word
borrar la palabra siguiente@*
delete next word@*
@item clipboard_paste
paste current clipboard content@*
@item transpose_chars
transpose chars@*
@item home
ir al principio de l@'inea@*
go to beginning of line@*
@item end
ir al final de l@'inea@*
go to end of line@*
@item left
mover un car@'acter a la izquierda@*
move one char left@*
@item previous_word
mover a la palabra anterior@*
move to previous word@*
@item right
mover un car@'acter a la derecha@*
move one char right@*
@item next_word
mover a la palabra siguiente@*
move to next word@*
@item up
llamar al comando anterior en el historial@*
call previous command in history@*
@item up_global
call previous command in global history@*
@item down
llamar al comando siguiente en el historial@*
call next command in history@*
@item down_global
call next command in global history@*
@item page_up
desplazarse una p@'agina hacia arriba@*
scroll one page up@*
@item page_down
desplazarse una p@'agina hacia abajo@*
@item infobar_clear
limpiar barra de informaci@'on@*
@item nick_page_up
desplazar la lista de nicks una p@'agina hacia arriba@*
@item nick_page_down
desplazar la lista de nicks una p@'agina hacia abajo@*
scroll one page down@*
@item nick_beginning
mostrar el principio de la lista de nicks@*
display beginning of nicklist@*
@item nick_end
mostrar el final de la lista de nicks@*
@item refresh
recargar la pantalla@*
display end of nicklist@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item jump_smart
saltar al búfer con actividad@*
jump to buffer with activity@*
@item jump_dcc
saltar al búfer DCC@*
jump to DCC buffer@*
@item jump_last_buffer
jump to last buffer@*
@item jump_server
saltar al búfer servidor@*
jump to server buffer@*
@item jump_next_server
saltar al servidor siguiente@*
jump to next server@*
@item switch_server
switch active server on servers buffer@*
@item scroll_previous_highlight
scroll to previous highlight in buffer@*
@item scroll_next_highlight
scroll to next highlight in buffer@*
@item scroll_unread
scroll to first unread line in buffer@*
@item hotlist_clear
limpiar hotlist@*
clear hotlist@*
@item infobar_clear
clear infobar@*
@item refresh
refresh screen@*
@item grab_key
grab a key@*
@end table
@@ -1923,8 +1931,9 @@ WeeChat neither other plugins
@item
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin
*plugin, char *command, char *description, char *arguments,
char *arguments_description, t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)}@*
char *arguments_description, char *completion_template,
t_plugin_handler_func *handler_func, char *handler_args,
void *handler_pointer)}@*
@*
Add a WeeChat command handler, called when user uses command
(for example /command).@*
@@ -1939,6 +1948,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@item @option{handler_func}: function called when comand is executed
@item @option{handler_args}: arguments given to function when called
@item @option{handler_pointer}: pointer given to function when called
@@ -2271,6 +2306,7 @@ int weechat_plugin_init (t_weechat_plugin *plugin)
"Display two times a message",
"msg",
"msg: message",
NULL,
&toto_cmd_double,
NULL, NULL);
return PLUGIN_RC_OK;
@@ -2465,9 +2501,11 @@ WeeChat neither other plugins
@item
Perl: @command{weechat::add_command_handler ( name, function,
[description, arguments, arguments_description] );}@*
[description, arguments, arguments_description,
completion_template] );}@*
Python: @command{weechat.add_command_handler ( name, function,
[description, arguments, arguments_description] )}@*
[description, arguments, arguments_description,
completion_template] )}@*
@*
Create new WeeChat command, linked with script function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -2485,6 +2523,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@end itemize
@*
@emph{Return value:}@*
+79 -13
View File
@@ -36,7 +36,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.7-cvs - 15 decembre 2005
@subtitle Documentation pour WeeChat v0.1.7-cvs - 16 decembre 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -1526,18 +1526,14 @@ appeler la commande suivante dans l'historique global@*
faire d@'efiler d'une page vers le haut@*
@item page_down
faire d@'efiler d'une page vers le bas@*
@item infobar_clear
effacer la barre d'infos@*
@item nick_page_up
faire d@'efiler la liste des pseudos d'une page vers le haut@*
@item nick_page_down
faire d@'efiler la liste des pseudos d'une page vers le bas@*
@item nick_beginning
afficher le d@'ebut de la liste des pseudos@*
@item nick_end
afficher la fin de la liste des pseudos@*
@item refresh
rafraichir l'@'ecran@*
@item nick_page_up
faire d@'efiler la liste des pseudos d'une page vers le haut@*
@item nick_page_down
faire d@'efiler la liste des pseudos d'une page vers le bas@*
@item jump_smart
sauter au tampon avec de l'activit@'e@*
@item jump_dcc
@@ -1548,8 +1544,20 @@ sauter au dernier tampon@*
sauter au tampon du serveur@*
@item jump_next_server
sauter au prochain serveur@*
@item switch_server
bascule de serveur actif sur le tampon des serveurs@*
@item scroll_previous_highlight
scroller jusqu'au highlight pr@'ec@'edent du tampon@*
@item scroll_next_highlight
scroller jusqu'au highlight suivant du tampon@*
@item scroll_unread
scroller jusqu'@`a la premi@`ere ligne non lue du tampon@*
@item hotlist_clear
effacer la liste d'activit@'e@*
@item infobar_clear
effacer la barre d'infos@*
@item refresh
rafraichir l'@'ecran@*
@item grab_key
capturer une touche@*
@end table
@@ -1938,8 +1946,9 @@ WeeChat ni @`a d'autres extensions
@item
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin
*plugin, char *command, char *description, char *arguments,
char *arguments_description, t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)}@*
char *arguments_description, char *completion_template,
t_plugin_handler_func *handler_func, char *handler_args,
void *handler_pointer)}@*
@*
Ajoute un gestionnaire de commande WeeChat, appel@'e d@`es que
l'utilisateur utilise la commande (par exemple /commande).@*
@@ -1954,6 +1963,33 @@ l'utilisateur utilise la commande (par exemple /commande).@*
commande (affich@'ee par /help commande)
@item @option{arguments_description}: longue description des
param@`etres de la commande (affich@'ee par /help commande)
@item @option{completion_template}: mod@`ele pour la compl@'etion, sous
la forme @code{abc|%w def|%i} qui signifie ``abc'' ou une comande
WeeChat pour le premier param@`etre, et ``def'' ou une commande IRC
pour le deuxi@`eme.@*
Les codes suivants peuvent @^etre utilis@'es :
@itemize @minus
@item @code{%-}: aucune compl@'etion pour le param@`etre
@item @code{%a}: alias
@item @code{%A}: alias et commandes (WeeChat, IRC et extensions)
@item @code{%c}: canal courant
@item @code{%C}: canaux du serveur courant
@item @code{%f}: nom de fichier
@item @code{%h}: commandes d@'efinies par des extensions
@item @code{%i}: commandes IRC (envoy@'ees)
@item @code{%I}: commandes IRC (re@,cues)
@item @code{%k}: touches
@item @code{%n}: pseudos du canal courant
@item @code{%o}: option de configuration
@item @code{%p}: message de ``part'' par d@'efaut
@item @code{%q}: message de ``quit'' par d@'efaut
@item @code{%s}: nom du serveur courant
@item @code{%S}: noms de tous les serveurs
@item @code{%t}: titre du canal courant
@item @code{%v}: valeur d'une option de configuration
@item @code{%w}: commandes WeeChat
@item @code{%y}: message d'absence (``away'') par d@'efaut
@end itemize
@item @option{handler_func}: fonction appel@'ee lorsque la commande est
ex@'ecut@'ee
@item @option{handler_args}: param@`etres pass@'es @`a la fonction
@@ -2303,6 +2339,7 @@ int weechat_plugin_init (t_weechat_plugin *plugin)
"Affiche deux fois un message",
"msg",
"msg: message a afficher deux fois",
NULL,
&toto_cmd_double,
NULL, NULL);
return PLUGIN_RC_OK;
@@ -2498,9 +2535,11 @@ transmis @`a d'autres extensions
@item
Perl: @command{weechat::add_command_handler ( nom, fonction,
[description, arguments, arguments_description] );}@*
[description, arguments, arguments_description,
completion_template] );}@*
Python: @command{weechat.add_command_handler ( nom, fonction,
[description, arguments, arguments_description] )}@*
[description, arguments, arguments_description,
completion_template] )}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande
@@ -2520,6 +2559,33 @@ script sera charg@'e.
commande (affich@'ee par /help commande)
@item @option{arguments_description}: longue description des
param@`etres de la commande (affich@'ee par /help commande)
@item @option{completion_template}: mod@`ele pour la compl@'etion, sous
la forme @code{abc|%w def|%i} qui signifie ``abc'' ou une comande
WeeChat pour le premier param@`etre, et ``def'' ou une commande IRC
pour le deuxi@`eme.@*
Les codes suivants peuvent @^etre utilis@'es :
@itemize @minus
@item @code{%-}: aucune compl@'etion pour le param@`etre
@item @code{%a}: alias
@item @code{%A}: alias et commandes (WeeChat, IRC et extensions)
@item @code{%c}: canal courant
@item @code{%C}: canaux du serveur courant
@item @code{%f}: nom de fichier
@item @code{%h}: commandes d@'efinies par des extensions
@item @code{%i}: commandes IRC (envoy@'ees)
@item @code{%I}: commandes IRC (re@,cues)
@item @code{%k}: touches
@item @code{%n}: pseudos du canal courant
@item @code{%o}: option de configuration
@item @code{%p}: message de ``part'' par d@'efaut
@item @code{%q}: message de ``quit'' par d@'efaut
@item @code{%s}: nom du serveur courant
@item @code{%S}: noms de tous les serveurs
@item @code{%t}: titre du canal courant
@item @code{%v}: valeur d'une option de configuration
@item @code{%w}: commandes WeeChat
@item @code{%y}: message d'absence (``away'') par d@'efaut
@end itemize
@end itemize
@*
@emph{Valeur renvoy@'ee :}@*
+77 -13
View File
@@ -36,7 +36,7 @@
@title WeeChat - Guia do Utilizador
@subtitle Cliente de IRC rapido, leve e extencivel
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.7-cvs - 15 de dezembro de 2005
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.7-cvs - 16 de dezembro de 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -1523,18 +1523,14 @@ call next command in global history@*
scroll one page up@*
@item page_down
scroll one page down@*
@item infobar_clear
clear infobar@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item nick_beginning
display beginning of nicklist@*
@item nick_end
display end of nicklist@*
@item refresh
refresh screen@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item jump_smart
jump to buffer with activity@*
@item jump_dcc
@@ -1545,8 +1541,20 @@ jump to last buffer@*
jump to server buffer@*
@item jump_next_server
jump to next server@*
@item switch_server
switch active server on servers buffer@*
@item scroll_previous_highlight
scroll to previous highlight in buffer@*
@item scroll_next_highlight
scroll to next highlight in buffer@*
@item scroll_unread
scroll to first unread line in buffer@*
@item hotlist_clear
clear hotlist@*
@item infobar_clear
clear infobar@*
@item refresh
refresh screen@*
@item grab_key
grab a key@*
@end table
@@ -1918,8 +1926,9 @@ WeeChat neither other plugins
@item
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin
*plugin, char *command, char *description, char *arguments,
char *arguments_description, t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)}@*
char *arguments_description, char *completion_template,
t_plugin_handler_func *handler_func, char *handler_args,
void *handler_pointer)}@*
@*
Add a WeeChat command handler, called when user uses command
(for example /command).@*
@@ -1934,6 +1943,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers name
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@item @option{handler_func}: function called when comand is executed
@item @option{handler_args}: arguments given to function when called
@item @option{handler_pointer}: pointer given to function when called
@@ -2266,6 +2301,7 @@ int weechat_plugin_init (t_weechat_plugin *plugin)
"Display two times a message",
"msg",
"msg: message",
NULL,
&toto_cmd_double,
NULL, NULL);
return PLUGIN_RC_OK;
@@ -2460,9 +2496,11 @@ WeeChat neither other plugins
@item
Perl: @command{weechat::add_command_handler ( name, function,
[description, arguments, arguments_description] );}@*
[description, arguments, arguments_description,
completion_template] );}@*
Python: @command{weechat.add_command_handler ( name, function,
[description, arguments, arguments_description] )}@*
[description, arguments, arguments_description,
completion_template] )}@*
@*
Create new WeeChat command, linked with script function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -2480,6 +2518,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@end itemize
@*
@emph{Return value:}@*
+444 -441
View File
File diff suppressed because it is too large Load Diff
+446 -445
View File
File diff suppressed because it is too large Load Diff
+452 -447
View File
File diff suppressed because it is too large Load Diff
+441 -441
View File
File diff suppressed because it is too large Load Diff
+25 -23
View File
@@ -46,7 +46,7 @@ t_weechat_command weechat_commands[] =
N_("[alias_name [command [arguments]]"),
N_("alias_name: name of alias\ncommand: command name (WeeChat "
"or IRC command, without first '/')\n" "arguments: arguments for command"),
0, MAX_ARGS, NULL, weechat_cmd_alias },
"%- %A", 0, MAX_ARGS, NULL, weechat_cmd_alias },
{ "buffer", N_("manage buffers"),
N_("[action | number | [[server] [channel]]]"),
N_("action: action to do:\n"
@@ -56,39 +56,40 @@ t_weechat_command weechat_commands[] =
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
"server,channel: jump to buffer by server and/or channel name\n"
"number: jump to buffer by number"),
0, MAX_ARGS, weechat_cmd_buffer, NULL },
"move|close|list|notify", 0, MAX_ARGS, weechat_cmd_buffer, NULL },
{ "charset", N_("change charset for server or channel"),
N_("[(decode_iso | decode_utf | encode) charset]"),
N_("decode_iso: charset used for decoding ISO\n"
"decode_utf: charset used for decoding UTF\n"
" encode: charset used for encoding messages\n"
" charset: charset to use (for example: ISO-8859-15, UTF-8,..)"),
0, 2, weechat_cmd_charset, NULL },
"decode_iso|decode_utf|encode", 0, 2, weechat_cmd_charset, NULL },
{ "clear", N_("clear window(s)"),
N_("[-all]"),
N_("-all: clear all windows"),
0, 1, weechat_cmd_clear, NULL },
"-all", 0, 1, weechat_cmd_clear, NULL },
{ "connect", N_("connect to a server"),
N_("[servername]"),
N_("servername: server name to connect"),
0, 1, weechat_cmd_connect, NULL },
"%S", 0, 1, weechat_cmd_connect, NULL },
{ "disconnect", N_("disconnect from a server"),
N_("[servername]"),
N_("servername: server name to disconnect"),
0, 1, weechat_cmd_disconnect, NULL },
"%S", 0, 1, weechat_cmd_disconnect, NULL },
{ "debug", N_("print debug messages"),
N_("dump | windows"),
N_("dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)\n"
"windows: display windows tree"),
1, 1, weechat_cmd_debug, NULL },
"dump|windows", 1, 1, weechat_cmd_debug, NULL },
{ "help", N_("display help about commands"),
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
0, 1, weechat_cmd_help, NULL },
N_("[command]"),
N_("command: name of a WeeChat or IRC command"),
"%w|%i|%h", 0, 1, weechat_cmd_help, NULL },
{ "history", N_("show buffer command history"),
N_("[clear | value]"),
N_("clear: clear history\n"
"value: number of history entries to show"),
0, 1, weechat_cmd_history, NULL },
"clear", 0, 1, weechat_cmd_history, NULL },
{ "ignore", N_("ignore IRC messages and/or hosts"),
N_("[mask [[type | command] [channel [server]]]]"),
N_(" mask: nick or host mask to ignore\n"
@@ -98,19 +99,20 @@ t_weechat_command weechat_commands[] =
" server: name of server for ignore\n\n"
"For each argument, '*' means all.\n"
"Without argument, /ignore command lists all defined ignore."),
"*|%n *|action|ctcp|dcc|pv|%I *|%c *|%s",
0, 4, weechat_cmd_ignore, NULL },
{ "key", N_("bind/unbind keys"),
N_("[key function/command] [unbind key] [functions] [reset -yes]"),
N_("key: bind this key to an internal function or a command (beginning by \"/\")\n"
"unbind: unbind a key (if \"all\", default bindings are restored)\n"
"unbind: unbind a key\n"
"functions: list internal functions for key bindings\n"
"reset: restore bindings to the default values and delete ALL personal binding (use carefully!)"),
0, MAX_ARGS, NULL, weechat_cmd_key },
"unbind|functions|reset %k", 0, MAX_ARGS, NULL, weechat_cmd_key },
{ "plugin", N_("list/load/unload plugins"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: WeeChat plugin (file) to load\n\n"
"Without argument, /plugin command lists all loaded plugins."),
0, 2, weechat_cmd_plugin, NULL },
"load|autoload|reload|unload", 0, 2, weechat_cmd_plugin, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
@@ -128,19 +130,19 @@ t_weechat_command weechat_commands[] =
"nick3: second alternate nick for server\n"
"username: user name\n"
"realname: real name of user"),
0, MAX_ARGS, weechat_cmd_server, NULL },
NULL, 0, MAX_ARGS, weechat_cmd_server, NULL },
{ "save", N_("save config to disk"),
N_("[file]"), N_("file: filename for writing config"),
0, 1, weechat_cmd_save, NULL },
NULL, 0, 1, weechat_cmd_save, NULL },
{ "set", N_("set config parameters"),
N_("[option [ = value]]"),
N_("option: name of an option (if name is full "
"and no value is given, then help is displayed on option)\n"
"value: value for option"),
0, MAX_ARGS, NULL, weechat_cmd_set },
"%o = %v", 0, MAX_ARGS, NULL, weechat_cmd_set },
{ "unalias", N_("remove an alias"),
N_("alias_name"), N_("alias_name: name of alias to remove"),
1, 1, NULL, weechat_cmd_unalias },
"%a", 1, 1, NULL, weechat_cmd_unalias },
{ "unignore", N_("unignore IRC messages and/or hosts"),
N_("[number | [mask [[type | command] [channel [server]]]]]"),
N_(" number: # of ignore to unignore (number is displayed by list of ignore)\n"
@@ -151,15 +153,14 @@ t_weechat_command weechat_commands[] =
" server: name of server for unignore\n\n"
"For each argument, '*' means all.\n"
"Without argument, /unignore command lists all defined ignore."),
"*|%n *|action|ctcp|dcc|pv|%I *|%c *|%s",
0, 4, weechat_cmd_unignore, NULL },
{ "upgrade", N_("upgrade WeeChat without disconnecting from servers"),
"",
"",
0, 0, weechat_cmd_upgrade, NULL },
{ "upgrade", N_("upgrade WeeChat without disconnecting from servers"), "", "",
NULL, 0, 0, weechat_cmd_upgrade, NULL },
{ "uptime", N_("show WeeChat uptime"),
N_("[-o]"),
N_("-o: send uptime on current channel as an IRC message"),
0, 1, weechat_cmd_uptime, NULL },
"-o", 0, 1, weechat_cmd_uptime, NULL },
{ "window", N_("manage windows"),
N_("[list | -1 | +1 | b# | up | down | left | right | splith [pct] "
"| splitv [pct] | resize pct | merge [all]]"),
@@ -178,8 +179,9 @@ t_weechat_command weechat_commands[] =
"For splith and splitv, pct is a pourcentage which represents "
"size of new window, computed with current window as size reference. "
"For example 25 means create a new window with size = current_size / 4"),
"list|-1|+1|up|down|left|right|splith|splitv|resize|merge all",
0, 2, weechat_cmd_window, NULL },
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
{ NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
};
t_weechat_alias *weechat_alias = NULL;
+9 -5
View File
@@ -31,13 +31,17 @@ typedef struct t_weechat_command t_weechat_command;
struct t_weechat_command
{
char *command_name;
char *command_description;
char *arguments;
char *arguments_description;
int min_arg, max_arg;
char *command_name; /* WeeChat (internal) command name */
char *command_description; /* command description (for /help) */
char *arguments; /* command arguments (for /help) */
char *arguments_description; /* arguments description (for /help) */
char *completion_template; /* template for completion */
/* NULL=no completion, ""=default (nick) */
int min_arg, max_arg; /* min & max number of arguments */
int (*cmd_function_args)(t_gui_window *, int, char **);
/* function called when user enters cmd */
int (*cmd_function_1arg)(t_gui_window *, char *);
/* function called when user enters cmd */
};
typedef struct t_weechat_alias t_weechat_alias;
+596 -643
View File
File diff suppressed because it is too large Load Diff
+17 -15
View File
@@ -33,27 +33,29 @@ typedef struct t_completion t_completion;
struct t_completion
{
/* completion context */
int context; /* context: null, nick, command, cmd arg */
char *base_command; /* command with arg to complete (can be NULL) */
int base_command_arg; /* # arg to complete (if context is cmd arg) */
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
void *server; /* server pointer */
void *channel; /* channel pointer */
int context; /* context: null, nick, command, cmd arg */
char *base_command; /* command with arg to complete (can be NULL) */
int base_command_arg; /* # arg to complete (if context is cmd arg) */
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
/* for command argument completion */
t_weelist *completion_list; /* data list for completion */
t_weelist *last_completion; /* last data element for completion */
t_weelist *completion_list; /* data list for completion */
t_weelist *last_completion; /* last data element for completion */
/* completion found */
char *word_found; /* word found (to replace base word) */
int position_replace; /* position where word has to be replaced */
int diff_size; /* size difference (< 0 = char(s) deleted) */
int diff_length; /* length difference (<= diff_size) */
char *word_found; /* word found (to replace base word) */
int position_replace; /* position where word has to be replaced */
int diff_size; /* size difference (< 0 = char(s) deleted) */
int diff_length; /* length difference (<= diff_size) */
};
extern void completion_init (t_completion *);
extern void completion_init (t_completion *, void *, void *);
extern void completion_free (t_completion *);
extern void completion_search (t_completion *, void *, void *, char *, int, int);
extern void completion_search (t_completion *, char *, int, int);
#endif /* completion.h */
-2
View File
@@ -126,8 +126,6 @@ gui_action_tab (t_gui_window *window)
if (window->buffer->has_input)
{
completion_search (&(window->buffer->completion),
SERVER(window->buffer),
CHANNEL(window->buffer),
window->buffer->input_buffer,
window->buffer->input_buffer_size,
utf8_real_pos (window->buffer->input_buffer,
+1 -1
View File
@@ -474,7 +474,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
new_buffer->input_buffer_1st_display = 0;
/* init completion */
completion_init (&(new_buffer->completion));
completion_init (&(new_buffer->completion), server, channel);
/* init history */
new_buffer->history = NULL;
+368 -289
View File
@@ -34,462 +34,541 @@ t_irc_command irc_commands[] =
{ { "admin", N_("find information about the administrator of the server"),
N_("[target]"),
N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_admin, NULL },
NULL, 0, 1, 1, NULL, irc_cmd_send_admin, NULL },
{ "ame", N_("send a CTCP action to all channels of all connected servers"),
N_("message"),
N_("message: message to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
{ "amsg", N_("send message to all channels of all connected servers"),
N_("text"),
N_("text: text to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_amsg, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_amsg, NULL },
{ "away", N_("toggle away status"),
N_("[-all] [message]"),
N_("-all: toggle away status on all connected servers\n"
"message: message for away (if no message is given, away status is removed)"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
"message: message for away (if no message is given, away status is removed)"),
"%y", 0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
{ "ban", N_("bans nicks or hosts"),
N_("[channel] [nickname [nickname ...]]"),
N_("channel: channel for ban\n"
"nickname: user or host to ban"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
"", 0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
{ "ctcp", N_("send a CTCP message (Client-To-Client Protocol)"),
N_("nickname type [arguments]"),
N_("nickname: user to send CTCP to\n"
"type: CTCP type (examples: \"version\", \"ping\", ..)\n"
"arguments: arguments for CTCP"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
"%n action|ping|version", 2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
{ "dcc", N_("starts DCC (file or chat) or close chat"),
N_("action [nickname [file]]"),
N_("action: 'send' (file) or 'chat' or 'close' (chat)\n"
"nickname: nickname to send file or chat\n"
"file: filename (on local host)"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
"nickname: nickname to send file or chat\n"
"file: filename (on local host)"),
"chat|send|close %n %f", 1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
{ "dehalfop", N_("removes half channel operator status from nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
"", 0, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
{ "deop", N_("removes channel operator status from nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
"", 0, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
{ "devoice", N_("removes voice from nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
{ "die", N_("shutdown the server"),
"", "",
0, 0, 1, NULL, irc_cmd_send_die, NULL },
{ "error", N_("error received from IRC server"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
"", 0, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
{ "die", N_("shutdown the server"), "", "",
NULL, 0, 0, 1, NULL, irc_cmd_send_die, NULL },
{ "error", N_("error received from IRC server"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
{ "halfop", N_("gives half channel operator status to nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
"", 0, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
{ "info", N_("get information describing the server"),
N_("[target]"),
N_("target: server name"),
0, 1, 1, NULL, irc_cmd_send_info, NULL },
NULL, 0, 1, 1, NULL, irc_cmd_send_info, NULL },
{ "invite", N_("invite a nick on a channel"),
N_("nickname channel"),
N_("nickname: nick to invite\n"
"channel: channel to invite"),
1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
"%n %c", 1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
{ "ison", N_("check if a nickname is currently on IRC"),
N_("nickname [nickname ...]"),
N_("nickname: nickname"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
{ "join", N_("join a channel"),
N_("channel[,channel] [key[,key]]"),
N_("channel: channel name to join\n"
"key: key to join the channel"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_join, irc_cmd_recv_join },
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_join, irc_cmd_recv_join },
{ "kick", N_("forcibly remove a user from a channel"),
N_("[channel] nickname [comment]"),
N_("channel: channel where user is\n"
"nickname: nickname to kick\n"
"comment: comment for kick"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
{ "kickban", N_("kicks and bans a nick from a channel"),
N_("[channel] nickname [comment]"),
N_("channel: channel where user is\n"
"nickname: nickname to kick and ban\n"
"comment: comment for kick"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
{ "kill", N_("close client-server connection"),
N_("nickname comment"),
N_("nickname: nickname\n"
"comment: comment for kill"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
"%n %-", 2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
{ "links", N_("list all servernames which are known by the server answering the query"),
N_("[[server] server_mask]"),
N_("server: this server should answer the query\n"
"server_mask: list of servers must match this mask"),
0, 2, 1, NULL, irc_cmd_send_links, NULL },
"server_mask: list of servers must match this mask"),
NULL, 0, 2, 1, NULL, irc_cmd_send_links, NULL },
{ "list", N_("list channels and their topic"),
N_("[channel[,channel] [server]]"),
N_("channel: channel to list\nserver: server name"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_list, NULL },
NULL, 0, MAX_ARGS, 1, NULL, irc_cmd_send_list, NULL },
{ "lusers", N_("get statistics about the size of the IRC network"),
N_("[mask [target]]"),
N_("mask: servers matching the mask only\n"
"target: server for forwarding request"),
0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
"target: server for forwarding request"),
NULL, 0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
{ "me", N_("send a CTCP action to the current channel"),
N_("message"),
N_("message: message to send"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
"", 0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
{ "mode", N_("change channel or user mode"),
N_("{ channel {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask] } | "
"{ nickname {[+|-]|i|w|s|o} }"),
"{ nickname {[+|-]|i|w|s|o} }"),
N_("channel modes:\n"
" channel: channel name to modify\n"
" o: give/take channel operator privileges\n"
" p: private channel flag\n"
" s: secret channel flag\n"
" i: invite-only channel flag\n"
" t: topic settable by channel operator only flag\n"
" n: no messages to channel from clients on the outside\n"
" m: moderated channel\n"
" l: set the user limit to channel\n"
" b: set a ban mask to keep users out\n"
" e: set exception mask\n"
" v: give/take the ability to speak on a moderated channel\n"
" k: set a channel key (password)\n"
"user modes:\n"
" nickname: nickname to modify\n"
" i: mark a user as invisible\n"
" s: mark a user for receive server notices\n"
" w: user receives wallops\n"
" o: operator flag"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
" channel: channel name to modify\n"
" o: give/take channel operator privileges\n"
" p: private channel flag\n"
" s: secret channel flag\n"
" i: invite-only channel flag\n"
" t: topic settable by channel operator only flag\n"
" n: no messages to channel from clients on the outside\n"
" m: moderated channel\n"
" l: set the user limit to channel\n"
" b: set a ban mask to keep users out\n"
" e: set exception mask\n"
" v: give/take the ability to speak on a moderated channel\n"
" k: set a channel key (password)\n"
"user modes:\n"
" nickname: nickname to modify\n"
" i: mark a user as invisible\n"
" s: mark a user for receive server notices\n"
" w: user receives wallops\n"
" o: operator flag"),
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
{ "motd", N_("get the \"Message Of The Day\""),
N_("[target]"),
N_("target: server name"),
0, 1, 1, NULL, irc_cmd_send_motd, NULL },
NULL, 0, 1, 1, NULL, irc_cmd_send_motd, NULL },
{ "msg", N_("send message to a nick or channel"),
N_("receiver[,receiver] text"),
N_("receiver: nick or channel (may be mask, '*' = current channel)\n"
"text: text to send"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
"text: text to send"),
"", 2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
{ "names", N_("list nicknames on channels"),
N_("[channel[,channel]]"), N_("channel: channel name"),
0, 1, 1, NULL, irc_cmd_send_names, NULL },
N_("[channel[,channel]]"),
N_("channel: channel name"),
NULL, 0, 1, 1, NULL, irc_cmd_send_names, NULL },
{ "nick", N_("change current nickname"),
N_("[-all] nickname"),
N_("-all: set new nickname for all connected servers\n"
"nickname: new nickname"),
1, 2, 0, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
"nickname: new nickname"),
NULL, 1, 2, 0, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
{ "notice", N_("send notice message to user"),
N_("nickname text"), N_("nickname: user to send notice to\ntext: text to send"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
N_("nickname text"),
N_("nickname: user to send notice to\ntext: text to send"),
"%n %-", 2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
{ "op", N_("gives channel operator status to nickname(s)"),
N_("nickname [nickname]"), "",
1, MAX_ARGS, 1, irc_cmd_send_op, NULL, NULL },
"", 1, MAX_ARGS, 1, irc_cmd_send_op, NULL, NULL },
{ "oper", N_("get operator privileges"),
N_("user password"),
N_("user/password: used to get privileges on current IRC server"),
2, 2, 1, NULL, irc_cmd_send_oper, NULL },
NULL, 2, 2, 1, NULL, irc_cmd_send_oper, NULL },
{ "part", N_("leave a channel"),
N_("[channel[,channel]] [part_message]"),
N_("channel: channel name to leave\n"
"part_message: part message (displayed to other users)"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
"%p", 0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
{ "ping", N_("ping server"),
N_("server1 [server2]"),
N_("server1: server to ping\nserver2: forward ping to this server"),
1, 2, 1, NULL, irc_cmd_send_ping, irc_cmd_recv_ping },
NULL, 1, 2, 1, NULL, irc_cmd_send_ping, irc_cmd_recv_ping },
{ "pong", N_("answer to a ping message"),
N_("daemon [daemon2]"),
N_("daemon: daemon who has responded to Ping message\n"
"daemon2: forward message to this daemon"),
1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
{ "privmsg", N_("message received"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
NULL, 1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
{ "privmsg", N_("message received"), "", "",
"", 0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
{ "query", N_("send a private message to a nick"),
N_("nickname [text]"),
N_("nickname: nickname for private conversation\n"
"text: text to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
"text: text to send"),
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
{ "quit", N_("close all connections & quit"),
N_("[quit_message]"),
N_("quit_message: quit message (displayed to other users)"),
0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },
"%q", 0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },
{ "quote", N_("send raw data to server without parsing"),
N_("data"),
N_("data: raw data to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_quote, NULL },
{ "rehash", N_("tell the server to reload its config file"),
"", "",
0, 0, 1, NULL, irc_cmd_send_rehash, NULL },
{ "restart", N_("tell the server to restart itself"),
"", "",
0, 0, 1, NULL, irc_cmd_send_restart, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_quote, NULL },
{ "rehash", N_("tell the server to reload its config file"), "", "",
NULL, 0, 0, 1, NULL, irc_cmd_send_rehash, NULL },
{ "restart", N_("tell the server to restart itself"), "", "",
NULL, 0, 0, 1, NULL, irc_cmd_send_restart, NULL },
{ "service", N_("register a new service"),
N_("nickname reserved distribution type reserved info"),
N_("distribution: visibility of service\n"
"type: reserved for future usage"),
6, 6, 1, NULL, irc_cmd_send_service, NULL },
"type: reserved for future usage"),
NULL, 6, 6, 1, NULL, irc_cmd_send_service, NULL },
{ "servlist", N_("list services currently connected to the network"),
N_("[mask [type]]"),
N_("mask: list only services matching this mask\n"
"type: list only services of this type"),
0, 2, 1, NULL, irc_cmd_send_servlist, NULL },
NULL, 0, 2, 1, NULL, irc_cmd_send_servlist, NULL },
{ "squery", N_("deliver a message to a service"),
N_("service text"),
N_("service: name of service\ntext: text to send"),
2, 2, 1, NULL, irc_cmd_send_squery, NULL },
NULL, 2, 2, 1, NULL, irc_cmd_send_squery, NULL },
{ "squit", N_("disconnect server links"),
N_("server comment"),
N_("server: server name\ncomment: comment for quit"),
2, 2, 1, NULL, irc_cmd_send_squit, NULL },
NULL, 2, 2, 1, NULL, irc_cmd_send_squit, NULL },
{ "stats", N_("query statistics about server"),
N_("[query [server]]"),
N_("query: c/h/i/k/l/m/o/y/u (see RFC1459)\nserver: server name"),
0, 2, 1, NULL, irc_cmd_send_stats, NULL },
N_("query: c/h/i/k/l/m/o/y/u (see RFC1459)\n"
"server: server name"),
NULL, 0, 2, 1, NULL, irc_cmd_send_stats, NULL },
{ "summon", N_("give users who are on a host running an IRC server a message "
"asking them to please join IRC"),
N_("user [target [channel]]"),
N_("user: username\ntarget: server name\n"
"channel: channel name"),
1, 3, 1, NULL, irc_cmd_send_summon, NULL },
NULL, 1, 3, 1, NULL, irc_cmd_send_summon, NULL },
{ "time", N_("query local time from server"),
N_("[target]"), N_("target: query time from specified server"),
0, 1, 1, NULL, irc_cmd_send_time, NULL },
N_("[target]"),
N_("target: query time from specified server"),
NULL, 0, 1, 1, NULL, irc_cmd_send_time, NULL },
{ "topic", N_("get/set channel topic"),
N_("[channel] [topic]"),
N_("channel: channel name\ntopic: new topic for channel "
"(if topic is \"-delete\" then topic is deleted)"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
"%t", 0, MAX_ARGS, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
{ "trace", N_("find the route to specific server"),
N_("[target]"), N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_trace, NULL },
N_("[target]"),
N_("target: server"),
NULL, 0, 1, 1, NULL, irc_cmd_send_trace, NULL },
{ "unban", N_("unbans nicks or hosts"),
N_("[channel] nickname [nickname ...]"),
N_("channel: channel for unban\n"
"nickname: user or host to unban"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
"%n", 1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
{ "userhost", N_("return a list of information about nicknames"),
N_("nickname [nickname ...]"), N_("nickname: nickname"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
N_("nickname [nickname ...]"),
N_("nickname: nickname"),
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
{ "users", N_("list of users logged into the server"),
N_("[target]"), N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_users, NULL },
N_("[target]"),
N_("target: server"),
NULL, 0, 1, 1, NULL, irc_cmd_send_users, NULL },
{ "version", N_("gives the version info of nick or server (current or specified)"),
N_("[server | nickname]"),
N_("server: server name\n"
"nickname: nickname"),
0, 1, 1, NULL, irc_cmd_send_version, NULL },
NULL, 0, 1, 1, NULL, irc_cmd_send_version, NULL },
{ "voice", N_("gives voice to nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
"", 0, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
{ "wallops", N_("send a message to all currently connected users who have "
"set the 'w' user mode for themselves"),
N_("text"), N_("text to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
N_("text"),
N_("text to send"),
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
{ "who", N_("generate a query which returns a list of information"),
N_("[mask [\"o\"]]"),
N_("mask: only information which match this mask\n"
"o: only operators are returned according to the mask supplied"),
0, 2, 1, NULL, irc_cmd_send_who, NULL },
"%C", 0, 2, 1, NULL, irc_cmd_send_who, NULL },
{ "whois", N_("query information about user(s)"),
N_("[server] nickname[,nickname]"),
N_("server: server name\n"
"nickname: nickname (may be a mask)"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_whois, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_whois, NULL },
{ "whowas", N_("ask for information about a nickname which no longer exists"),
N_("nickname [,nickname [,nickname ...]] [count [target]]"),
N_("nickname: nickname to search\n"
"count: number of replies to return (full search if negative number)\n"
"target: reply should match this mask"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_whowas, NULL },
{ "001", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "002", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "003", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "004", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
{ "005", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "008", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "020", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "042", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "212", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "219", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "221", N_("user mode string"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
{ "250", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "251", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "252", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "253", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "254", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "255", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "256", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "257", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "258", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "259", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "260", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "261", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "262", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "263", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "264", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "265", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "266", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "267", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "301", N_("away message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
{ "302", N_("userhost"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
{ "314", N_("whowas"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
{ "317", N_("whois (idle)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
{ "318", N_("whois (end)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
{ "319", N_("whois (channels)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
{ "320", N_("whois (identified user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
{ "321", N_("/list start"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
{ "322", N_("channel (for /list)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
{ "323", N_("/list end"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
{ "324", N_("channel mode"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
{ "329", "???", "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
{ "331", N_("no topic for channel"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_whowas, NULL },
{ "001", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "002", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "003", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "004", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
{ "005", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "008", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "020", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "042", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "212", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "219", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "221", N_("user mode string"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
{ "250", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "251", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "252", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "253", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "254", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "255", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "256", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "257", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "258", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "259", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "260", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "261", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "262", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "263", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "264", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "265", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "266", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "267", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "268", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "269", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "301", N_("away message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
{ "302", N_("userhost"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
{ "303", N_("ison"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
{ "305", N_("unaway"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
{ "306", N_("now away"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
{ "311", N_("whois (user)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
{ "314", N_("whowas"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
{ "315", N_("end of /who list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
{ "317", N_("whois (idle)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
{ "318", N_("whois (end)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
{ "319", N_("whois (channels)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
{ "320", N_("whois (identified user)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
{ "321", N_("/list start"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
{ "322", N_("channel (for /list)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
{ "323", N_("/list end"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
{ "324", N_("channel mode"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
{ "329", "???", "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
{ "331", N_("no topic for channel"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
{ "332", N_("topic of channel"),
N_("channel :topic"),
N_("channel: name of channel\n"
"topic: topic of the channel"),
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
{ "333", N_("infos about topic (nick & date changed)"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "344", N_("channel reop"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
{ "345", N_("end of channel reop list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
{ "348", N_("channel exception list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_348 },
{ "349", N_("end of channel exception list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_349 },
{ "351", N_("server version"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
NULL, 2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
{ "333", N_("infos about topic (nick & date changed)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "344", N_("channel reop"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
{ "345", N_("end of channel reop list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
{ "348", N_("channel exception list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_348 },
{ "349", N_("end of channel exception list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_349 },
{ "351", N_("server version"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
{ "353", N_("list of nicks on channel"),
N_("channel :[[@|+]nick ...]"),
N_("channel: name of channel\n"
"nick: nick on the channel"),
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
{ "364", N_("links"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "365", N_("end of /links list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "366", N_("end of /names list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
{ "367", N_("banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
{ "368", N_("end of banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
{ "369", N_("end of /whowas list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "371", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "372", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "373", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "374", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "375", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "376", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "381", N_("you are now an IRC operator"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "382", N_("rehashing"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "391", N_("server local time"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "401", N_("no such nick/channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "402", N_("no such server"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "403", N_("no such channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "404", N_("cannot send to channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "405", N_("too many channels"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "406", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "407", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "409", N_("no origin"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "410", N_("no services"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "411", N_("no recipient"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "412", N_("no text to send"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "413", N_("no toplevel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "414", N_("wilcard in toplevel domain"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "421", N_("unknown command"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "422", N_("MOTD is missing"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "423", N_("no administrative info"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "424", N_("file error"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "431", N_("no nickname given"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "432", N_("erroneous nickname"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "433", N_("nickname already in use"),
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_433 },
{ "436", N_("nickname collision"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "438", N_("not authorized to change nickname"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_438 },
{ "441", N_("user not in channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "442", N_("not on channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "443", N_("user already on channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "444", N_("user not logged in"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "445", N_("summon has been disabled"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "446", N_("users has been disabled"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "451", N_("you are not registered"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "461", N_("not enough parameters"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "462", N_("you may not register"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "463", N_("your host isn't among the privileged"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "464", N_("password incorrect"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "465", N_("you are banned from this server"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "467", N_("channel key already set"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "470", N_("forwarding to another channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "471", N_("channel is already full"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "472", N_("unknown mode char to me"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "473", N_("cannot join channel (invite only)"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "474", N_("cannot join channel (banned from channel)"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "475", N_("cannot join channel (bad channel key)"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "476", N_("bad channel mask"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "477", N_("channel doesn't support modes"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "481", N_("you're not an IRC operator"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "482", N_("you're not channel operator"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "484", N_("your connection is restricted!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "501", N_("unknown mode flag"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "502", N_("can't change mode for other users"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "505", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "671", N_("whois (secure connection)"),
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
NULL, 2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
{ "364", N_("links"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "365", N_("end of /links list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "366", N_("end of /names list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
{ "367", N_("banlist"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
{ "368", N_("end of banlist"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
{ "369", N_("end of /whowas list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "371", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "372", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "373", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "374", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "375", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "376", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "381", N_("you are now an IRC operator"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "382", N_("rehashing"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "391", N_("server local time"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "401", N_("no such nick/channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "402", N_("no such server"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "403", N_("no such channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "404", N_("cannot send to channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "405", N_("too many channels"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "406", N_("was no such nick"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "407", N_("was no such nick"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "409", N_("no origin"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "410", N_("no services"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "411", N_("no recipient"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "412", N_("no text to send"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "413", N_("no toplevel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "414", N_("wilcard in toplevel domain"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "421", N_("unknown command"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "422", N_("MOTD is missing"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "423", N_("no administrative info"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "424", N_("file error"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "431", N_("no nickname given"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "432", N_("erroneous nickname"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "433", N_("nickname already in use"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_433 },
{ "436", N_("nickname collision"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "438", N_("not authorized to change nickname"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_438 },
{ "441", N_("user not in channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "442", N_("not on channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "443", N_("user already on channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "444", N_("user not logged in"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "445", N_("summon has been disabled"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "446", N_("users has been disabled"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "451", N_("you are not registered"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "461", N_("not enough parameters"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "462", N_("you may not register"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "463", N_("your host isn't among the privileged"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "464", N_("password incorrect"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "465", N_("you are banned from this server"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "467", N_("channel key already set"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "470", N_("forwarding to another channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "471", N_("channel is already full"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "472", N_("unknown mode char to me"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "473", N_("cannot join channel (invite only)"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "474", N_("cannot join channel (banned from channel)"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "475", N_("cannot join channel (bad channel key)"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "476", N_("bad channel mask"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "477", N_("channel doesn't support modes"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "481", N_("you're not an IRC operator"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "482", N_("you're not channel operator"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "484", N_("your connection is restricted!"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "501", N_("unknown mode flag"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "502", N_("can't change mode for other users"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "505", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "671", N_("whois (secure connection)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
};
+123 -121
View File
@@ -66,12 +66,12 @@ typedef struct t_irc_nick t_irc_nick;
struct t_irc_nick
{
char *nick; /* nickname */
int flags; /* chanowner/chanadmin (unrealircd), */
/* op, halfop, voice, away */
int color; /* color for nickname in chat window */
t_irc_nick *prev_nick; /* link to previous nick on the channel */
t_irc_nick *next_nick; /* link to next nick on the channel */
char *nick; /* nickname */
int flags; /* chanowner/chanadmin (unrealircd), */
/* op, halfop, voice, away */
int color; /* color for nickname in chat window */
t_irc_nick *prev_nick; /* link to previous nick on the channel */
t_irc_nick *next_nick; /* link to next nick on the channel */
};
/* channel types */
@@ -100,20 +100,20 @@ typedef struct t_irc_channel t_irc_channel;
struct t_irc_channel
{
int type; /* channel type */
void *dcc_chat; /* DCC CHAT pointer (NULL if not DCC) */
char *name; /* name of channel (exemple: "#abc") */
char *topic; /* topic of channel (host for private) */
char *modes; /* channel modes */
int limit; /* user limit (0 is limit not set) */
char *key; /* channel key (NULL if no key is set) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
t_irc_nick *nicks; /* nicks on the channel */
t_irc_nick *last_nick; /* last nick on the channel */
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
t_irc_channel *prev_channel; /* link to previous channel */
t_irc_channel *next_channel; /* link to next channel */
int type; /* channel type */
void *dcc_chat; /* DCC CHAT pointer (NULL if not DCC) */
char *name; /* name of channel (exemple: "#abc") */
char *topic; /* topic of channel (host for private) */
char *modes; /* channel modes */
int limit; /* user limit (0 is limit not set) */
char *key; /* channel key (NULL if no key is set) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
t_irc_nick *nicks; /* nicks on the channel */
t_irc_nick *last_nick; /* last nick on the channel */
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
t_irc_channel *prev_channel; /* link to previous channel */
t_irc_channel *next_channel; /* link to next channel */
};
/* server types */
@@ -123,55 +123,55 @@ typedef struct t_irc_server t_irc_server;
struct t_irc_server
{
/* user choices */
char *name; /* name of server (only for display) */
int autoconnect; /* = 1 if auto connect at startup */
int autoreconnect; /* = 1 if auto reco when disconnected */
int autoreconnect_delay; /* delay before trying again reconnect */
int command_line; /* server was given on command line */
char *address; /* address of server (IP or name) */
int port; /* port for server (6667 by default) */
int ipv6; /* use IPv6 protocol */
int ssl; /* SSL protocol */
char *password; /* password for server */
char *nick1; /* first nickname for the server */
char *nick2; /* alternate nickname */
char *nick3; /* 2nd alternate nickname */
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
char *notify_levels; /* channels notify levels */
char *charset_decode_iso; /* channels charsets for decoding ISO */
char *charset_decode_utf; /* channels charsets for decoding UTF */
char *charset_encode; /* channels charsets for encoding msgs */
char *name; /* name of server (only for display) */
int autoconnect; /* = 1 if auto connect at startup */
int autoreconnect; /* = 1 if auto reco when disconnected */
int autoreconnect_delay; /* delay before trying again reconnect */
int command_line; /* server was given on command line */
char *address; /* address of server (IP or name) */
int port; /* port for server (6667 by default) */
int ipv6; /* use IPv6 protocol */
int ssl; /* SSL protocol */
char *password; /* password for server */
char *nick1; /* first nickname for the server */
char *nick2; /* alternate nickname */
char *nick3; /* 2nd alternate nickname */
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
char *notify_levels; /* channels notify levels */
char *charset_decode_iso; /* channels charsets for decoding ISO */
char *charset_decode_utf; /* channels charsets for decoding UTF */
char *charset_encode; /* channels charsets for encoding msgs */
/* internal vars */
pid_t child_pid; /* pid of child process (connecting) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
int sock; /* socket for server (IPv4 or IPv6) */
int is_connected; /* 1 if WeeChat is connected to server */
int ssl_connected; /* = 1 if connected with SSL */
pid_t child_pid; /* pid of child process (connecting) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
int sock; /* socket for server (IPv4 or IPv6) */
int is_connected; /* 1 if WeeChat is connected to server */
int ssl_connected; /* = 1 if connected with SSL */
#ifdef HAVE_GNUTLS
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
#endif
char *unterminated_message; /* beginning of a message in input buf */
char *nick; /* current nickname */
time_t reconnect_start; /* this time + delay = reconnect time */
int reconnect_join; /* 1 if channels opened to rejoin */
int is_away; /* 1 is user is marker as away */
time_t away_time; /* time() when user marking as away */
int lag; /* lag (in milliseconds) */
struct timeval lag_check_time; /* last time lag was checked (ping sent)*/
time_t lag_next_check; /* time for next check */
t_gui_buffer *buffer; /* GUI buffer allocated for server */
t_gui_buffer *saved_buffer; /* channel before jumping to next server*/
t_irc_channel *channels; /* opened channels on server */
t_irc_channel *last_channel; /* last opened channal on server */
t_irc_server *prev_server; /* link to previous server */
t_irc_server *next_server; /* link to next server */
char *unterminated_message; /* beginning of a message in input buf */
char *nick; /* current nickname */
time_t reconnect_start; /* this time + delay = reconnect time */
int reconnect_join; /* 1 if channels opened to rejoin */
int is_away; /* 1 is user is marker as away */
time_t away_time; /* time() when user marking as away */
int lag; /* lag (in milliseconds) */
struct timeval lag_check_time; /* last time lag was checked (ping sent) */
time_t lag_next_check; /* time for next check */
t_gui_buffer *buffer; /* GUI buffer allocated for server */
t_gui_buffer *saved_buffer; /* channel before jumping to next server */
t_irc_channel *channels; /* opened channels on server */
t_irc_channel *last_channel; /* last opened channal on server */
t_irc_server *prev_server; /* link to previous server */
t_irc_server *next_server; /* link to next server */
};
/* irc commands */
@@ -180,18 +180,20 @@ typedef struct t_irc_command t_irc_command;
struct t_irc_command
{
char *command_name; /* command name (internal or IRC cmd) */
char *command_description; /* command description */
char *arguments; /* command parameters */
char *arguments_description; /* parameters description */
int min_arg, max_arg; /* min & max number of parameters */
int need_connection; /* = 1 if cmd needs server connection */
char *command_name; /* IRC command name */
char *command_description; /* command description (for /help) */
char *arguments; /* command arguments (for /help) */
char *arguments_description; /* arguments description (for /help) */
char *completion_template; /* template for completion */
/* NULL=no completion, ""=default (nick) */
int min_arg, max_arg; /* min & max number of arguments */
int need_connection; /* = 1 if cmd needs server connection */
int (*cmd_function_args)(t_irc_server *, int, char **);
/* function called when user enters cmd */
/* function called when user enters cmd */
int (*cmd_function_1arg)(t_irc_server *, char *);
/* function called when user enters cmd */
/* function called when user enters cmd */
int (*recv_function)(t_irc_server *, char *, char *, char *);
/* function called when cmd is received */
/* function called when cmd is received */
};
/* irc messages */
@@ -200,24 +202,24 @@ typedef struct t_irc_message t_irc_message;
struct t_irc_message
{
t_irc_server *server; /* server pointer for received msg */
char *data; /* message content */
t_irc_message *next_message; /* link to next message */
t_irc_server *server; /* server pointer for received msg */
char *data; /* message content */
t_irc_message *next_message; /* link to next message */
};
/* DCC types */
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
#define DCC_CHAT_SEND 1 /* sending DCC chat */
#define DCC_FILE_RECV 2 /* incoming DCC file */
#define DCC_FILE_SEND 3 /* sending DCC file */
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
#define DCC_CHAT_SEND 1 /* sending DCC chat */
#define DCC_FILE_RECV 2 /* incoming DCC file */
#define DCC_FILE_SEND 3 /* sending DCC file */
#define DCC_WAITING 0 /* waiting for host answer */
#define DCC_CONNECTING 1 /* connecting to host */
#define DCC_ACTIVE 2 /* sending/receiving data */
#define DCC_DONE 3 /* transfer done */
#define DCC_FAILED 4 /* DCC failed */
#define DCC_ABORTED 5 /* DCC aborted by user */
#define DCC_WAITING 0 /* waiting for host answer */
#define DCC_CONNECTING 1 /* connecting to host */
#define DCC_ACTIVE 2 /* sending/receiving data */
#define DCC_DONE 3 /* transfer done */
#define DCC_FAILED 4 /* DCC failed */
#define DCC_ABORTED 5 /* DCC aborted by user */
#define DCC_IS_CHAT(type) ((type == DCC_CHAT_RECV) || (type == DCC_CHAT_SEND))
#define DCC_IS_FILE(type) ((type == DCC_FILE_RECV) || (type == DCC_FILE_SEND))
@@ -231,38 +233,38 @@ typedef struct t_irc_dcc t_irc_dcc;
struct t_irc_dcc
{
t_irc_server *server; /* irc server */
t_irc_channel *channel; /* irc channel (for DCC chat only) */
int type; /* DCC type (send or receive) */
int status; /* DCC status (waiting, sending, ..) */
time_t start_time; /* the time when DCC started */
time_t start_transfer; /* the time when DCC transfer started */
unsigned long addr; /* IP address */
int port; /* port */
char *nick; /* remote nick */
int sock; /* socket for connection */
char *unterminated_message; /* beginning of a message in input buf */
int file; /* local file (for reading or writing) */
char *filename; /* filename (given by sender) */
char *local_filename; /* local filename (with path) */
int filename_suffix; /* suffix (.1 for ex) if renaming file */
unsigned long size; /* file size */
unsigned long pos; /* number of bytes received/sent */
unsigned long ack; /* number of bytes received OK */
unsigned long start_resume; /* start of resume (in bytes) */
time_t last_check_time; /* last time we looked at bytes sent/rcv*/
unsigned long last_check_pos; /* bytes sent/recv at last check */
time_t last_activity; /* time of last byte received/sent */
unsigned long bytes_per_sec; /* bytes per second */
unsigned long eta; /* estimated time of arrival */
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
t_irc_server *server; /* irc server */
t_irc_channel *channel; /* irc channel (for DCC chat only) */
int type; /* DCC type (send or receive) */
int status; /* DCC status (waiting, sending, ..) */
time_t start_time; /* the time when DCC started */
time_t start_transfer; /* the time when DCC transfer started */
unsigned long addr; /* IP address */
int port; /* port */
char *nick; /* remote nick */
int sock; /* socket for connection */
char *unterminated_message; /* beginning of a message in input buf */
int file; /* local file (for reading or writing) */
char *filename; /* filename (given by sender) */
char *local_filename; /* local filename (with path) */
int filename_suffix; /* suffix (.1 for ex) if renaming file */
unsigned long size; /* file size */
unsigned long pos; /* number of bytes received/sent */
unsigned long ack; /* number of bytes received OK */
unsigned long start_resume; /* start of resume (in bytes) */
time_t last_check_time; /* last time we looked at bytes sent/recv */
unsigned long last_check_pos; /* bytes sent/recv at last check */
time_t last_activity; /* time of last byte received/sent */
unsigned long bytes_per_sec; /* bytes per second */
unsigned long eta; /* estimated time of arrival */
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
};
/* ignore types */
/* pre-defined ignore types, all other types are made with IRC commands */
/* for example: part join quit notice invite ... */
/* pre-defined ignore types, all other types are made with IRC commands */
/* for example: part join quit notice invite ... */
#define IGNORE_ACTION "action"
#define IGNORE_CTCP "ctcp"
@@ -273,12 +275,12 @@ typedef struct t_irc_ignore t_irc_ignore;
struct t_irc_ignore
{
char *mask; /* nickname or mask */
char *type; /* type of ignore */
char *channel_name; /* name of channel, "*" == all */
char *server_name; /* name of server, "*" == all */
t_irc_ignore *prev_ignore; /* pointer to previous ignore */
t_irc_ignore *next_ignore; /* pointer to next ignore */
char *mask; /* nickname or mask */
char *type; /* type of ignore */
char *channel_name; /* name of channel, "*" == all */
char *server_name; /* name of server, "*" == all */
t_irc_ignore *prev_ignore; /* pointer to previous ignore */
t_irc_ignore *next_ignore; /* pointer to next ignore */
};
/* variables */
+2
View File
@@ -237,12 +237,14 @@ t_plugin_handler *
weechat_plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
char *description, char *arguments,
char *arguments_description,
char *completion_template,
t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)
{
if (plugin && command && handler_func)
return plugin_cmd_handler_add (plugin, command, description, arguments,
arguments_description,
completion_template,
handler_func,
handler_args, handler_pointer);
+53 -49
View File
@@ -225,10 +225,11 @@ plugin_msg_handler_add (t_weechat_plugin *plugin, char *irc_command,
* 3. command description (for /help)
* 4. command arguments (for /help)
* 5. command args description (for /help)
* 6. the handler function
* 7. handler args: a string given to
* 6. completion template
* 7. the handler function
* 8. handler args: a string given to
* handler when called (used by scripts)
* 8. handler pointer: a pointer given to
* 9. handler pointer: a pointer given to
* handler when called (used by scripts)
*/
@@ -236,6 +237,7 @@ t_plugin_handler *
plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
char *description, char *arguments,
char *arguments_description,
char *completion_template,
t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)
{
@@ -260,6 +262,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
new_handler->description = (description) ? strdup (description) : NULL;
new_handler->arguments = (arguments) ? strdup (arguments) : NULL;
new_handler->arguments_description = (arguments_description) ? strdup (arguments_description) : NULL;
new_handler->completion_template = (completion_template) ? strdup (completion_template) : NULL;
new_handler->handler = handler_func;
new_handler->handler_args = (handler_args) ? strdup (handler_args) : NULL;
new_handler->handler_pointer = handler_pointer;
@@ -706,35 +709,61 @@ int plugin_auto_load_file (t_weechat_plugin *plugin, char *filename)
void plugin_auto_load ()
{
char *ptr_home, *dir_name;
char *ptr_home, *dir_name, *list_plugins, *pos, *pos2;
/* auto-load plugins in WeeChat home dir */
if (cfg_plugins_path && cfg_plugins_path[0])
if (cfg_plugins_autoload && cfg_plugins_autoload[0])
{
if (cfg_plugins_path[0] == '~')
if (ascii_strcasecmp (cfg_plugins_autoload, "*") == 0)
{
ptr_home = getenv ("HOME");
dir_name = (char *)malloc (strlen (cfg_plugins_path) + strlen (ptr_home) + 2);
/* auto-load plugins in WeeChat home dir */
if (cfg_plugins_path && cfg_plugins_path[0])
{
if (cfg_plugins_path[0] == '~')
{
ptr_home = getenv ("HOME");
dir_name = (char *)malloc (strlen (cfg_plugins_path) + strlen (ptr_home) + 2);
if (dir_name)
{
strcpy (dir_name, ptr_home);
strcat (dir_name, cfg_plugins_path + 1);
plugin_exec_on_files (NULL, dir_name, &plugin_auto_load_file);
free (dir_name);
}
}
else
plugin_exec_on_files (NULL, cfg_plugins_path, &plugin_auto_load_file);
}
/* auto-load plugins in WeeChat global lib dir */
dir_name = (char *)malloc (strlen (WEECHAT_LIBDIR) + 16);
if (dir_name)
{
strcpy (dir_name, ptr_home);
strcat (dir_name, cfg_plugins_path + 1);
snprintf (dir_name, strlen (WEECHAT_LIBDIR) + 16,
"%s/plugins", WEECHAT_LIBDIR);
plugin_exec_on_files (NULL, dir_name, &plugin_auto_load_file);
free (dir_name);
}
}
else
plugin_exec_on_files (NULL, cfg_plugins_path, &plugin_auto_load_file);
}
/* auto-load plugins in WeeChat global lib dir */
dir_name = (char *)malloc (strlen (WEECHAT_LIBDIR) + 16);
if (dir_name)
{
snprintf (dir_name, strlen (WEECHAT_LIBDIR) + 16,
"%s/plugins", WEECHAT_LIBDIR);
plugin_exec_on_files (NULL, dir_name, &plugin_auto_load_file);
free (dir_name);
{
list_plugins = strdup (cfg_plugins_autoload);
if (list_plugins)
{
pos = list_plugins;
while (pos && pos[0])
{
pos2 = strchr (pos, ',');
if (pos2)
pos2[0] = '\0';
plugin_load (pos);
if (pos2)
pos = pos2 + 1;
else
pos = NULL;
}
free (list_plugins);
}
}
}
}
@@ -835,37 +864,12 @@ plugin_unload_all ()
void
plugin_init (int auto_load)
{
char *list_plugins, *pos, *pos2;
/* read plugins options on disk */
plugin_config_read ();
/* auto-load plugins if asked */
if (auto_load && cfg_plugins_autoload && cfg_plugins_autoload[0])
{
if (ascii_strcasecmp (cfg_plugins_autoload, "*") == 0)
plugin_auto_load ();
else
{
list_plugins = strdup (cfg_plugins_autoload);
if (list_plugins)
{
pos = list_plugins;
while (pos && pos[0])
{
pos2 = strchr (pos, ',');
if (pos2)
pos2[0] = '\0';
plugin_load (pos);
if (pos2)
pos = pos2 + 1;
else
pos = NULL;
}
free (list_plugins);
}
}
}
if (auto_load)
plugin_auto_load ();
}
/*
+1
View File
@@ -41,6 +41,7 @@ extern t_plugin_handler *plugin_msg_handler_add (t_weechat_plugin *, char *,
char *, void *);
extern t_plugin_handler *plugin_cmd_handler_add (t_weechat_plugin *, char *,
char *, char *, char *,
char *,
t_plugin_handler_func *,
char *, void *);
extern int plugin_msg_handler_exec (char *, char *, char *);
+4
View File
@@ -426,6 +426,7 @@ static XS (XS_weechat_add_message_handler)
static XS (XS_weechat_add_command_handler)
{
char *command, *function, *description, *arguments, *arguments_description;
char *completion_template;
unsigned int integer;
dXSARGS;
@@ -453,12 +454,14 @@ static XS (XS_weechat_add_command_handler)
description = (items >= 3) ? SvPV (ST (2), integer) : NULL;
arguments = (items >= 4) ? SvPV (ST (3), integer) : NULL;
arguments_description = (items >= 5) ? SvPV (ST (4), integer) : NULL;
completion_template = (items >= 6) ? SvPV (ST (5), integer) : NULL;
if (perl_plugin->cmd_handler_add (perl_plugin,
command,
description,
arguments,
arguments_description,
completion_template,
weechat_perl_handler,
function,
(void *)perl_current_script))
@@ -1197,6 +1200,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
"[load filename] | [autoload] | [reload] | [unload]",
"filename: Perl script (file) to load\n\n"
"Without argument, /perl command lists all loaded Perl scripts.",
"load|autoload|reload|unload",
weechat_perl_cmd, NULL, NULL);
plugin->mkdir_home (plugin, "perl");
+7 -2
View File
@@ -333,6 +333,7 @@ static PyObject *
weechat_python_add_command_handler (PyObject *self, PyObject *args)
{
char *command, *function, *description, *arguments, *arguments_description;
char *completion_template;
/* make gcc happy */
(void) self;
@@ -350,9 +351,11 @@ weechat_python_add_command_handler (PyObject *self, PyObject *args)
description = NULL;
arguments = NULL;
arguments_description = NULL;
completion_template = NULL;
if (!PyArg_ParseTuple (args, "ss|sss", &command, &function,
&description, &arguments, &arguments_description))
if (!PyArg_ParseTuple (args, "ss|ssss", &command, &function,
&description, &arguments, &arguments_description,
completion_template))
{
python_plugin->printf_server (python_plugin,
"Python error: wrong parameters for "
@@ -365,6 +368,7 @@ weechat_python_add_command_handler (PyObject *self, PyObject *args)
description,
arguments,
arguments_description,
completion_template,
weechat_python_handler,
function,
(void *)python_current_script))
@@ -1151,6 +1155,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
"[load filename] | [autoload] | [reload] | [unload]",
"filename: Python script (file) to load\n\n"
"Without argument, /python command lists all loaded Python scripts.",
"load|autoload|reload|unload",
weechat_python_cmd, NULL, NULL);
plugin->mkdir_home (plugin, "python");
+16 -3
View File
@@ -448,7 +448,9 @@ static VALUE
weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
{
VALUE command, function, description, arguments, arguments_description;
VALUE completion_template;
char *c_command, *c_function, *c_description, *c_arguments, *c_arguments_description;
char *c_completion_template;
/* make gcc happy */
(void) class;
@@ -466,14 +468,16 @@ weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
description = Qnil;
arguments = Qnil;
arguments_description = Qnil;
completion_template = Qnil;
c_command = NULL;
c_function = NULL;
c_description = NULL;
c_arguments = NULL;
c_arguments_description = NULL;
c_completion_template = NULL;
rb_scan_args (argc, argv, "23", &command, &function, &description,
&arguments, &arguments_description);
rb_scan_args (argc, argv, "24", &command, &function, &description,
&arguments, &arguments_description, &completion_template);
if (NIL_P (command) || NIL_P (function))
{
@@ -500,16 +504,24 @@ weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
c_arguments = STR2CSTR (arguments);
}
if (!NIL_P (arguments_description)) {
if (!NIL_P (arguments_description))
{
Check_Type (arguments_description, T_STRING);
c_arguments_description = STR2CSTR (arguments_description);
}
if (!NIL_P (completion_template))
{
Check_Type (completion_template, T_STRING);
c_completion_template = STR2CSTR (completion_template);
}
if (ruby_plugin->cmd_handler_add (ruby_plugin,
c_command,
c_description,
c_arguments,
c_arguments_description,
c_completion_template,
weechat_ruby_handler,
c_function,
(void *)ruby_current_script))
@@ -1322,6 +1334,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
"[load filename] | [autoload] | [reload] | [unload]",
"filename: Ruby script (file) to load\n\n"
"Without argument, /ruby command lists all loaded Ruby scripts.",
"load|autoload|reload|unload",
weechat_ruby_cmd, NULL, NULL);
plugin->mkdir_home (plugin, "ruby");
+3
View File
@@ -86,6 +86,7 @@ struct t_plugin_handler
char *description; /* (for /help) short cmd description */
char *arguments; /* (for /help) command arguments */
char *arguments_description; /* (for /help) args long description */
char *completion_template; /* template for completion */
/* data common to all handlers */
t_plugin_handler_func *handler; /* pointer to handler */
@@ -141,6 +142,7 @@ struct t_weechat_plugin
char *, void *);
t_plugin_handler *(*cmd_handler_add) (t_weechat_plugin *, char *,
char *, char *, char *,
char *,
t_plugin_handler_func *,
char *, void *);
void (*handler_remove) (t_weechat_plugin *, t_plugin_handler *);
@@ -178,6 +180,7 @@ extern t_plugin_handler *weechat_plugin_msg_handler_add (t_weechat_plugin *, cha
char *, void *);
extern t_plugin_handler *weechat_plugin_cmd_handler_add (t_weechat_plugin *, char *,
char *, char *, char *,
char *,
t_plugin_handler_func *,
char *, void *);
extern void weechat_plugin_handler_remove (t_weechat_plugin *, t_plugin_handler *);
+3 -1
View File
@@ -1,10 +1,12 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-12-11
ChangeLog - 2005-12-16
Version 0.1.7 (under dev!):
* added completion system for plugins/scripts commands
* fixed plugins autoload
* added charset by server and channel, new command: /charset
* added Ruby script plugin
* added /upgrade command
+77 -13
View File
@@ -35,7 +35,7 @@
@title WeeChat - User guide
@subtitle Fast, light and extensible IRC client
@subtitle Documentation for WeeChat v0.1.7-cvs - December, 15 2005
@subtitle Documentation for WeeChat v0.1.7-cvs - December, 16 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -1525,18 +1525,14 @@ call next command in global history@*
scroll one page up@*
@item page_down
scroll one page down@*
@item infobar_clear
clear infobar@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item nick_beginning
display beginning of nicklist@*
@item nick_end
display end of nicklist@*
@item refresh
refresh screen@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item jump_smart
jump to buffer with activity@*
@item jump_dcc
@@ -1547,8 +1543,20 @@ jump to last buffer@*
jump to server buffer@*
@item jump_next_server
jump to next server@*
@item switch_server
switch active server on servers buffer@*
@item scroll_previous_highlight
scroll to previous highlight in buffer@*
@item scroll_next_highlight
scroll to next highlight in buffer@*
@item scroll_unread
scroll to first unread line in buffer@*
@item hotlist_clear
clear hotlist@*
@item infobar_clear
clear infobar@*
@item refresh
refresh screen@*
@item grab_key
grab a key@*
@end table
@@ -1920,8 +1928,9 @@ WeeChat neither other plugins
@item
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin
*plugin, char *command, char *description, char *arguments,
char *arguments_description, t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)}@*
char *arguments_description, char *completion_template,
t_plugin_handler_func *handler_func, char *handler_args,
void *handler_pointer)}@*
@*
Add a WeeChat command handler, called when user uses command
(for example /command).@*
@@ -1936,6 +1945,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@item @option{handler_func}: function called when comand is executed
@item @option{handler_args}: arguments given to function when called
@item @option{handler_pointer}: pointer given to function when called
@@ -2274,6 +2309,7 @@ int weechat_plugin_init (t_weechat_plugin *plugin)
"Display two times a message",
"msg",
"msg: message",
NULL,
&toto_cmd_double,
NULL, NULL);
return PLUGIN_RC_OK;
@@ -2468,9 +2504,11 @@ WeeChat neither other plugins
@item
Perl: @command{weechat::add_command_handler ( name, function,
[description, arguments, arguments_description] );}@*
[description, arguments, arguments_description,
completion_template] );}@*
Python: @command{weechat.add_command_handler ( name, function,
[description, arguments, arguments_description] )}@*
[description, arguments, arguments_description,
completion_template] )}@*
@*
Create new WeeChat command, linked with script function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -2488,6 +2526,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@end itemize
@*
@emph{Return value:}@*
+103 -39
View File
@@ -36,7 +36,7 @@
@title WeeChat - Gui@'on de usuario.
@subtitle Cliente IRC r@'apido, peque@~no y extensible
@subtitle Documentaci@'on para WeeChat v0.1.7-cvs - 15 de diciembre de 2005
@subtitle Documentaci@'on para WeeChat v0.1.7-cvs - 16 de diciembre de 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -1480,75 +1480,83 @@ Internal functions for keys:@*
@table @kbd
@item return
terminar l@'inea@*
terminate line@*
@item tab
completar palabra@*
complete word@*
@item backspace
borrar el car@'acter anterior@*
delete previous char@*
@item delete
borrar el car@'acter siguiente@*
delete next char@*
@item delete_end_line
borrar hasta fin de l@'inea@*
delete until end of line@*
@item delete_beginning_line
borrar hasta principio de l@'inea@*
delete until beginning of line@*
@item delete_line
borrar l@'inea entera@*
delete entire line@*
@item delete_previous_word
borrar la palabra anterior@*
delete previous word@*
@item delete_next_word
borrar la palabra siguiente@*
delete next word@*
@item clipboard_paste
paste current clipboard content@*
@item transpose_chars
transpose chars@*
@item home
ir al principio de l@'inea@*
go to beginning of line@*
@item end
ir al final de l@'inea@*
go to end of line@*
@item left
mover un car@'acter a la izquierda@*
move one char left@*
@item previous_word
mover a la palabra anterior@*
move to previous word@*
@item right
mover un car@'acter a la derecha@*
move one char right@*
@item next_word
mover a la palabra siguiente@*
move to next word@*
@item up
llamar al comando anterior en el historial@*
call previous command in history@*
@item up_global
call previous command in global history@*
@item down
llamar al comando siguiente en el historial@*
call next command in history@*
@item down_global
call next command in global history@*
@item page_up
desplazarse una p@'agina hacia arriba@*
scroll one page up@*
@item page_down
desplazarse una p@'agina hacia abajo@*
@item infobar_clear
limpiar barra de informaci@'on@*
@item nick_page_up
desplazar la lista de nicks una p@'agina hacia arriba@*
@item nick_page_down
desplazar la lista de nicks una p@'agina hacia abajo@*
scroll one page down@*
@item nick_beginning
mostrar el principio de la lista de nicks@*
display beginning of nicklist@*
@item nick_end
mostrar el final de la lista de nicks@*
@item refresh
recargar la pantalla@*
display end of nicklist@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item jump_smart
saltar al búfer con actividad@*
jump to buffer with activity@*
@item jump_dcc
saltar al búfer DCC@*
jump to DCC buffer@*
@item jump_last_buffer
jump to last buffer@*
@item jump_server
saltar al búfer servidor@*
jump to server buffer@*
@item jump_next_server
saltar al servidor siguiente@*
jump to next server@*
@item switch_server
switch active server on servers buffer@*
@item scroll_previous_highlight
scroll to previous highlight in buffer@*
@item scroll_next_highlight
scroll to next highlight in buffer@*
@item scroll_unread
scroll to first unread line in buffer@*
@item hotlist_clear
limpiar hotlist@*
clear hotlist@*
@item infobar_clear
clear infobar@*
@item refresh
refresh screen@*
@item grab_key
grab a key@*
@end table
@@ -1923,8 +1931,9 @@ WeeChat neither other plugins
@item
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin
*plugin, char *command, char *description, char *arguments,
char *arguments_description, t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)}@*
char *arguments_description, char *completion_template,
t_plugin_handler_func *handler_func, char *handler_args,
void *handler_pointer)}@*
@*
Add a WeeChat command handler, called when user uses command
(for example /command).@*
@@ -1939,6 +1948,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@item @option{handler_func}: function called when comand is executed
@item @option{handler_args}: arguments given to function when called
@item @option{handler_pointer}: pointer given to function when called
@@ -2271,6 +2306,7 @@ int weechat_plugin_init (t_weechat_plugin *plugin)
"Display two times a message",
"msg",
"msg: message",
NULL,
&toto_cmd_double,
NULL, NULL);
return PLUGIN_RC_OK;
@@ -2465,9 +2501,11 @@ WeeChat neither other plugins
@item
Perl: @command{weechat::add_command_handler ( name, function,
[description, arguments, arguments_description] );}@*
[description, arguments, arguments_description,
completion_template] );}@*
Python: @command{weechat.add_command_handler ( name, function,
[description, arguments, arguments_description] )}@*
[description, arguments, arguments_description,
completion_template] )}@*
@*
Create new WeeChat command, linked with script function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -2485,6 +2523,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@end itemize
@*
@emph{Return value:}@*
+79 -13
View File
@@ -36,7 +36,7 @@
@title WeeChat - Guide utilisateur
@subtitle Client IRC rapide, l@'eger et extensible
@subtitle Documentation pour WeeChat v0.1.7-cvs - 15 decembre 2005
@subtitle Documentation pour WeeChat v0.1.7-cvs - 16 decembre 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -1526,18 +1526,14 @@ appeler la commande suivante dans l'historique global@*
faire d@'efiler d'une page vers le haut@*
@item page_down
faire d@'efiler d'une page vers le bas@*
@item infobar_clear
effacer la barre d'infos@*
@item nick_page_up
faire d@'efiler la liste des pseudos d'une page vers le haut@*
@item nick_page_down
faire d@'efiler la liste des pseudos d'une page vers le bas@*
@item nick_beginning
afficher le d@'ebut de la liste des pseudos@*
@item nick_end
afficher la fin de la liste des pseudos@*
@item refresh
rafraichir l'@'ecran@*
@item nick_page_up
faire d@'efiler la liste des pseudos d'une page vers le haut@*
@item nick_page_down
faire d@'efiler la liste des pseudos d'une page vers le bas@*
@item jump_smart
sauter au tampon avec de l'activit@'e@*
@item jump_dcc
@@ -1548,8 +1544,20 @@ sauter au dernier tampon@*
sauter au tampon du serveur@*
@item jump_next_server
sauter au prochain serveur@*
@item switch_server
bascule de serveur actif sur le tampon des serveurs@*
@item scroll_previous_highlight
scroller jusqu'au highlight pr@'ec@'edent du tampon@*
@item scroll_next_highlight
scroller jusqu'au highlight suivant du tampon@*
@item scroll_unread
scroller jusqu'@`a la premi@`ere ligne non lue du tampon@*
@item hotlist_clear
effacer la liste d'activit@'e@*
@item infobar_clear
effacer la barre d'infos@*
@item refresh
rafraichir l'@'ecran@*
@item grab_key
capturer une touche@*
@end table
@@ -1938,8 +1946,9 @@ WeeChat ni @`a d'autres extensions
@item
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin
*plugin, char *command, char *description, char *arguments,
char *arguments_description, t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)}@*
char *arguments_description, char *completion_template,
t_plugin_handler_func *handler_func, char *handler_args,
void *handler_pointer)}@*
@*
Ajoute un gestionnaire de commande WeeChat, appel@'e d@`es que
l'utilisateur utilise la commande (par exemple /commande).@*
@@ -1954,6 +1963,33 @@ l'utilisateur utilise la commande (par exemple /commande).@*
commande (affich@'ee par /help commande)
@item @option{arguments_description}: longue description des
param@`etres de la commande (affich@'ee par /help commande)
@item @option{completion_template}: mod@`ele pour la compl@'etion, sous
la forme @code{abc|%w def|%i} qui signifie ``abc'' ou une comande
WeeChat pour le premier param@`etre, et ``def'' ou une commande IRC
pour le deuxi@`eme.@*
Les codes suivants peuvent @^etre utilis@'es :
@itemize @minus
@item @code{%-}: aucune compl@'etion pour le param@`etre
@item @code{%a}: alias
@item @code{%A}: alias et commandes (WeeChat, IRC et extensions)
@item @code{%c}: canal courant
@item @code{%C}: canaux du serveur courant
@item @code{%f}: nom de fichier
@item @code{%h}: commandes d@'efinies par des extensions
@item @code{%i}: commandes IRC (envoy@'ees)
@item @code{%I}: commandes IRC (re@,cues)
@item @code{%k}: touches
@item @code{%n}: pseudos du canal courant
@item @code{%o}: option de configuration
@item @code{%p}: message de ``part'' par d@'efaut
@item @code{%q}: message de ``quit'' par d@'efaut
@item @code{%s}: nom du serveur courant
@item @code{%S}: noms de tous les serveurs
@item @code{%t}: titre du canal courant
@item @code{%v}: valeur d'une option de configuration
@item @code{%w}: commandes WeeChat
@item @code{%y}: message d'absence (``away'') par d@'efaut
@end itemize
@item @option{handler_func}: fonction appel@'ee lorsque la commande est
ex@'ecut@'ee
@item @option{handler_args}: param@`etres pass@'es @`a la fonction
@@ -2303,6 +2339,7 @@ int weechat_plugin_init (t_weechat_plugin *plugin)
"Affiche deux fois un message",
"msg",
"msg: message a afficher deux fois",
NULL,
&toto_cmd_double,
NULL, NULL);
return PLUGIN_RC_OK;
@@ -2498,9 +2535,11 @@ transmis @`a d'autres extensions
@item
Perl: @command{weechat::add_command_handler ( nom, fonction,
[description, arguments, arguments_description] );}@*
[description, arguments, arguments_description,
completion_template] );}@*
Python: @command{weechat.add_command_handler ( nom, fonction,
[description, arguments, arguments_description] )}@*
[description, arguments, arguments_description,
completion_template] )}@*
@*
Cr@'e@'e une nouvelle commande WeeChat, associ@'ee @`a une fonction.@*
La fonction sera appel@'ee lorsque l'utilisateur lancera la commande
@@ -2520,6 +2559,33 @@ script sera charg@'e.
commande (affich@'ee par /help commande)
@item @option{arguments_description}: longue description des
param@`etres de la commande (affich@'ee par /help commande)
@item @option{completion_template}: mod@`ele pour la compl@'etion, sous
la forme @code{abc|%w def|%i} qui signifie ``abc'' ou une comande
WeeChat pour le premier param@`etre, et ``def'' ou une commande IRC
pour le deuxi@`eme.@*
Les codes suivants peuvent @^etre utilis@'es :
@itemize @minus
@item @code{%-}: aucune compl@'etion pour le param@`etre
@item @code{%a}: alias
@item @code{%A}: alias et commandes (WeeChat, IRC et extensions)
@item @code{%c}: canal courant
@item @code{%C}: canaux du serveur courant
@item @code{%f}: nom de fichier
@item @code{%h}: commandes d@'efinies par des extensions
@item @code{%i}: commandes IRC (envoy@'ees)
@item @code{%I}: commandes IRC (re@,cues)
@item @code{%k}: touches
@item @code{%n}: pseudos du canal courant
@item @code{%o}: option de configuration
@item @code{%p}: message de ``part'' par d@'efaut
@item @code{%q}: message de ``quit'' par d@'efaut
@item @code{%s}: nom du serveur courant
@item @code{%S}: noms de tous les serveurs
@item @code{%t}: titre du canal courant
@item @code{%v}: valeur d'une option de configuration
@item @code{%w}: commandes WeeChat
@item @code{%y}: message d'absence (``away'') par d@'efaut
@end itemize
@end itemize
@*
@emph{Valeur renvoy@'ee :}@*
+77 -13
View File
@@ -36,7 +36,7 @@
@title WeeChat - Guia do Utilizador
@subtitle Cliente de IRC rapido, leve e extencivel
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.7-cvs - 15 de dezembro de 2005
@subtitle Documenta@,{c}@~ao do WeeChat v0.1.7-cvs - 16 de dezembro de 2005
@author FlashCode <@email{flashcode@@flashtux.org, flashcode AT flashtux.org}>
@@ -1523,18 +1523,14 @@ call next command in global history@*
scroll one page up@*
@item page_down
scroll one page down@*
@item infobar_clear
clear infobar@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item nick_beginning
display beginning of nicklist@*
@item nick_end
display end of nicklist@*
@item refresh
refresh screen@*
@item nick_page_up
scroll nicklist one page up@*
@item nick_page_down
scroll nicklist one page down@*
@item jump_smart
jump to buffer with activity@*
@item jump_dcc
@@ -1545,8 +1541,20 @@ jump to last buffer@*
jump to server buffer@*
@item jump_next_server
jump to next server@*
@item switch_server
switch active server on servers buffer@*
@item scroll_previous_highlight
scroll to previous highlight in buffer@*
@item scroll_next_highlight
scroll to next highlight in buffer@*
@item scroll_unread
scroll to first unread line in buffer@*
@item hotlist_clear
clear hotlist@*
@item infobar_clear
clear infobar@*
@item refresh
refresh screen@*
@item grab_key
grab a key@*
@end table
@@ -1918,8 +1926,9 @@ WeeChat neither other plugins
@item
@command{t_plugin_handler *cmd_handler_add (t_weechat_plugin
*plugin, char *command, char *description, char *arguments,
char *arguments_description, t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)}@*
char *arguments_description, char *completion_template,
t_plugin_handler_func *handler_func, char *handler_args,
void *handler_pointer)}@*
@*
Add a WeeChat command handler, called when user uses command
(for example /command).@*
@@ -1934,6 +1943,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers name
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@item @option{handler_func}: function called when comand is executed
@item @option{handler_args}: arguments given to function when called
@item @option{handler_pointer}: pointer given to function when called
@@ -2266,6 +2301,7 @@ int weechat_plugin_init (t_weechat_plugin *plugin)
"Display two times a message",
"msg",
"msg: message",
NULL,
&toto_cmd_double,
NULL, NULL);
return PLUGIN_RC_OK;
@@ -2460,9 +2496,11 @@ WeeChat neither other plugins
@item
Perl: @command{weechat::add_command_handler ( name, function,
[description, arguments, arguments_description] );}@*
[description, arguments, arguments_description,
completion_template] );}@*
Python: @command{weechat.add_command_handler ( name, function,
[description, arguments, arguments_description] )}@*
[description, arguments, arguments_description,
completion_template] )}@*
@*
Create new WeeChat command, linked with script function.@*
Function will be called when user will launch command with @kbd{/name}.@*
@@ -2480,6 +2518,32 @@ command)
(displayed by /help command)
@item @option{arguments_description}: long description of command
arguments (displayed by /help command)
@item @option{completion_template}: template for completion, like
@code{abc|%w def|%i} which means ``abc'' or a WeeChat command
for first argument, and ``def'' or IRC command for second.@*
Following codes can be used:
@itemize @minus
@item @code{%-}: no completion for argument
@item @code{%a}: alias
@item @code{%A}: alias and commands (WeeChat, IRC and plugins)
@item @code{%c}: current channel
@item @code{%C}: channels of current server
@item @code{%f}: filename
@item @code{%h}: plugins commands
@item @code{%i}: IRC commands (sent)
@item @code{%I}: IRC commands (received)
@item @code{%k}: keys
@item @code{%n}: nicks of current channel
@item @code{%o}: setup option
@item @code{%p}: default ``part'' message
@item @code{%q}: default ``quit'' message
@item @code{%s}: current server name
@item @code{%S}: all servers names
@item @code{%t}: topic of current channel
@item @code{%v}: setup option value
@item @code{%w}: WeeChat commands
@item @code{%y}: default ``away'' message
@end itemize
@end itemize
@*
@emph{Return value:}@*
+444 -441
View File
File diff suppressed because it is too large Load Diff
+446 -445
View File
File diff suppressed because it is too large Load Diff
+452 -447
View File
File diff suppressed because it is too large Load Diff
+441 -441
View File
File diff suppressed because it is too large Load Diff
+25 -23
View File
@@ -46,7 +46,7 @@ t_weechat_command weechat_commands[] =
N_("[alias_name [command [arguments]]"),
N_("alias_name: name of alias\ncommand: command name (WeeChat "
"or IRC command, without first '/')\n" "arguments: arguments for command"),
0, MAX_ARGS, NULL, weechat_cmd_alias },
"%- %A", 0, MAX_ARGS, NULL, weechat_cmd_alias },
{ "buffer", N_("manage buffers"),
N_("[action | number | [[server] [channel]]]"),
N_("action: action to do:\n"
@@ -56,39 +56,40 @@ t_weechat_command weechat_commands[] =
" notify: set notify level for buffer (0=never, 1=highlight, 2=1+msg, 3=2+join/part)\n"
"server,channel: jump to buffer by server and/or channel name\n"
"number: jump to buffer by number"),
0, MAX_ARGS, weechat_cmd_buffer, NULL },
"move|close|list|notify", 0, MAX_ARGS, weechat_cmd_buffer, NULL },
{ "charset", N_("change charset for server or channel"),
N_("[(decode_iso | decode_utf | encode) charset]"),
N_("decode_iso: charset used for decoding ISO\n"
"decode_utf: charset used for decoding UTF\n"
" encode: charset used for encoding messages\n"
" charset: charset to use (for example: ISO-8859-15, UTF-8,..)"),
0, 2, weechat_cmd_charset, NULL },
"decode_iso|decode_utf|encode", 0, 2, weechat_cmd_charset, NULL },
{ "clear", N_("clear window(s)"),
N_("[-all]"),
N_("-all: clear all windows"),
0, 1, weechat_cmd_clear, NULL },
"-all", 0, 1, weechat_cmd_clear, NULL },
{ "connect", N_("connect to a server"),
N_("[servername]"),
N_("servername: server name to connect"),
0, 1, weechat_cmd_connect, NULL },
"%S", 0, 1, weechat_cmd_connect, NULL },
{ "disconnect", N_("disconnect from a server"),
N_("[servername]"),
N_("servername: server name to disconnect"),
0, 1, weechat_cmd_disconnect, NULL },
"%S", 0, 1, weechat_cmd_disconnect, NULL },
{ "debug", N_("print debug messages"),
N_("dump | windows"),
N_("dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)\n"
"windows: display windows tree"),
1, 1, weechat_cmd_debug, NULL },
"dump|windows", 1, 1, weechat_cmd_debug, NULL },
{ "help", N_("display help about commands"),
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
0, 1, weechat_cmd_help, NULL },
N_("[command]"),
N_("command: name of a WeeChat or IRC command"),
"%w|%i|%h", 0, 1, weechat_cmd_help, NULL },
{ "history", N_("show buffer command history"),
N_("[clear | value]"),
N_("clear: clear history\n"
"value: number of history entries to show"),
0, 1, weechat_cmd_history, NULL },
"clear", 0, 1, weechat_cmd_history, NULL },
{ "ignore", N_("ignore IRC messages and/or hosts"),
N_("[mask [[type | command] [channel [server]]]]"),
N_(" mask: nick or host mask to ignore\n"
@@ -98,19 +99,20 @@ t_weechat_command weechat_commands[] =
" server: name of server for ignore\n\n"
"For each argument, '*' means all.\n"
"Without argument, /ignore command lists all defined ignore."),
"*|%n *|action|ctcp|dcc|pv|%I *|%c *|%s",
0, 4, weechat_cmd_ignore, NULL },
{ "key", N_("bind/unbind keys"),
N_("[key function/command] [unbind key] [functions] [reset -yes]"),
N_("key: bind this key to an internal function or a command (beginning by \"/\")\n"
"unbind: unbind a key (if \"all\", default bindings are restored)\n"
"unbind: unbind a key\n"
"functions: list internal functions for key bindings\n"
"reset: restore bindings to the default values and delete ALL personal binding (use carefully!)"),
0, MAX_ARGS, NULL, weechat_cmd_key },
"unbind|functions|reset %k", 0, MAX_ARGS, NULL, weechat_cmd_key },
{ "plugin", N_("list/load/unload plugins"),
N_("[load filename] | [autoload] | [reload] | [unload]"),
N_("filename: WeeChat plugin (file) to load\n\n"
"Without argument, /plugin command lists all loaded plugins."),
0, 2, weechat_cmd_plugin, NULL },
"load|autoload|reload|unload", 0, 2, weechat_cmd_plugin, NULL },
{ "server", N_("list, add or remove servers"),
N_("[servername] | "
"[servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-pwd password] [-nicks nick1 "
@@ -128,19 +130,19 @@ t_weechat_command weechat_commands[] =
"nick3: second alternate nick for server\n"
"username: user name\n"
"realname: real name of user"),
0, MAX_ARGS, weechat_cmd_server, NULL },
NULL, 0, MAX_ARGS, weechat_cmd_server, NULL },
{ "save", N_("save config to disk"),
N_("[file]"), N_("file: filename for writing config"),
0, 1, weechat_cmd_save, NULL },
NULL, 0, 1, weechat_cmd_save, NULL },
{ "set", N_("set config parameters"),
N_("[option [ = value]]"),
N_("option: name of an option (if name is full "
"and no value is given, then help is displayed on option)\n"
"value: value for option"),
0, MAX_ARGS, NULL, weechat_cmd_set },
"%o = %v", 0, MAX_ARGS, NULL, weechat_cmd_set },
{ "unalias", N_("remove an alias"),
N_("alias_name"), N_("alias_name: name of alias to remove"),
1, 1, NULL, weechat_cmd_unalias },
"%a", 1, 1, NULL, weechat_cmd_unalias },
{ "unignore", N_("unignore IRC messages and/or hosts"),
N_("[number | [mask [[type | command] [channel [server]]]]]"),
N_(" number: # of ignore to unignore (number is displayed by list of ignore)\n"
@@ -151,15 +153,14 @@ t_weechat_command weechat_commands[] =
" server: name of server for unignore\n\n"
"For each argument, '*' means all.\n"
"Without argument, /unignore command lists all defined ignore."),
"*|%n *|action|ctcp|dcc|pv|%I *|%c *|%s",
0, 4, weechat_cmd_unignore, NULL },
{ "upgrade", N_("upgrade WeeChat without disconnecting from servers"),
"",
"",
0, 0, weechat_cmd_upgrade, NULL },
{ "upgrade", N_("upgrade WeeChat without disconnecting from servers"), "", "",
NULL, 0, 0, weechat_cmd_upgrade, NULL },
{ "uptime", N_("show WeeChat uptime"),
N_("[-o]"),
N_("-o: send uptime on current channel as an IRC message"),
0, 1, weechat_cmd_uptime, NULL },
"-o", 0, 1, weechat_cmd_uptime, NULL },
{ "window", N_("manage windows"),
N_("[list | -1 | +1 | b# | up | down | left | right | splith [pct] "
"| splitv [pct] | resize pct | merge [all]]"),
@@ -178,8 +179,9 @@ t_weechat_command weechat_commands[] =
"For splith and splitv, pct is a pourcentage which represents "
"size of new window, computed with current window as size reference. "
"For example 25 means create a new window with size = current_size / 4"),
"list|-1|+1|up|down|left|right|splith|splitv|resize|merge all",
0, 2, weechat_cmd_window, NULL },
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
{ NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
};
t_weechat_alias *weechat_alias = NULL;
+9 -5
View File
@@ -31,13 +31,17 @@ typedef struct t_weechat_command t_weechat_command;
struct t_weechat_command
{
char *command_name;
char *command_description;
char *arguments;
char *arguments_description;
int min_arg, max_arg;
char *command_name; /* WeeChat (internal) command name */
char *command_description; /* command description (for /help) */
char *arguments; /* command arguments (for /help) */
char *arguments_description; /* arguments description (for /help) */
char *completion_template; /* template for completion */
/* NULL=no completion, ""=default (nick) */
int min_arg, max_arg; /* min & max number of arguments */
int (*cmd_function_args)(t_gui_window *, int, char **);
/* function called when user enters cmd */
int (*cmd_function_1arg)(t_gui_window *, char *);
/* function called when user enters cmd */
};
typedef struct t_weechat_alias t_weechat_alias;
File diff suppressed because it is too large Load Diff
+17 -15
View File
@@ -33,27 +33,29 @@ typedef struct t_completion t_completion;
struct t_completion
{
/* completion context */
int context; /* context: null, nick, command, cmd arg */
char *base_command; /* command with arg to complete (can be NULL) */
int base_command_arg; /* # arg to complete (if context is cmd arg) */
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
void *server; /* server pointer */
void *channel; /* channel pointer */
int context; /* context: null, nick, command, cmd arg */
char *base_command; /* command with arg to complete (can be NULL) */
int base_command_arg; /* # arg to complete (if context is cmd arg) */
char *base_word; /* word to complete (when Tab was pressed) */
int base_word_pos; /* beggining of base word */
int position; /* position where Tab was pressed */
char *args; /* command line args (including base word) */
/* for command argument completion */
t_weelist *completion_list; /* data list for completion */
t_weelist *last_completion; /* last data element for completion */
t_weelist *completion_list; /* data list for completion */
t_weelist *last_completion; /* last data element for completion */
/* completion found */
char *word_found; /* word found (to replace base word) */
int position_replace; /* position where word has to be replaced */
int diff_size; /* size difference (< 0 = char(s) deleted) */
int diff_length; /* length difference (<= diff_size) */
char *word_found; /* word found (to replace base word) */
int position_replace; /* position where word has to be replaced */
int diff_size; /* size difference (< 0 = char(s) deleted) */
int diff_length; /* length difference (<= diff_size) */
};
extern void completion_init (t_completion *);
extern void completion_init (t_completion *, void *, void *);
extern void completion_free (t_completion *);
extern void completion_search (t_completion *, void *, void *, char *, int, int);
extern void completion_search (t_completion *, char *, int, int);
#endif /* completion.h */
-2
View File
@@ -126,8 +126,6 @@ gui_action_tab (t_gui_window *window)
if (window->buffer->has_input)
{
completion_search (&(window->buffer->completion),
SERVER(window->buffer),
CHANNEL(window->buffer),
window->buffer->input_buffer,
window->buffer->input_buffer_size,
utf8_real_pos (window->buffer->input_buffer,
+1 -1
View File
@@ -474,7 +474,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int dcc,
new_buffer->input_buffer_1st_display = 0;
/* init completion */
completion_init (&(new_buffer->completion));
completion_init (&(new_buffer->completion), server, channel);
/* init history */
new_buffer->history = NULL;
+368 -289
View File
@@ -34,462 +34,541 @@ t_irc_command irc_commands[] =
{ { "admin", N_("find information about the administrator of the server"),
N_("[target]"),
N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_admin, NULL },
NULL, 0, 1, 1, NULL, irc_cmd_send_admin, NULL },
{ "ame", N_("send a CTCP action to all channels of all connected servers"),
N_("message"),
N_("message: message to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_ame, NULL },
{ "amsg", N_("send message to all channels of all connected servers"),
N_("text"),
N_("text: text to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_amsg, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_amsg, NULL },
{ "away", N_("toggle away status"),
N_("[-all] [message]"),
N_("-all: toggle away status on all connected servers\n"
"message: message for away (if no message is given, away status is removed)"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
"message: message for away (if no message is given, away status is removed)"),
"%y", 0, MAX_ARGS, 1, NULL, irc_cmd_send_away, NULL },
{ "ban", N_("bans nicks or hosts"),
N_("[channel] [nickname [nickname ...]]"),
N_("channel: channel for ban\n"
"nickname: user or host to ban"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
"", 0, MAX_ARGS, 1, NULL, irc_cmd_send_ban, NULL },
{ "ctcp", N_("send a CTCP message (Client-To-Client Protocol)"),
N_("nickname type [arguments]"),
N_("nickname: user to send CTCP to\n"
"type: CTCP type (examples: \"version\", \"ping\", ..)\n"
"arguments: arguments for CTCP"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
"%n action|ping|version", 2, MAX_ARGS, 1, NULL, irc_cmd_send_ctcp, NULL },
{ "dcc", N_("starts DCC (file or chat) or close chat"),
N_("action [nickname [file]]"),
N_("action: 'send' (file) or 'chat' or 'close' (chat)\n"
"nickname: nickname to send file or chat\n"
"file: filename (on local host)"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
"nickname: nickname to send file or chat\n"
"file: filename (on local host)"),
"chat|send|close %n %f", 1, MAX_ARGS, 1, NULL, irc_cmd_send_dcc, NULL },
{ "dehalfop", N_("removes half channel operator status from nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
"", 0, MAX_ARGS, 1, irc_cmd_send_dehalfop, NULL, NULL },
{ "deop", N_("removes channel operator status from nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
"", 0, MAX_ARGS, 1, irc_cmd_send_deop, NULL, NULL },
{ "devoice", N_("removes voice from nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
{ "die", N_("shutdown the server"),
"", "",
0, 0, 1, NULL, irc_cmd_send_die, NULL },
{ "error", N_("error received from IRC server"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
"", 0, MAX_ARGS, 1, irc_cmd_send_devoice, NULL, NULL },
{ "die", N_("shutdown the server"), "", "",
NULL, 0, 0, 1, NULL, irc_cmd_send_die, NULL },
{ "error", N_("error received from IRC server"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_error },
{ "halfop", N_("gives half channel operator status to nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
"", 0, MAX_ARGS, 1, irc_cmd_send_halfop, NULL, NULL },
{ "info", N_("get information describing the server"),
N_("[target]"),
N_("target: server name"),
0, 1, 1, NULL, irc_cmd_send_info, NULL },
NULL, 0, 1, 1, NULL, irc_cmd_send_info, NULL },
{ "invite", N_("invite a nick on a channel"),
N_("nickname channel"),
N_("nickname: nick to invite\n"
"channel: channel to invite"),
1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
"%n %c", 1, 2, 1, irc_cmd_send_invite, NULL, irc_cmd_recv_invite },
{ "ison", N_("check if a nickname is currently on IRC"),
N_("nickname [nickname ...]"),
N_("nickname: nickname"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_ison, NULL },
{ "join", N_("join a channel"),
N_("channel[,channel] [key[,key]]"),
N_("channel: channel name to join\n"
"key: key to join the channel"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_join, irc_cmd_recv_join },
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_join, irc_cmd_recv_join },
{ "kick", N_("forcibly remove a user from a channel"),
N_("[channel] nickname [comment]"),
N_("channel: channel where user is\n"
"nickname: nickname to kick\n"
"comment: comment for kick"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_kick, irc_cmd_recv_kick },
{ "kickban", N_("kicks and bans a nick from a channel"),
N_("[channel] nickname [comment]"),
N_("channel: channel where user is\n"
"nickname: nickname to kick and ban\n"
"comment: comment for kick"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_kickban, NULL },
{ "kill", N_("close client-server connection"),
N_("nickname comment"),
N_("nickname: nickname\n"
"comment: comment for kill"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
"%n %-", 2, MAX_ARGS, 1, NULL, irc_cmd_send_kill, irc_cmd_recv_kill },
{ "links", N_("list all servernames which are known by the server answering the query"),
N_("[[server] server_mask]"),
N_("server: this server should answer the query\n"
"server_mask: list of servers must match this mask"),
0, 2, 1, NULL, irc_cmd_send_links, NULL },
"server_mask: list of servers must match this mask"),
NULL, 0, 2, 1, NULL, irc_cmd_send_links, NULL },
{ "list", N_("list channels and their topic"),
N_("[channel[,channel] [server]]"),
N_("channel: channel to list\nserver: server name"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_list, NULL },
NULL, 0, MAX_ARGS, 1, NULL, irc_cmd_send_list, NULL },
{ "lusers", N_("get statistics about the size of the IRC network"),
N_("[mask [target]]"),
N_("mask: servers matching the mask only\n"
"target: server for forwarding request"),
0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
"target: server for forwarding request"),
NULL, 0, 2, 1, NULL, irc_cmd_send_lusers, NULL },
{ "me", N_("send a CTCP action to the current channel"),
N_("message"),
N_("message: message to send"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
"", 0, MAX_ARGS, 1, NULL, irc_cmd_send_me, NULL },
{ "mode", N_("change channel or user mode"),
N_("{ channel {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask] } | "
"{ nickname {[+|-]|i|w|s|o} }"),
"{ nickname {[+|-]|i|w|s|o} }"),
N_("channel modes:\n"
" channel: channel name to modify\n"
" o: give/take channel operator privileges\n"
" p: private channel flag\n"
" s: secret channel flag\n"
" i: invite-only channel flag\n"
" t: topic settable by channel operator only flag\n"
" n: no messages to channel from clients on the outside\n"
" m: moderated channel\n"
" l: set the user limit to channel\n"
" b: set a ban mask to keep users out\n"
" e: set exception mask\n"
" v: give/take the ability to speak on a moderated channel\n"
" k: set a channel key (password)\n"
"user modes:\n"
" nickname: nickname to modify\n"
" i: mark a user as invisible\n"
" s: mark a user for receive server notices\n"
" w: user receives wallops\n"
" o: operator flag"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
" channel: channel name to modify\n"
" o: give/take channel operator privileges\n"
" p: private channel flag\n"
" s: secret channel flag\n"
" i: invite-only channel flag\n"
" t: topic settable by channel operator only flag\n"
" n: no messages to channel from clients on the outside\n"
" m: moderated channel\n"
" l: set the user limit to channel\n"
" b: set a ban mask to keep users out\n"
" e: set exception mask\n"
" v: give/take the ability to speak on a moderated channel\n"
" k: set a channel key (password)\n"
"user modes:\n"
" nickname: nickname to modify\n"
" i: mark a user as invisible\n"
" s: mark a user for receive server notices\n"
" w: user receives wallops\n"
" o: operator flag"),
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_mode, irc_cmd_recv_mode },
{ "motd", N_("get the \"Message Of The Day\""),
N_("[target]"),
N_("target: server name"),
0, 1, 1, NULL, irc_cmd_send_motd, NULL },
NULL, 0, 1, 1, NULL, irc_cmd_send_motd, NULL },
{ "msg", N_("send message to a nick or channel"),
N_("receiver[,receiver] text"),
N_("receiver: nick or channel (may be mask, '*' = current channel)\n"
"text: text to send"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
"text: text to send"),
"", 2, MAX_ARGS, 1, NULL, irc_cmd_send_msg, NULL },
{ "names", N_("list nicknames on channels"),
N_("[channel[,channel]]"), N_("channel: channel name"),
0, 1, 1, NULL, irc_cmd_send_names, NULL },
N_("[channel[,channel]]"),
N_("channel: channel name"),
NULL, 0, 1, 1, NULL, irc_cmd_send_names, NULL },
{ "nick", N_("change current nickname"),
N_("[-all] nickname"),
N_("-all: set new nickname for all connected servers\n"
"nickname: new nickname"),
1, 2, 0, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
"nickname: new nickname"),
NULL, 1, 2, 0, irc_cmd_send_nick, NULL, irc_cmd_recv_nick },
{ "notice", N_("send notice message to user"),
N_("nickname text"), N_("nickname: user to send notice to\ntext: text to send"),
2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
N_("nickname text"),
N_("nickname: user to send notice to\ntext: text to send"),
"%n %-", 2, MAX_ARGS, 1, NULL, irc_cmd_send_notice, irc_cmd_recv_notice },
{ "op", N_("gives channel operator status to nickname(s)"),
N_("nickname [nickname]"), "",
1, MAX_ARGS, 1, irc_cmd_send_op, NULL, NULL },
"", 1, MAX_ARGS, 1, irc_cmd_send_op, NULL, NULL },
{ "oper", N_("get operator privileges"),
N_("user password"),
N_("user/password: used to get privileges on current IRC server"),
2, 2, 1, NULL, irc_cmd_send_oper, NULL },
NULL, 2, 2, 1, NULL, irc_cmd_send_oper, NULL },
{ "part", N_("leave a channel"),
N_("[channel[,channel]] [part_message]"),
N_("channel: channel name to leave\n"
"part_message: part message (displayed to other users)"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
"%p", 0, MAX_ARGS, 1, NULL, irc_cmd_send_part, irc_cmd_recv_part },
{ "ping", N_("ping server"),
N_("server1 [server2]"),
N_("server1: server to ping\nserver2: forward ping to this server"),
1, 2, 1, NULL, irc_cmd_send_ping, irc_cmd_recv_ping },
NULL, 1, 2, 1, NULL, irc_cmd_send_ping, irc_cmd_recv_ping },
{ "pong", N_("answer to a ping message"),
N_("daemon [daemon2]"),
N_("daemon: daemon who has responded to Ping message\n"
"daemon2: forward message to this daemon"),
1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
{ "privmsg", N_("message received"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
NULL, 1, 2, 1, NULL, irc_cmd_send_pong, irc_cmd_recv_pong },
{ "privmsg", N_("message received"), "", "",
"", 0, 0, 1, NULL, NULL, irc_cmd_recv_privmsg },
{ "query", N_("send a private message to a nick"),
N_("nickname [text]"),
N_("nickname: nickname for private conversation\n"
"text: text to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
"text: text to send"),
"%n %-", 1, MAX_ARGS, 1, NULL, irc_cmd_send_query, NULL },
{ "quit", N_("close all connections & quit"),
N_("[quit_message]"),
N_("quit_message: quit message (displayed to other users)"),
0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },
"%q", 0, MAX_ARGS, 0, NULL, irc_cmd_send_quit, irc_cmd_recv_quit },
{ "quote", N_("send raw data to server without parsing"),
N_("data"),
N_("data: raw data to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_quote, NULL },
{ "rehash", N_("tell the server to reload its config file"),
"", "",
0, 0, 1, NULL, irc_cmd_send_rehash, NULL },
{ "restart", N_("tell the server to restart itself"),
"", "",
0, 0, 1, NULL, irc_cmd_send_restart, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_quote, NULL },
{ "rehash", N_("tell the server to reload its config file"), "", "",
NULL, 0, 0, 1, NULL, irc_cmd_send_rehash, NULL },
{ "restart", N_("tell the server to restart itself"), "", "",
NULL, 0, 0, 1, NULL, irc_cmd_send_restart, NULL },
{ "service", N_("register a new service"),
N_("nickname reserved distribution type reserved info"),
N_("distribution: visibility of service\n"
"type: reserved for future usage"),
6, 6, 1, NULL, irc_cmd_send_service, NULL },
"type: reserved for future usage"),
NULL, 6, 6, 1, NULL, irc_cmd_send_service, NULL },
{ "servlist", N_("list services currently connected to the network"),
N_("[mask [type]]"),
N_("mask: list only services matching this mask\n"
"type: list only services of this type"),
0, 2, 1, NULL, irc_cmd_send_servlist, NULL },
NULL, 0, 2, 1, NULL, irc_cmd_send_servlist, NULL },
{ "squery", N_("deliver a message to a service"),
N_("service text"),
N_("service: name of service\ntext: text to send"),
2, 2, 1, NULL, irc_cmd_send_squery, NULL },
NULL, 2, 2, 1, NULL, irc_cmd_send_squery, NULL },
{ "squit", N_("disconnect server links"),
N_("server comment"),
N_("server: server name\ncomment: comment for quit"),
2, 2, 1, NULL, irc_cmd_send_squit, NULL },
NULL, 2, 2, 1, NULL, irc_cmd_send_squit, NULL },
{ "stats", N_("query statistics about server"),
N_("[query [server]]"),
N_("query: c/h/i/k/l/m/o/y/u (see RFC1459)\nserver: server name"),
0, 2, 1, NULL, irc_cmd_send_stats, NULL },
N_("query: c/h/i/k/l/m/o/y/u (see RFC1459)\n"
"server: server name"),
NULL, 0, 2, 1, NULL, irc_cmd_send_stats, NULL },
{ "summon", N_("give users who are on a host running an IRC server a message "
"asking them to please join IRC"),
N_("user [target [channel]]"),
N_("user: username\ntarget: server name\n"
"channel: channel name"),
1, 3, 1, NULL, irc_cmd_send_summon, NULL },
NULL, 1, 3, 1, NULL, irc_cmd_send_summon, NULL },
{ "time", N_("query local time from server"),
N_("[target]"), N_("target: query time from specified server"),
0, 1, 1, NULL, irc_cmd_send_time, NULL },
N_("[target]"),
N_("target: query time from specified server"),
NULL, 0, 1, 1, NULL, irc_cmd_send_time, NULL },
{ "topic", N_("get/set channel topic"),
N_("[channel] [topic]"),
N_("channel: channel name\ntopic: new topic for channel "
"(if topic is \"-delete\" then topic is deleted)"),
0, MAX_ARGS, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
"%t", 0, MAX_ARGS, 1, NULL, irc_cmd_send_topic, irc_cmd_recv_topic },
{ "trace", N_("find the route to specific server"),
N_("[target]"), N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_trace, NULL },
N_("[target]"),
N_("target: server"),
NULL, 0, 1, 1, NULL, irc_cmd_send_trace, NULL },
{ "unban", N_("unbans nicks or hosts"),
N_("[channel] nickname [nickname ...]"),
N_("channel: channel for unban\n"
"nickname: user or host to unban"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
"%n", 1, MAX_ARGS, 1, NULL, irc_cmd_send_unban, NULL },
{ "userhost", N_("return a list of information about nicknames"),
N_("nickname [nickname ...]"), N_("nickname: nickname"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
N_("nickname [nickname ...]"),
N_("nickname: nickname"),
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_userhost, NULL },
{ "users", N_("list of users logged into the server"),
N_("[target]"), N_("target: server"),
0, 1, 1, NULL, irc_cmd_send_users, NULL },
N_("[target]"),
N_("target: server"),
NULL, 0, 1, 1, NULL, irc_cmd_send_users, NULL },
{ "version", N_("gives the version info of nick or server (current or specified)"),
N_("[server | nickname]"),
N_("server: server name\n"
"nickname: nickname"),
0, 1, 1, NULL, irc_cmd_send_version, NULL },
NULL, 0, 1, 1, NULL, irc_cmd_send_version, NULL },
{ "voice", N_("gives voice to nickname(s)"),
N_("[nickname [nickname]]"), "",
0, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
"", 0, MAX_ARGS, 1, irc_cmd_send_voice, NULL, NULL },
{ "wallops", N_("send a message to all currently connected users who have "
"set the 'w' user mode for themselves"),
N_("text"), N_("text to send"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
N_("text"),
N_("text to send"),
NULL, 1, MAX_ARGS, 1, NULL, irc_cmd_send_wallops, NULL },
{ "who", N_("generate a query which returns a list of information"),
N_("[mask [\"o\"]]"),
N_("mask: only information which match this mask\n"
"o: only operators are returned according to the mask supplied"),
0, 2, 1, NULL, irc_cmd_send_who, NULL },
"%C", 0, 2, 1, NULL, irc_cmd_send_who, NULL },
{ "whois", N_("query information about user(s)"),
N_("[server] nickname[,nickname]"),
N_("server: server name\n"
"nickname: nickname (may be a mask)"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_whois, NULL },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_whois, NULL },
{ "whowas", N_("ask for information about a nickname which no longer exists"),
N_("nickname [,nickname [,nickname ...]] [count [target]]"),
N_("nickname: nickname to search\n"
"count: number of replies to return (full search if negative number)\n"
"target: reply should match this mask"),
1, MAX_ARGS, 1, NULL, irc_cmd_send_whowas, NULL },
{ "001", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "002", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "003", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "004", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
{ "005", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "008", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "020", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "042", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "212", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "219", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "221", N_("user mode string"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
{ "250", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "251", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "252", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "253", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "254", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "255", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "256", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "257", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "258", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "259", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "260", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "261", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "262", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "263", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "264", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "265", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "266", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "267", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "268", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "269", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "301", N_("away message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
{ "302", N_("userhost"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
{ "303", N_("ison"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
{ "305", N_("unaway"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
{ "306", N_("now away"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
{ "311", N_("whois (user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
{ "314", N_("whowas"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
{ "315", N_("end of /who list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
{ "317", N_("whois (idle)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
{ "318", N_("whois (end)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
{ "319", N_("whois (channels)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
{ "320", N_("whois (identified user)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
{ "321", N_("/list start"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
{ "322", N_("channel (for /list)"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
{ "323", N_("/list end"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
{ "324", N_("channel mode"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
{ "329", "???", "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
{ "331", N_("no topic for channel"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
"", 1, MAX_ARGS, 1, NULL, irc_cmd_send_whowas, NULL },
{ "001", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "002", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "003", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "004", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_004 },
{ "005", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "008", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "020", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "042", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "212", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "219", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "221", N_("user mode string"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_221 },
{ "250", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "251", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "252", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "253", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "254", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "255", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "256", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "257", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "258", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "259", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "260", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "261", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "262", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "263", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "264", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "265", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "266", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "267", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "268", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "269", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "301", N_("away message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_301 },
{ "302", N_("userhost"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_302 },
{ "303", N_("ison"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_303 },
{ "305", N_("unaway"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_305 },
{ "306", N_("now away"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_306 },
{ "307", N_("whois (registered nick)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_307 },
{ "311", N_("whois (user)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_311 },
{ "312", N_("whois (server)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_312 },
{ "313", N_("whois (operator)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_313 },
{ "314", N_("whowas"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_314 },
{ "315", N_("end of /who list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_315 },
{ "317", N_("whois (idle)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_317 },
{ "318", N_("whois (end)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_318 },
{ "319", N_("whois (channels)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_319 },
{ "320", N_("whois (identified user)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_320 },
{ "321", N_("/list start"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_321 },
{ "322", N_("channel (for /list)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_322 },
{ "323", N_("/list end"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_323 },
{ "324", N_("channel mode"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_324 },
{ "329", "???", "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_329 },
{ "331", N_("no topic for channel"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_331 },
{ "332", N_("topic of channel"),
N_("channel :topic"),
N_("channel: name of channel\n"
"topic: topic of the channel"),
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
{ "333", N_("infos about topic (nick & date changed)"),
"", "",
0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "344", N_("channel reop"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
{ "345", N_("end of channel reop list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
{ "348", N_("channel exception list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_348 },
{ "349", N_("end of channel exception list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_349 },
{ "351", N_("server version"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
NULL, 2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_332 },
{ "333", N_("infos about topic (nick & date changed)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_333 },
{ "341", N_("inviting"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_341 },
{ "344", N_("channel reop"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_344 },
{ "345", N_("end of channel reop list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_345 },
{ "348", N_("channel exception list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_348 },
{ "349", N_("end of channel exception list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_349 },
{ "351", N_("server version"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_351 },
{ "352", N_("who"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_352 },
{ "353", N_("list of nicks on channel"),
N_("channel :[[@|+]nick ...]"),
N_("channel: name of channel\n"
"nick: nick on the channel"),
2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
{ "364", N_("links"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "365", N_("end of /links list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "366", N_("end of /names list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
{ "367", N_("banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
{ "368", N_("end of banlist"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
{ "369", N_("end of /whowas list"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "371", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "372", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "373", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "374", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "375", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "376", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "381", N_("you are now an IRC operator"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "382", N_("rehashing"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "391", N_("server local time"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "401", N_("no such nick/channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "402", N_("no such server"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "403", N_("no such channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "404", N_("cannot send to channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "405", N_("too many channels"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "406", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "407", N_("was no such nick"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "409", N_("no origin"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "410", N_("no services"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "411", N_("no recipient"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "412", N_("no text to send"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "413", N_("no toplevel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "414", N_("wilcard in toplevel domain"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "421", N_("unknown command"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "422", N_("MOTD is missing"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "423", N_("no administrative info"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "424", N_("file error"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "431", N_("no nickname given"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "432", N_("erroneous nickname"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "433", N_("nickname already in use"),
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_433 },
{ "436", N_("nickname collision"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "438", N_("not authorized to change nickname"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_438 },
{ "441", N_("user not in channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "442", N_("not on channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "443", N_("user already on channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "444", N_("user not logged in"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "445", N_("summon has been disabled"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "446", N_("users has been disabled"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "451", N_("you are not registered"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "461", N_("not enough parameters"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "462", N_("you may not register"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "463", N_("your host isn't among the privileged"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "464", N_("password incorrect"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "465", N_("you are banned from this server"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "467", N_("channel key already set"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "470", N_("forwarding to another channel"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "471", N_("channel is already full"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "472", N_("unknown mode char to me"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "473", N_("cannot join channel (invite only)"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "474", N_("cannot join channel (banned from channel)"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "475", N_("cannot join channel (bad channel key)"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "476", N_("bad channel mask"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "477", N_("channel doesn't support modes"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "481", N_("you're not an IRC operator"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "482", N_("you're not channel operator"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "484", N_("your connection is restricted!"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "501", N_("unknown mode flag"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "502", N_("can't change mode for other users"),
"", "", 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "505", N_("a server message"), "", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "671", N_("whois (secure connection)"),
"", "", 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
NULL, 2, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_353 },
{ "364", N_("links"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "365", N_("end of /links list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "366", N_("end of /names list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_366 },
{ "367", N_("banlist"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_367 },
{ "368", N_("end of banlist"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_368 },
{ "369", N_("end of /whowas list"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "371", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "372", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "373", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "374", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "375", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "376", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "381", N_("you are now an IRC operator"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "382", N_("rehashing"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "391", N_("server local time"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "401", N_("no such nick/channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "402", N_("no such server"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "403", N_("no such channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "404", N_("cannot send to channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "405", N_("too many channels"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "406", N_("was no such nick"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "407", N_("was no such nick"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "409", N_("no origin"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "410", N_("no services"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "411", N_("no recipient"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "412", N_("no text to send"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "413", N_("no toplevel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "414", N_("wilcard in toplevel domain"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "421", N_("unknown command"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "422", N_("MOTD is missing"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "423", N_("no administrative info"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "424", N_("file error"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "431", N_("no nickname given"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "432", N_("erroneous nickname"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "433", N_("nickname already in use"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_433 },
{ "436", N_("nickname collision"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "438", N_("not authorized to change nickname"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_438 },
{ "441", N_("user not in channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "442", N_("not on channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "443", N_("user already on channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "444", N_("user not logged in"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "445", N_("summon has been disabled"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "446", N_("users has been disabled"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "451", N_("you are not registered"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "461", N_("not enough parameters"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "462", N_("you may not register"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "463", N_("your host isn't among the privileged"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "464", N_("password incorrect"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "465", N_("you are banned from this server"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "467", N_("channel key already set"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "470", N_("forwarding to another channel"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "471", N_("channel is already full"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "472", N_("unknown mode char to me"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "473", N_("cannot join channel (invite only)"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "474", N_("cannot join channel (banned from channel)"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "475", N_("cannot join channel (bad channel key)"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "476", N_("bad channel mask"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "477", N_("channel doesn't support modes"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "481", N_("you're not an IRC operator"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "482", N_("you're not channel operator"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "483", N_("you can't kill a server!"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "484", N_("your connection is restricted!"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "485", N_("user is immune from kick/deop"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "491", N_("no O-lines for your host"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "501", N_("unknown mode flag"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "502", N_("can't change mode for other users"), "", "",
NULL, 0, MAX_ARGS, 1, NULL, NULL, irc_cmd_recv_error },
{ "505", N_("a server message"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_server_msg },
{ "671", N_("whois (secure connection)"), "", "",
NULL, 0, 0, 1, NULL, NULL, irc_cmd_recv_671 },
{ NULL, NULL, NULL, NULL, NULL, 0, 0, 1, NULL, NULL, NULL }
};
+123 -121
View File
@@ -66,12 +66,12 @@ typedef struct t_irc_nick t_irc_nick;
struct t_irc_nick
{
char *nick; /* nickname */
int flags; /* chanowner/chanadmin (unrealircd), */
/* op, halfop, voice, away */
int color; /* color for nickname in chat window */
t_irc_nick *prev_nick; /* link to previous nick on the channel */
t_irc_nick *next_nick; /* link to next nick on the channel */
char *nick; /* nickname */
int flags; /* chanowner/chanadmin (unrealircd), */
/* op, halfop, voice, away */
int color; /* color for nickname in chat window */
t_irc_nick *prev_nick; /* link to previous nick on the channel */
t_irc_nick *next_nick; /* link to next nick on the channel */
};
/* channel types */
@@ -100,20 +100,20 @@ typedef struct t_irc_channel t_irc_channel;
struct t_irc_channel
{
int type; /* channel type */
void *dcc_chat; /* DCC CHAT pointer (NULL if not DCC) */
char *name; /* name of channel (exemple: "#abc") */
char *topic; /* topic of channel (host for private) */
char *modes; /* channel modes */
int limit; /* user limit (0 is limit not set) */
char *key; /* channel key (NULL if no key is set) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
t_irc_nick *nicks; /* nicks on the channel */
t_irc_nick *last_nick; /* last nick on the channel */
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
t_irc_channel *prev_channel; /* link to previous channel */
t_irc_channel *next_channel; /* link to next channel */
int type; /* channel type */
void *dcc_chat; /* DCC CHAT pointer (NULL if not DCC) */
char *name; /* name of channel (exemple: "#abc") */
char *topic; /* topic of channel (host for private) */
char *modes; /* channel modes */
int limit; /* user limit (0 is limit not set) */
char *key; /* channel key (NULL if no key is set) */
int nicks_count; /* # nicks on channel (0 if dcc/pv) */
int checking_away; /* = 1 if checking away with WHO cmd */
t_irc_nick *nicks; /* nicks on the channel */
t_irc_nick *last_nick; /* last nick on the channel */
t_gui_buffer *buffer; /* GUI buffer allocated for channel */
t_irc_channel *prev_channel; /* link to previous channel */
t_irc_channel *next_channel; /* link to next channel */
};
/* server types */
@@ -123,55 +123,55 @@ typedef struct t_irc_server t_irc_server;
struct t_irc_server
{
/* user choices */
char *name; /* name of server (only for display) */
int autoconnect; /* = 1 if auto connect at startup */
int autoreconnect; /* = 1 if auto reco when disconnected */
int autoreconnect_delay; /* delay before trying again reconnect */
int command_line; /* server was given on command line */
char *address; /* address of server (IP or name) */
int port; /* port for server (6667 by default) */
int ipv6; /* use IPv6 protocol */
int ssl; /* SSL protocol */
char *password; /* password for server */
char *nick1; /* first nickname for the server */
char *nick2; /* alternate nickname */
char *nick3; /* 2nd alternate nickname */
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
char *notify_levels; /* channels notify levels */
char *charset_decode_iso; /* channels charsets for decoding ISO */
char *charset_decode_utf; /* channels charsets for decoding UTF */
char *charset_encode; /* channels charsets for encoding msgs */
char *name; /* name of server (only for display) */
int autoconnect; /* = 1 if auto connect at startup */
int autoreconnect; /* = 1 if auto reco when disconnected */
int autoreconnect_delay; /* delay before trying again reconnect */
int command_line; /* server was given on command line */
char *address; /* address of server (IP or name) */
int port; /* port for server (6667 by default) */
int ipv6; /* use IPv6 protocol */
int ssl; /* SSL protocol */
char *password; /* password for server */
char *nick1; /* first nickname for the server */
char *nick2; /* alternate nickname */
char *nick3; /* 2nd alternate nickname */
char *username; /* user name */
char *realname; /* real name */
char *command; /* command to run once connected */
int command_delay; /* delay after execution of command */
char *autojoin; /* channels to automatically join */
int autorejoin; /* auto rejoin channels when kicked */
char *notify_levels; /* channels notify levels */
char *charset_decode_iso; /* channels charsets for decoding ISO */
char *charset_decode_utf; /* channels charsets for decoding UTF */
char *charset_encode; /* channels charsets for encoding msgs */
/* internal vars */
pid_t child_pid; /* pid of child process (connecting) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
int sock; /* socket for server (IPv4 or IPv6) */
int is_connected; /* 1 if WeeChat is connected to server */
int ssl_connected; /* = 1 if connected with SSL */
pid_t child_pid; /* pid of child process (connecting) */
int child_read; /* to read into child pipe */
int child_write; /* to write into child pipe */
int sock; /* socket for server (IPv4 or IPv6) */
int is_connected; /* 1 if WeeChat is connected to server */
int ssl_connected; /* = 1 if connected with SSL */
#ifdef HAVE_GNUTLS
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
gnutls_session gnutls_sess; /* gnutls session (only if SSL is used) */
#endif
char *unterminated_message; /* beginning of a message in input buf */
char *nick; /* current nickname */
time_t reconnect_start; /* this time + delay = reconnect time */
int reconnect_join; /* 1 if channels opened to rejoin */
int is_away; /* 1 is user is marker as away */
time_t away_time; /* time() when user marking as away */
int lag; /* lag (in milliseconds) */
struct timeval lag_check_time; /* last time lag was checked (ping sent)*/
time_t lag_next_check; /* time for next check */
t_gui_buffer *buffer; /* GUI buffer allocated for server */
t_gui_buffer *saved_buffer; /* channel before jumping to next server*/
t_irc_channel *channels; /* opened channels on server */
t_irc_channel *last_channel; /* last opened channal on server */
t_irc_server *prev_server; /* link to previous server */
t_irc_server *next_server; /* link to next server */
char *unterminated_message; /* beginning of a message in input buf */
char *nick; /* current nickname */
time_t reconnect_start; /* this time + delay = reconnect time */
int reconnect_join; /* 1 if channels opened to rejoin */
int is_away; /* 1 is user is marker as away */
time_t away_time; /* time() when user marking as away */
int lag; /* lag (in milliseconds) */
struct timeval lag_check_time; /* last time lag was checked (ping sent) */
time_t lag_next_check; /* time for next check */
t_gui_buffer *buffer; /* GUI buffer allocated for server */
t_gui_buffer *saved_buffer; /* channel before jumping to next server */
t_irc_channel *channels; /* opened channels on server */
t_irc_channel *last_channel; /* last opened channal on server */
t_irc_server *prev_server; /* link to previous server */
t_irc_server *next_server; /* link to next server */
};
/* irc commands */
@@ -180,18 +180,20 @@ typedef struct t_irc_command t_irc_command;
struct t_irc_command
{
char *command_name; /* command name (internal or IRC cmd) */
char *command_description; /* command description */
char *arguments; /* command parameters */
char *arguments_description; /* parameters description */
int min_arg, max_arg; /* min & max number of parameters */
int need_connection; /* = 1 if cmd needs server connection */
char *command_name; /* IRC command name */
char *command_description; /* command description (for /help) */
char *arguments; /* command arguments (for /help) */
char *arguments_description; /* arguments description (for /help) */
char *completion_template; /* template for completion */
/* NULL=no completion, ""=default (nick) */
int min_arg, max_arg; /* min & max number of arguments */
int need_connection; /* = 1 if cmd needs server connection */
int (*cmd_function_args)(t_irc_server *, int, char **);
/* function called when user enters cmd */
/* function called when user enters cmd */
int (*cmd_function_1arg)(t_irc_server *, char *);
/* function called when user enters cmd */
/* function called when user enters cmd */
int (*recv_function)(t_irc_server *, char *, char *, char *);
/* function called when cmd is received */
/* function called when cmd is received */
};
/* irc messages */
@@ -200,24 +202,24 @@ typedef struct t_irc_message t_irc_message;
struct t_irc_message
{
t_irc_server *server; /* server pointer for received msg */
char *data; /* message content */
t_irc_message *next_message; /* link to next message */
t_irc_server *server; /* server pointer for received msg */
char *data; /* message content */
t_irc_message *next_message; /* link to next message */
};
/* DCC types */
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
#define DCC_CHAT_SEND 1 /* sending DCC chat */
#define DCC_FILE_RECV 2 /* incoming DCC file */
#define DCC_FILE_SEND 3 /* sending DCC file */
#define DCC_CHAT_RECV 0 /* receiving DCC chat */
#define DCC_CHAT_SEND 1 /* sending DCC chat */
#define DCC_FILE_RECV 2 /* incoming DCC file */
#define DCC_FILE_SEND 3 /* sending DCC file */
#define DCC_WAITING 0 /* waiting for host answer */
#define DCC_CONNECTING 1 /* connecting to host */
#define DCC_ACTIVE 2 /* sending/receiving data */
#define DCC_DONE 3 /* transfer done */
#define DCC_FAILED 4 /* DCC failed */
#define DCC_ABORTED 5 /* DCC aborted by user */
#define DCC_WAITING 0 /* waiting for host answer */
#define DCC_CONNECTING 1 /* connecting to host */
#define DCC_ACTIVE 2 /* sending/receiving data */
#define DCC_DONE 3 /* transfer done */
#define DCC_FAILED 4 /* DCC failed */
#define DCC_ABORTED 5 /* DCC aborted by user */
#define DCC_IS_CHAT(type) ((type == DCC_CHAT_RECV) || (type == DCC_CHAT_SEND))
#define DCC_IS_FILE(type) ((type == DCC_FILE_RECV) || (type == DCC_FILE_SEND))
@@ -231,38 +233,38 @@ typedef struct t_irc_dcc t_irc_dcc;
struct t_irc_dcc
{
t_irc_server *server; /* irc server */
t_irc_channel *channel; /* irc channel (for DCC chat only) */
int type; /* DCC type (send or receive) */
int status; /* DCC status (waiting, sending, ..) */
time_t start_time; /* the time when DCC started */
time_t start_transfer; /* the time when DCC transfer started */
unsigned long addr; /* IP address */
int port; /* port */
char *nick; /* remote nick */
int sock; /* socket for connection */
char *unterminated_message; /* beginning of a message in input buf */
int file; /* local file (for reading or writing) */
char *filename; /* filename (given by sender) */
char *local_filename; /* local filename (with path) */
int filename_suffix; /* suffix (.1 for ex) if renaming file */
unsigned long size; /* file size */
unsigned long pos; /* number of bytes received/sent */
unsigned long ack; /* number of bytes received OK */
unsigned long start_resume; /* start of resume (in bytes) */
time_t last_check_time; /* last time we looked at bytes sent/rcv*/
unsigned long last_check_pos; /* bytes sent/recv at last check */
time_t last_activity; /* time of last byte received/sent */
unsigned long bytes_per_sec; /* bytes per second */
unsigned long eta; /* estimated time of arrival */
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
t_irc_server *server; /* irc server */
t_irc_channel *channel; /* irc channel (for DCC chat only) */
int type; /* DCC type (send or receive) */
int status; /* DCC status (waiting, sending, ..) */
time_t start_time; /* the time when DCC started */
time_t start_transfer; /* the time when DCC transfer started */
unsigned long addr; /* IP address */
int port; /* port */
char *nick; /* remote nick */
int sock; /* socket for connection */
char *unterminated_message; /* beginning of a message in input buf */
int file; /* local file (for reading or writing) */
char *filename; /* filename (given by sender) */
char *local_filename; /* local filename (with path) */
int filename_suffix; /* suffix (.1 for ex) if renaming file */
unsigned long size; /* file size */
unsigned long pos; /* number of bytes received/sent */
unsigned long ack; /* number of bytes received OK */
unsigned long start_resume; /* start of resume (in bytes) */
time_t last_check_time; /* last time we looked at bytes sent/recv */
unsigned long last_check_pos; /* bytes sent/recv at last check */
time_t last_activity; /* time of last byte received/sent */
unsigned long bytes_per_sec; /* bytes per second */
unsigned long eta; /* estimated time of arrival */
t_irc_dcc *prev_dcc; /* link to previous dcc file/chat */
t_irc_dcc *next_dcc; /* link to next dcc file/chat */
};
/* ignore types */
/* pre-defined ignore types, all other types are made with IRC commands */
/* for example: part join quit notice invite ... */
/* pre-defined ignore types, all other types are made with IRC commands */
/* for example: part join quit notice invite ... */
#define IGNORE_ACTION "action"
#define IGNORE_CTCP "ctcp"
@@ -273,12 +275,12 @@ typedef struct t_irc_ignore t_irc_ignore;
struct t_irc_ignore
{
char *mask; /* nickname or mask */
char *type; /* type of ignore */
char *channel_name; /* name of channel, "*" == all */
char *server_name; /* name of server, "*" == all */
t_irc_ignore *prev_ignore; /* pointer to previous ignore */
t_irc_ignore *next_ignore; /* pointer to next ignore */
char *mask; /* nickname or mask */
char *type; /* type of ignore */
char *channel_name; /* name of channel, "*" == all */
char *server_name; /* name of server, "*" == all */
t_irc_ignore *prev_ignore; /* pointer to previous ignore */
t_irc_ignore *next_ignore; /* pointer to next ignore */
};
/* variables */
+2
View File
@@ -237,12 +237,14 @@ t_plugin_handler *
weechat_plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
char *description, char *arguments,
char *arguments_description,
char *completion_template,
t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)
{
if (plugin && command && handler_func)
return plugin_cmd_handler_add (plugin, command, description, arguments,
arguments_description,
completion_template,
handler_func,
handler_args, handler_pointer);
+53 -49
View File
@@ -225,10 +225,11 @@ plugin_msg_handler_add (t_weechat_plugin *plugin, char *irc_command,
* 3. command description (for /help)
* 4. command arguments (for /help)
* 5. command args description (for /help)
* 6. the handler function
* 7. handler args: a string given to
* 6. completion template
* 7. the handler function
* 8. handler args: a string given to
* handler when called (used by scripts)
* 8. handler pointer: a pointer given to
* 9. handler pointer: a pointer given to
* handler when called (used by scripts)
*/
@@ -236,6 +237,7 @@ t_plugin_handler *
plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
char *description, char *arguments,
char *arguments_description,
char *completion_template,
t_plugin_handler_func *handler_func,
char *handler_args, void *handler_pointer)
{
@@ -260,6 +262,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
new_handler->description = (description) ? strdup (description) : NULL;
new_handler->arguments = (arguments) ? strdup (arguments) : NULL;
new_handler->arguments_description = (arguments_description) ? strdup (arguments_description) : NULL;
new_handler->completion_template = (completion_template) ? strdup (completion_template) : NULL;
new_handler->handler = handler_func;
new_handler->handler_args = (handler_args) ? strdup (handler_args) : NULL;
new_handler->handler_pointer = handler_pointer;
@@ -706,35 +709,61 @@ int plugin_auto_load_file (t_weechat_plugin *plugin, char *filename)
void plugin_auto_load ()
{
char *ptr_home, *dir_name;
char *ptr_home, *dir_name, *list_plugins, *pos, *pos2;
/* auto-load plugins in WeeChat home dir */
if (cfg_plugins_path && cfg_plugins_path[0])
if (cfg_plugins_autoload && cfg_plugins_autoload[0])
{
if (cfg_plugins_path[0] == '~')
if (ascii_strcasecmp (cfg_plugins_autoload, "*") == 0)
{
ptr_home = getenv ("HOME");
dir_name = (char *)malloc (strlen (cfg_plugins_path) + strlen (ptr_home) + 2);
/* auto-load plugins in WeeChat home dir */
if (cfg_plugins_path && cfg_plugins_path[0])
{
if (cfg_plugins_path[0] == '~')
{
ptr_home = getenv ("HOME");
dir_name = (char *)malloc (strlen (cfg_plugins_path) + strlen (ptr_home) + 2);
if (dir_name)
{
strcpy (dir_name, ptr_home);
strcat (dir_name, cfg_plugins_path + 1);
plugin_exec_on_files (NULL, dir_name, &plugin_auto_load_file);
free (dir_name);
}
}
else
plugin_exec_on_files (NULL, cfg_plugins_path, &plugin_auto_load_file);
}
/* auto-load plugins in WeeChat global lib dir */
dir_name = (char *)malloc (strlen (WEECHAT_LIBDIR) + 16);
if (dir_name)
{
strcpy (dir_name, ptr_home);
strcat (dir_name, cfg_plugins_path + 1);
snprintf (dir_name, strlen (WEECHAT_LIBDIR) + 16,
"%s/plugins", WEECHAT_LIBDIR);
plugin_exec_on_files (NULL, dir_name, &plugin_auto_load_file);
free (dir_name);
}
}
else
plugin_exec_on_files (NULL, cfg_plugins_path, &plugin_auto_load_file);
}
/* auto-load plugins in WeeChat global lib dir */
dir_name = (char *)malloc (strlen (WEECHAT_LIBDIR) + 16);
if (dir_name)
{
snprintf (dir_name, strlen (WEECHAT_LIBDIR) + 16,
"%s/plugins", WEECHAT_LIBDIR);
plugin_exec_on_files (NULL, dir_name, &plugin_auto_load_file);
free (dir_name);
{
list_plugins = strdup (cfg_plugins_autoload);
if (list_plugins)
{
pos = list_plugins;
while (pos && pos[0])
{
pos2 = strchr (pos, ',');
if (pos2)
pos2[0] = '\0';
plugin_load (pos);
if (pos2)
pos = pos2 + 1;
else
pos = NULL;
}
free (list_plugins);
}
}
}
}
@@ -835,37 +864,12 @@ plugin_unload_all ()
void
plugin_init (int auto_load)
{
char *list_plugins, *pos, *pos2;
/* read plugins options on disk */
plugin_config_read ();
/* auto-load plugins if asked */
if (auto_load && cfg_plugins_autoload && cfg_plugins_autoload[0])
{
if (ascii_strcasecmp (cfg_plugins_autoload, "*") == 0)
plugin_auto_load ();
else
{
list_plugins = strdup (cfg_plugins_autoload);
if (list_plugins)
{
pos = list_plugins;
while (pos && pos[0])
{
pos2 = strchr (pos, ',');
if (pos2)
pos2[0] = '\0';
plugin_load (pos);
if (pos2)
pos = pos2 + 1;
else
pos = NULL;
}
free (list_plugins);
}
}
}
if (auto_load)
plugin_auto_load ();
}
/*
+1
View File
@@ -41,6 +41,7 @@ extern t_plugin_handler *plugin_msg_handler_add (t_weechat_plugin *, char *,
char *, void *);
extern t_plugin_handler *plugin_cmd_handler_add (t_weechat_plugin *, char *,
char *, char *, char *,
char *,
t_plugin_handler_func *,
char *, void *);
extern int plugin_msg_handler_exec (char *, char *, char *);
@@ -426,6 +426,7 @@ static XS (XS_weechat_add_message_handler)
static XS (XS_weechat_add_command_handler)
{
char *command, *function, *description, *arguments, *arguments_description;
char *completion_template;
unsigned int integer;
dXSARGS;
@@ -453,12 +454,14 @@ static XS (XS_weechat_add_command_handler)
description = (items >= 3) ? SvPV (ST (2), integer) : NULL;
arguments = (items >= 4) ? SvPV (ST (3), integer) : NULL;
arguments_description = (items >= 5) ? SvPV (ST (4), integer) : NULL;
completion_template = (items >= 6) ? SvPV (ST (5), integer) : NULL;
if (perl_plugin->cmd_handler_add (perl_plugin,
command,
description,
arguments,
arguments_description,
completion_template,
weechat_perl_handler,
function,
(void *)perl_current_script))
@@ -1197,6 +1200,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
"[load filename] | [autoload] | [reload] | [unload]",
"filename: Perl script (file) to load\n\n"
"Without argument, /perl command lists all loaded Perl scripts.",
"load|autoload|reload|unload",
weechat_perl_cmd, NULL, NULL);
plugin->mkdir_home (plugin, "perl");
@@ -333,6 +333,7 @@ static PyObject *
weechat_python_add_command_handler (PyObject *self, PyObject *args)
{
char *command, *function, *description, *arguments, *arguments_description;
char *completion_template;
/* make gcc happy */
(void) self;
@@ -350,9 +351,11 @@ weechat_python_add_command_handler (PyObject *self, PyObject *args)
description = NULL;
arguments = NULL;
arguments_description = NULL;
completion_template = NULL;
if (!PyArg_ParseTuple (args, "ss|sss", &command, &function,
&description, &arguments, &arguments_description))
if (!PyArg_ParseTuple (args, "ss|ssss", &command, &function,
&description, &arguments, &arguments_description,
completion_template))
{
python_plugin->printf_server (python_plugin,
"Python error: wrong parameters for "
@@ -365,6 +368,7 @@ weechat_python_add_command_handler (PyObject *self, PyObject *args)
description,
arguments,
arguments_description,
completion_template,
weechat_python_handler,
function,
(void *)python_current_script))
@@ -1151,6 +1155,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
"[load filename] | [autoload] | [reload] | [unload]",
"filename: Python script (file) to load\n\n"
"Without argument, /python command lists all loaded Python scripts.",
"load|autoload|reload|unload",
weechat_python_cmd, NULL, NULL);
plugin->mkdir_home (plugin, "python");
@@ -448,7 +448,9 @@ static VALUE
weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
{
VALUE command, function, description, arguments, arguments_description;
VALUE completion_template;
char *c_command, *c_function, *c_description, *c_arguments, *c_arguments_description;
char *c_completion_template;
/* make gcc happy */
(void) class;
@@ -466,14 +468,16 @@ weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
description = Qnil;
arguments = Qnil;
arguments_description = Qnil;
completion_template = Qnil;
c_command = NULL;
c_function = NULL;
c_description = NULL;
c_arguments = NULL;
c_arguments_description = NULL;
c_completion_template = NULL;
rb_scan_args (argc, argv, "23", &command, &function, &description,
&arguments, &arguments_description);
rb_scan_args (argc, argv, "24", &command, &function, &description,
&arguments, &arguments_description, &completion_template);
if (NIL_P (command) || NIL_P (function))
{
@@ -500,16 +504,24 @@ weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
c_arguments = STR2CSTR (arguments);
}
if (!NIL_P (arguments_description)) {
if (!NIL_P (arguments_description))
{
Check_Type (arguments_description, T_STRING);
c_arguments_description = STR2CSTR (arguments_description);
}
if (!NIL_P (completion_template))
{
Check_Type (completion_template, T_STRING);
c_completion_template = STR2CSTR (completion_template);
}
if (ruby_plugin->cmd_handler_add (ruby_plugin,
c_command,
c_description,
c_arguments,
c_arguments_description,
c_completion_template,
weechat_ruby_handler,
c_function,
(void *)ruby_current_script))
@@ -1322,6 +1334,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
"[load filename] | [autoload] | [reload] | [unload]",
"filename: Ruby script (file) to load\n\n"
"Without argument, /ruby command lists all loaded Ruby scripts.",
"load|autoload|reload|unload",
weechat_ruby_cmd, NULL, NULL);
plugin->mkdir_home (plugin, "ruby");
+3
View File
@@ -86,6 +86,7 @@ struct t_plugin_handler
char *description; /* (for /help) short cmd description */
char *arguments; /* (for /help) command arguments */
char *arguments_description; /* (for /help) args long description */
char *completion_template; /* template for completion */
/* data common to all handlers */
t_plugin_handler_func *handler; /* pointer to handler */
@@ -141,6 +142,7 @@ struct t_weechat_plugin
char *, void *);
t_plugin_handler *(*cmd_handler_add) (t_weechat_plugin *, char *,
char *, char *, char *,
char *,
t_plugin_handler_func *,
char *, void *);
void (*handler_remove) (t_weechat_plugin *, t_plugin_handler *);
@@ -178,6 +180,7 @@ extern t_plugin_handler *weechat_plugin_msg_handler_add (t_weechat_plugin *, cha
char *, void *);
extern t_plugin_handler *weechat_plugin_cmd_handler_add (t_weechat_plugin *, char *,
char *, char *, char *,
char *,
t_plugin_handler_func *,
char *, void *);
extern void weechat_plugin_handler_remove (t_weechat_plugin *, t_plugin_handler *);