-
Notifications
You must be signed in to change notification settings - Fork 6
Irc::Server
Many of these methods take $server as a first argument. These are intended to be called as $server->method(@args). Therefore, the $server argument will not be elaborated on in the following descriptions.
redirect_event $server, $cmd, $count, $arg, $remote, $failure_sig, $signals-
This method sets up an event redirection for a given server and event.
$cmdis the command in question.$countis the number of times to execute the redirection. This is useful for commands which may send multiple stop events.$argis a string which will be compared to the event result strings. Multiple arguments can be given, separated by spaces.$remoteis a flag indicating whether the command is run remotely. A value of-1causes the redirection to fall back to the original value specified when the redirect was registered.$failure_sigis a string containing the name of a signal to emit if the stop signal(s) cannot be called, for whatever reason. Most likely, this will be due to a timeout occuring.$signalsis a hashref containing"event <num>" => "redir <signal-name>"pairs.For a more complete example, see the Guide/Redirection
redirect_register $cmd, $remote, $timeout, $start_sigs, $stop_sigs, $opt_sigs-
This method registers a new command specified in
$cmdand makes it available for redirecting withredirect_event.$cmdis the name of the command,$remoteis a flag indicating if the command is by default run on a remote server. Its value can be overridden by the$remotevalue passed inredirect_event.$timeoutspecifies the default number of seconds to wait before assuming the command failed. The timeout is only valid if the$remoteflag is true.$start_sigsis a hashref, the keys of which are the signals which cause the redirection to begin.$end_sigsis another hashref, this time containing signals which indicate the redirection is complete.$opt_sigsis another hashref containing optional signals, which will be redirected if they are received immediately after one of the stop events.For each of the above 3 hashes, the signal name is used as a key, and the corresponding value is an integer which specifies the "argument position." Argument position selects the nth word of the response for matching against the
$argvalue passed intoredirect_event.The following list shows the redirects which are registered by default on Irssi startup:
whoiswhowaswholistisonuserhostmode usermode channelmode b-
Bans.
mode e-
Ban Exceptions
mode I-
Invite list
ping
TODO: Untested, info gathered from src/irc/core/servers-redirect.c and src/irc/core/servers-redirect.h. See servers-redirect.c for an online version.
redirect_get_signal $server, $prefix, $event, $args-
TODO
It appears
$prefixis typically the server (maybe network sometimes) name. Event is the name of the event being listened for(?) e.g. 'event 311'. redirect_peek_signal $server, $prefix, $event, $args-
TODO Probably quite similar to
redirect_get_signal()
- netsplit_find
- netsplit_find_channel
- ctcp_send_reply
-
TODO
get_channels $server-
Returns a list of channels you are joined to on this server.
isupport $server, $name-
This method allows you to query the server to determine what features it supports (assuming it at least supports isupport).
$nameis the name of the parameter you wish to query. Details on the isupport parameters can be found [[in the original draft proposal|http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt]] or a slightly easier to read version notifylist_ison_server $server, $nick-
TODO
query_create-
TODO
send_raw $server, $cmd-
Sends the command specified in
$cmdto$server. Despite the name, it does not send a "raw" string, but instead truncates it to 510 bytes, and appends a CRLF line-ending to it. The command is not necessarily sent immediately. If the current time is less than onecmd_queue_speedduration since the last command, or if there are more thancmds_max_at_oncein the queue, it is queued for later sending.TODO: What's the difference between the queue orderings in irc/core/irc.c:90?
send_raw_now $server, $cmd-
Sends the command
$cmdto$server, bypassing the send queue in order to send it immediately. send_raw_first $server, $cmd-
Sends
$cmdto$serveras fast as possible whilst maintaining flood protection. It does this by inserting it at the head of the send queue, so it will be dispatched first. send_raw_split $server, $cmd, $nick_arg, $max_nicks-
Sends
$cmdto$server.$nick_argis an integer, as is$max_nicks. It appears to be used for breaking long commands, or commands that may only act on a certain number of nicks into smaller chunks, and sending them individually.TODO: clarify what the last 2 arguments actually do.
Much of the content on these pages is taken from original Irssi documentation and is Copyright © 2000-2010 The Irssi project. Formatting and additional documentation, examples, etc by Tom Feist and the other editors of this wiki. This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. Please see http://creativecommons.org/licenses/by-sa/2.5/ for details.