diff options
| author | Tom Feist <shabble@cowu.be> | 2010-07-09 22:01:59 +0000 | 
|---|---|---|
| committer | Tom Feist <shabble@cowu.be> | 2010-07-09 22:01:59 +0000 | 
| commit | 18e61f4d15f1c6c5058cba6a69caf88114327b0d (patch) | |
| tree | 65306f39160c357c008f4ea0b34ef67054118505 | |
| parent | initial podifying of irssi docs (diff) | |
| download | irssi-scripts-18e61f4d15f1c6c5058cba6a69caf88114327b0d.tar.gz irssi-scripts-18e61f4d15f1c6c5058cba6a69caf88114327b0d.zip | |
added history_search and scrolled-reminder as work in progress
| -rw-r--r-- | docs/perl.txt | 1214 | ||||
| -rw-r--r-- | docs/signals.txt | 335 | ||||
| -rw-r--r-- | history-search/history_search.pl | 194 | ||||
| -rw-r--r-- | history-search/irssi/config | 266 | ||||
| -rw-r--r-- | history-search/irssi/default.theme | 294 | ||||
| l--------- | history-search/irssi/scripts | 1 | ||||
| -rwxr-xr-x | history-search/run_irssi.sh | 2 | ||||
| -rw-r--r-- | scrolled-reminder/scrolled-reminder.pl | 65 | ||||
| -rw-r--r-- | scrolled-reminder/test.pl | 77 | 
9 files changed, 2448 insertions, 0 deletions
| diff --git a/docs/perl.txt b/docs/perl.txt new file mode 100644 index 0000000..dd72623 --- /dev/null +++ b/docs/perl.txt @@ -0,0 +1,1214 @@ + + +    * bugs +    * support +    * news +    * documentation +    * download +    * about +    * themes +    * scripts + +What's this? + +You are visiting the official website for the IRC client Irssi, for more information see the about section. +Search this site + +Search function coming soon! + +  +What's new? + +Irssi 0.8.15 has been released and the new website will be released in a few weeks! +Perl Scripting Reference + + Installation problems + --------------------- + +You'll need to have perl support compiled with irssi. If "/LOAD" +doesn't show perl in list of loaded modules, you have a problem. See +INSTALL file for information about perl problems. + + + Running scripts + --------------- + +Scripts are run with /SCRIPT LOAD command, or the default /RUN alias. +"/SCRIPT" shows list of running script, and /SCRIPT UNLOAD can unload +scripts. + +Scripts should be placed to ~/.irssi/scripts/ or +/usr/local/lib/irssi/scripts/ (or depending on where irssi was +installed) directories. After that /RUN script_name should work, you +don't need to add the .pl suffix. + + + Irssi's signals + --------------- + +Irssi is pretty much based on sending and handling different signals. +Like when you receive a message from server, say + +  :nick!user@there.org PRIVMSG you :blahblah + +Irssi will first send a signal: + +  "server incoming", SERVER_REC, "nick!user@there PRIVMSG ..." + +You probably don't want to use this signal. Default handler for this +signal interprets the header and sends a signal: + +  "server event", SERVER_REC, "PRIVMSG ...", "nick", "user@there.org" + +You probably don't want to use this either, since this signal's default +handler parses the event string and sends a signal: + +  "event privmsg", SERVER_REC, "you :blahblah", "nick", "user@there.org" + +You can at any point grab the signal, do whatever you want to do with +it and optionally stop it from going any further by calling +Irssi::signal_stop(); + +For example: + +  sub event_privmsg { +    # $data = "nick/#channel :text" +    my ($server, $data, $nick, $address) = @_; +    my ($target, $text) = split(/ :/, $data, 2); + +    Irssi::signal_stop() if ($text =~ /free.*porn/ || $nick =~ /idiot/); +  } + +Irssi::signal_add("event privmsg", "event_privmsg") + +This will hide all public or private messages that match the regexp +"free.*porn" or the sender's nick contain the word "idiot". Yes, you +could use /IGNORE instead for both of these :) + +You can also use signal_add_last() if you wish to let the Irssi's internal +functions be run before yours. + +A list of signals that irssi sends can be found from signals.txt file. + + + Creating/replacing /COMMANDS + ---------------------------- + +You can create your own commands, or replace existing ones with +Irssi::command_bind(). The command handling work internally pretty much +the same as signal handlers, so if you replace existing command and don't +wish to let it run, call Irssi::signal_stop(). + +Here's an example: + +  # Usage: /HELLO [<nick>] +  sub cmd_hello { +    # data - contains the parameters for /HELLO +    # server - the active server in window +    # witem - the active window item (eg. channel, query) +    #         or undef if the window is empty +    my ($data, $server, $witem) = @_; + +    if (!$server || !$server->{connected}) { +      Irssi::print("Not connected to server"); +      return; +    } + +    if ($data) { +      $server->command("MSG $data Hello!"); +    } elsif ($witem && ($witem->{type} eq "CHANNEL" || +                        $witem->{type} eq "QUERY")) { +      # there's query/channel active in window +      $witem->command("MSG ".$witem->{name}." Hello!"); +    } else { +      Irssi::print("Nick not given, and no active channel/query in window"); +    } +  } + +  Irssi::command_bind('hello', 'cmd_hello'); + + + Message levels + -------------- + +Several functions expect message levels. They're used to roughly +classify messages. They're used by a lot of things including logging, +ignoring, highlighting, etc. so you should use as good level as +possible. It's possible to have several levels in one message, like +ACTIONS+PUBLIC or ACTIONS+MSGS. + +Here's all the levels that irssi supports currently: + +  CRAP, MSGS, PUBLIC, NOTICES, SNOTES, CTCPS, ACTIONS, JOINS, PARTS +  QUITS, KICKS, MODES, TOPICS, WALLOPS, INVITES, NICKS, DCC, DCCMSGS, +  CLIENTNOTICE, CLIENTCRAP, CLIENTERROR + +And a few special ones that could be included with the levels above: + +  HILIGHT - text is highlighted +  NOHILIGHT - don't check highlighting for this message +  NO_ACT - don't trigger channel activity when printing this message +  NEVER - never ignore or log this message (not a good idea usually) + +You can use them with a MSGLEVEL_ prefix, for example: + +  $server->print("#channel", 'Hello, world', MSGLEVEL_CLIENTCRAP); + +Writes text to #channel window with CLIENTCRAP level. + + + Window items + ------------ + +Meaning of "window" should be pretty clear, but "window item" is +something I couldn't really figure out a better name for :) They're +simply something that's inside a window, a channel or a query usually. +Windows can have multiple items inside them. It's possible to create +non-channel/query window items too, currently the third possible window +item is created by /EXEC -interactive. + +In scripts, I think you can quite safely assume that the window item is +query or channel if the script is intended to be run in one of them. +Stupid users won't probably have other window items, and smart users +know where to run the script, or at least later figure out why it +didn't work :) + + + Functions that you can use in Irssi's Perl scripts + -------------------------------------------------- + +If there's a "Xxxx::" text before the command, it means that it belongs to +that package. Like "Server::command" means that you should either call it as +  Irssi::Server::command($server, $cmd); +or more easily: +  $server->command($cmd); + +Commands that don't have the Xxxx prefix are called as Irssi::command(); + +Information from most objects can be fetched with $object->{data}, for +example current nick in server could be read with $server->{nick}. List +of all the information that are in objects are in "Object->{}" sections +below. + +Commands are split in two groups, generic ones that could be used with +any chat protocol, and IRC specific commands. If you want to use IRC +specific commands, or use IRC specific ->{data} in your scripts, you'll +need to add "use Irssi::Irc" to your scripts. IRC specific commands are +listed after the generic ones. + + + *** General + +Window active_win() - return active window +Server active_server() - return server in active window + +windows() - return list of all windows +servers() - return list of all servers +reconnects() - return list of all server reconnections +channels() - return list of all channels +queries() - return list of all queries +commands() - return list of all commands +logs() - return list of all log files +ignores() - returns list of all ignores + +Server::channels() - return list of channels in server +Server::queries() - return list of queries in server + +print(str[, level]) +Server::print(channel, str[, level]) +Window::print(str[, level]) +Windowitem::print(str[, level]) +  Print `str'. Default level is MSGLEVEL_CLIENTNOTICE. + +command(cmd) +Server::command(cmd) +Window::command(cmd) +Windowitem::command(cmd) +  Send a command `cmd' (in current channel). The '/' char isn't needed. + + + *** Themes + +You can have user configurable texts in scripts that work just like +irssi's internal texts that can be changed in themes. + +First you'll have to register the formats: + +Irssi::theme_register([ +  'format_name', '{hilight my perl format!}', +  'format2', 'testing.. nick = $0, channel = $1' +]); + +Printing happens with one of the functions: + +printformat(level, format, ...) +Window::printformat(level, format, ...) +Server::printformat(target, level, format, ...) +Windowitem::printformat(level, format, ...) + +For example: + +  $channel->printformat(MSGLEVEL_CRAP, 'format2', +		        'nick', $channel->{name}); + + + *** Settings + +settings_get_str(key) +settings_get_int(key) +settings_get_bool(key) +settings_get_time(key) +settings_get_level(key) +settings_get_size(key) +  Return value for setting. + +settings_set_str(key, value) +settings_set_int(key, value) +settings_set_bool(key, value) +settings_set_time(key, value) +settings_set_level(key, value) +settings_set_size(key, value) +  Set value for setting. +  If you change the settings of another module/script with one of these, you +  must emit a "setup changed" signal afterwards. + +settings_add_str(section, key, def) +settings_add_int(section, key, def) +settings_add_bool(section, key, def) +settings_add_time(section, key, def) +settings_add_level(section, key, def) +settings_add_size(section, key, def) +  Create new setting. + +settings_remove(key) +  Remove a setting. + + + *** Signals + +signal_emit(signal, ...) +  Send signal `signal'. You can give 6 parameters at maximum. + +signal_continue(...) +  Continue currently emitted signal with different parameters. + +signal_add(signal, func) +  Bind `signal' to function `func'. + +signal_add_first(signal, func) +  Bind `signal' to function `func'. Call `func' as soon as possible. + +signal_add_last(signal, func) +  Bind `signal' to function `func'. Call `func' as late as possible. + +signal_remove(signal, func) +  Unbind `signal' from function `func'. + +signal_stop() +  Stop the signal that's currently being emitted. + +signal_stop_by_name(signal) +  Stop the signal with name `signal' that's currently being emitted. + +signal_register(hash) +  Register parameter types for one or more signals. +  `hash' must map one or more signal names to references to arrays +  containing 0 to 6 type names. Some recognized type names include +  int for integers, intptr for references to integers and string for +  strings. For all standard signals see src/perl/perl-signals-list.h +  in the source code (this is generated by src/perl/get-signals.pl). + +  Any signals that were already registered are unaffected. + +  Registration is required to get any parameters to signals written in +  Perl and to emit and continue signals from Perl. + +  *** timeouts / IO listener / pidwait + +timeout_add(msecs, func, data) +  Call `func' every `msecs' milliseconds (1000 = 1 second) with +  parameter `data'. Returns tag which can be used to stop the timeout. + +timeout_add_once(msecs, func, data); +  Call `func' once after `msecs' milliseconds (1000 = 1 second) +  with parameter `data'. Returns tag which can be used to stop the timeout. + +timeout_remove(tag) +  Remove timeout with tag. + +input_add(source, condition, func, data) +  Call `func' with parameter `data' when specified IO happens. +  `source' is the file handle that is being listened. `condition' can +  be INPUT_READ, INPUT_WRITE or both. Returns tag which can be used to +  remove the listener. + +input_remove(tag) +  Remove listener with tag. + +pidwait_add(pid) +  Adds `pid' to the list of processes to wait for. The pid must identify +  a child process of the irssi process. When the process terminates, a +  "pidwait" signal will be sent with the pid and the status from +  waitpid(). This is useful to avoid zombies if your script forks. + +pidwait_remove(pid) +  Removes `pid' from the list of processes to wait for. Terminated +  processes are removed automatically, so it is usually not necessary +  to call this function. + + *** Message levels + +level2bits(level) +  Level string -> number + +bits2level(bits) +  Level number -> string + +combine_level(level, str) +  Combine level number to level string ("+level -level"). +  Return new level number. + + + *** Commands + +Command->{} +  cmd - Command name +  category - Category + +command_bind(cmd, func[, category]) +  Bind command `cmd' to call function `func'. `category' is the +  category where the command is displayed in /HELP. + +command_runsub(cmd, data, server, item) +  Run subcommands for `cmd'. First word in `data' is parsed as +  subcommand. `server' is Irssi::Server rec for current +  Irssi::Windowitem `item'. +   +  Call command_runsub in handler function for `cmd' and bind +  with command_bind("`cmd' `subcmd'", subcmdfunc[, category]); + +command_unbind(cmd, func) +  Unbind command `cmd' from function `func'. + +command_set_options(cmd, data) +  Set options for command `cmd' to `data'. `data' is a string of +  space separated words which specify the options. Each word can be +  optionally prefixed with one of the following character: + +  '-': optional argument +  '+': argument required +  '@': optional numeric argument + +command_parse_options(cmd, data) +  Parse options for command `cmd' in `data'. It returns a reference to +  an hash table with the options and a string with the remaining part +  of `data'. On error it returns the undefined value. + + + *** Windows + +UI::Window->{} +  refnum - Reference number +  name - Name + +  width - Width +  height - Height + +  history_name - Name of named historylist for this window + +  active - Active window item +  active_server - Active server + +  servertag - active_server must be either undef or have this same tag +              (unless there's items in this window). This is used by +	      /WINDOW SERVER -sticky +  level - Current window level + +  sticky_refnum - 1 if reference number is sticky + +  data_level - Current data level +  hilight_color - Current activity hilight color + +  last_timestamp - Last time timestamp was written in window +  last_line - Last time text was written in window + +  theme_name - Active theme in window, undef = default + +UI::TextDest->{} +  window - Window where the text will be written +  server - Target server +  target - Target channel/query/etc name +  level - Text level + +  hilight_priority - Priority for the hilighted text +  hilight_color - Color for the hilighted text + + +Window::items() +  Return a list of items in window. + +Window +window_create(automatic) +Windowitem::window_create(automatic) +  Create a new window. + +Window::destroy() +  Destroy the window. + +Irssi::Window +Windowitem::window() +  Returns parent window for window item. + +Window +window_find_name(name) +  Find window with name. + +Window +window_find_refnum(refnum) +  Find window with reference number. + +Window +window_find_level(level) +Server::window_find_level(level) +  Find window with level. + +Window +window_find_closest(name, level) +Server::window_find_closest(name, level) +  Find window that matches best to given arguments. `name' can be either +  window name or name of one of the window items. + +Window +window_find_item(name) +Server::window_find_item(name) +  Find window which contains window item with specified name/server. + +Windowitem +window_item_find(name) +Server::window_item_find(name) +Window::item_find(server, name) +  Find window item that matches best to given arguments. + +window_refnum_prev(refnum, wrap) +window_refnum_next(refnum, wrap) +  Return refnum for window that's previous/next in windows list. + +windows_refnum_last() +  Return refnum for last window. + +Window::item_add(item, automatic) +Window::item_remove(item) +Window::item_destroy(item) +  Add/remove/destroy window item + +Window::set_active() +  Set window active. + +Window::change_server(server) +Window::set_refnum(refnum) +Window::set_name(name) +Window::set_history(name) +Window::set_level(level) +  Change server/refnum/name/history/level in window. + +Windowitem::set_active() +  Change window item active in parent window. + +Window::item_prev() +Window::item_next() +  Change to previous/next window item. + +Windowitem::change_server(server) +  Change server in window item. + +Windowitem::is_active() +  Returns 1 if window item is the active item in parent window. + +Window::get_active_name() +  Return active item's name, or if none is active, window's name + + + *** Server Connects + +Connect->{} +  type - "SERVER CONNECT" text +  chat_type - String ID of chat protocol, for example "IRC" + +  address - Address where we connected (irc.blah.org) +  port - Port where we connected +  chatnet - Chat network + +  password - Password we used in connection. +  wanted_nick - Nick which we would prefer to use +  username - User name +  realname - Real name + +Connect +server_create_conn(address[, port=6667[, password=''[, nick=''[, channels='']]]]) +  Create new server connection. + + + *** Server functions + +Server->{} +  type - "SERVER" text +  chat_type - String ID of chat protocol, for example "IRC" + +  (..contains all the same data as Connect above..) + +  connect_time - Time when connect() to server finished +  real_connect_time - Time when server sent "connected" message + +  tag - Unique server tag +  nick - Current nick + +  connected - Is connection finished? 1|0 +  connection_lost - Did we lose the connection (1) or was +                    the connection just /DISCONNECTed (0) + +  rawlog - Rawlog object for the server + +  version - Server version +  last_invite - Last channel we were invited to +  server_operator - Are we server operator (IRC op) 1|0 +  usermode_away - Are we marked as away? 1|0 +  away_reason - Away reason message +  banned - Were we banned from this server? 1|0 +  lag - Current lag to server in milliseconds + +Server +Connect::connect() +  Connect to server. + +Server::disconnect() +  Disconnect from server. + +Server +server_find_tag(tag) +  Find server with tag + +Server +server_find_chatnet(chatnet) +  Find first server that is in `chatnet' + +Server::isnickflag(flag) +  Returns 1 if flag is a nick mode flag (@, + or % in IRC) + +Server::ischannel(data) +  Returns 1 if start of `data' seems to mean channel. + +Server::get_nick_flags() +  Returns nick flag characters in order: op, voice, halfop ("@+%" in IRC). + +Server::send_message(target, msg, target_type) +  Sends a message to nick/channel. target_type 0 = channel, 1 = nick + + + *** Server reconnections + +Reconnect->{} +  type - "RECONNECT" text +  chat_type - String ID of chat protocol, for example "IRC" + +  (..contains all the same data as Connect above..) + +  tag - Unique numeric tag +  next_connect - Unix time stamp when the next connection occurs + + + *** Chat networks + +Chatnet->{} +  type - "CHATNET" text +  chat_type - String ID of chat protocol, for example "IRC" + +  name - name of chat network + +  nick - if not empty, nick preferred in this network +  username - if not empty, username preferred in this network +  realname - if not empty, realname preferred in this network + +  own_host - address to use when connecting this network +  autosendcmd - command to send after connecting to this network + +chatnet_find(name) +  Find chat network with name. + + + *** Server redirections + +This is a powerful feature of Irssi that I haven't seen in other IRC +clients. You can EASILY grab the server's reply for a command you send +to server without any horrible kludges. + +redirect_register(command, remote, timeout, start, stop, opt) +   Register new redirection command. By default irssi has already +   registered at least: whois, whowas, who, list, ison, userhost, ping, +   "mode channel" (/MODE #channel), "mode b" (/MODE #channel b), "mode e" +   and "mode I". + +   `command' specifies the name of the command to register, it doesn't +   have to be a real command name, but something you just specify to +   redirect_event() when using this redirection. + +   `remote' specifies if the command is by default a remote command +   (eg. sent to another server). redirect_event() may override this. + +   `timeout' - If remote is TRUE, specifies how many seconds to wait for +   reply before aborting. + +   `start', `stop', `opt' - hash references with "event" => argpos entries. +   List of events that start and stop this redirection. +   Start event list may be empty, but there must be at least one +   stop event. Optional events are checked only if they are received +   immediately after one of the stop-events. `argpos' specifies the +   word number in event string which is compared to wanted argument, +   -1 = don't compare, TRUE always. + +  Example (already done by irssi): + +  Irssi::redirect_register('mode channel', 0, 0, +  	undef, # no start events +	{ # stop events +	  "event 324" => 1, # MODE-reply +	  "event 403" => 1, # no such channel +	  "event 442" => 1, # "you're not on that channel" +	  "event 479" => 1  # "Cannot join channel (illegal name)" +	}, { # optional events +	  "event 329", 1 # Channel create time +	} ); + +Server::redirect_event(command, count, arg, remote, failure_signal, signals) +   Specify that the next command sent to server will be redirected. +   NOTE: This command MUST be called before sending the command to server. + +   `command' - Name of the registered redirection that we're using. + +   `count' - How many times to execute the redirection. Some commands may +   send multiple stop events, like MODE #a,#b. + +   `arg' - The argument to be compared in event strings. You can give multiple +   arguments separated with space. + +   `remote' - Specifies if the command is a remote command, -1 = use default. + +   `failure_signal' - If irssi can't find the stop signal for the redirection, +   this signal is called. + +   `signals' - hash reference with "event" => "redir signal" entries. +   If the event is "", all the events belonging to the redirection but not +   specified here, will be sent there. + +  Example: + +  # ignore all events generated by whois query, except 311. +  $server->redirect_event("whois", 1, "cras", 0, undef, { +			  "event 311" => "redir whois", +			  "" => "event empty" }); +  $server->send_raw("WHOIS :cras"); + + + *** Window items + +Windowitem->{} +  type - Type of the window item, for example "CHANNEL" or "QUERY" +  chat_type - String ID of chat protocol, for example "IRC" + +  server - Active server for item +  name - Name of the item + +  createtime - Time the window item was created +  data_level - 0=no new data, 1=text, 2=msg, 3=highlighted text +  hilight_color - Color of the last highlighted text + + + *** Channels + +Channel->{} +  type - "CHANNEL" text +  chat_type - String ID of chat protocol, for example "IRC" + +  (..contains all the same data as Windowitem above..) + +  topic - Channel topic +  topic_by - Nick who set the topic +  topic_time - Timestamp when the topic was set + +  no_modes - Channel is modeless +  mode - Channel mode +  limit - Max. users in channel (+l mode) +  key - Channel key (password) + +  chanop - You are channel operator +  names_got - /NAMES list has been received +  wholist - /WHO list has been received +  synced - Channel is fully synchronized + +  joined - JOIN event for this channel has been received +  left - You just left the channel (for "channel destroyed" event) +  kicked - You was just kicked out of the channel (for +           "channel destroyed" event) + +Server::channels_join(channels, automatic) +  Join to channels in server. `channels' may also contain keys for +  channels just like with /JOIN command. `automatic' specifies if this +  channel was joined "automatically" or if it was joined because join +  was requested by user. If channel join is "automatic", irssi doesn't +  jump to the window where the channel was joined. + + +Channel::destroy() +  Destroy channel. + +Channel +channel_find(channel) +  Find channel from any server. + +Channel +Server::channel_find(channel) +  Find channel from specified server. + + + *** Nick list + +Nick->{} +  type - "NICK" text +  chat_type - String ID of chat protocol, for example "IRC" + +  nick - Plain nick +  host - Host address +  realname - Real name +  hops - Hop count to the server the nick is using + +  gone, serverop - User status, 1 or 0 +  op, voice, halfop - Channel status, 1 or 0 + +  last_check - timestamp when last checked gone/ircop status. +  send_massjoin - Waiting to be sent in a "massjoin" signal, 1 or 0 + +Nick +Channel::nick_insert(nick, op, voice, send_massjoin) +  Add nick to nicklist. + +Channel::nick_remove(nick) +  Remove nick from nicklist. + +Nick +Channel::nick_find(nick) +  Find nick from nicklist. + +Nick +Channel::nick_find_mask(mask) +  Find nick mask from nicklist, wildcards allowed. + +Channel::nicks() +  Return a list of all nicks in channel. + +Server::nicks_get_same(nick) +  Return all nick objects in all channels in server. List is in format: +  Channel, Nick, Channel, ... + + + *** Queries + +Query->{} +  type - "QUERY" text +  chat_type - String ID of chat protocol, for example "IRC" + +  (..contains all the same data as Windowitem above..) + +  address - Host address of the queries nick +  server_tag - Server tag used for this nick (doesn't get erased if +               server gets disconnected) +  unwanted - 1 if the other side closed or some error occured (DCC chats) + +Query +query_create(chat_type, server_tag, nick, automatic) +  Create a new query. + +Query::destroy() +  Destroy the query. + +Query::query_change_server(server) +  Change the active server of the query. + +Query +query_find(nick) +  Find query from any server. + +Query +Server::query_find(nick) +  Find query from specified server. + + + *** Masks + +You should use the Server version of the function if possible, since +with different chat protocols the mask matching could be different. + +mask_match(mask, nick, user, host) +Server::mask_match(mask, nick, user, host) +  Return 1 if `mask' matches nick!user@host. + +mask_match_address(mask, nick, address) +Server::mask_match_address(mask, nick, address) +  Return 1 if `mask' matches nick!address. + +masks_match(masks, nick, address) +Server::masks_match(masks, nick, address) +  Return 1 if any mask in the `masks' (string separated with spaces) +  matches nick!address. + + + *** Rawlog + +Rawlog->{} +  logging - The rawlog is being written to file currently +  nlines - Number of lines in rawlog + +Rawlog +rawlog_create() +  Create a new rawlog. + +Rawlog::destroy() +  Destroy the rawlog. + +Rawlog::get_lines() +  Returns all lines in rawlog. + +rawlog_set_size(lines) +  Set the default rawlog size for new rawlogs. + +Rawlog::open(filename) +  Start logging new messages in rawlog to specified file. + +Rawlog::close() +  Stop logging to file. + +Rawlog::save(filename) +  Save the current rawlog history to specified file. + +Rawlog::input(str) +  Send `str' to raw log as input text. + +Rawlog::output(str) +  Send `str' to raw log as output text. + +Rawlog::redirect(str) +  Send `str' to raw log as redirection text. + + + *** Logging + +Log->{} +  fname - Log file name +  real_fname - The actual opened log file (after %d.%m.Y etc. are expanded) +  opened - Log file is open +  level - Log only these levels +  last - Timestamp when last message was written +  autoopen - Automatically open log at startup +  failed - Opening log failed last time +  temp - Log isn't saved to config file +  items - List of log items + +Logitem->{} +  type - 0=target, 1=window refnum +  name - Name +  servertag - Server tag + +Log +log_create_rec(fname, level) +  Create log file. + +Log::update() +  Add log to list of logs / save changes to config file. + +Log +log_find(fname) +  Find log with file name. + +Log::close() +  Destroy log file. + +Log::start_logging() +  Open log file and start logging. + +Log::stop_logging() +  Close log file. + +Log::item_add(type, name, server) +  Add log item to log. + +Log::item_destroy(item) +  Remove log item from log. + +Logitem +Log::item_find(type, item, server) +  Find item from log. + + + *** Ignores + +Ignore->{} +  mask - Ignore mask +  servertag - Ignore only in server +  channels - Ignore only in channels (list of names) +  pattern - Ignore text pattern + +  level - Ignore level + +  exception - This is an exception ignore +  regexp - Regexp pattern matching +  fullword - Pattern matches only full words + +ignore_add_rec(ignore) +  Add ignore record. + +ignore_update_rec(ignore) +  Update ignore record in configuration + +ignore_check(nick, host, channel, text, level) +Server::ignore_check(nick, host, channel, text, level) +  Return 1 if ignoring matched. + + + *** /EXEC processes + +Process->{} +  id - ID for the process +  name - Name for the process (if given) +  args - The command that is being executed + +  pid - PID for the executed command +  target - send text with /msg <target> ... +  target_win - print text to this window + +  shell - start the program via /bin/sh +  notice - send text with /notice, not /msg if target is set +  silent - don't print "process exited with level xx" + + + *** + *** IRC specific functions. All objects below this are prefixed with Irc:: + *** + + *** IRC servers + +Irc::Server->{} +  (..contains all the same data as core Server object..) +  real_address - Address the IRC server gives +  usermode - User mode in server +  userhost - Your user host in server + +Irc::Connect->{} +  (..contains all the same data as core Connect object..) +  alternate_nick - Alternate nick to use if default nick is taken. + +Connect::connect() +  Connect to IRC server. + +Server::get_channels(server) +  Return a string of all channels (and keys, if any have them) in server, +  like "#a,#b,#c,#d x,b_chan_key,x,x" or just "#e,#f,#g" + +Server::send_raw(cmd) +  Send raw message to server, it will be flood protected so you +  don't need to worry about it. + +Server::send_raw_now(cmd) +  Send raw message to server immediately without flood protection. + +Server::send_raw_split(cmd, nickarg, max_nicks) +  Split the `cmd' into several commands so `nickarg' argument has only +  `max_nicks' number of nicks. + +  Example: +    $server->send_raw_split("KICK #channel nick1,nick2,nick3 :byebye", 3, 2); + +  Irssi will send commands "KICK #channel nick1,nick2 :byebye" and +  "KICK #channel nick3 :byebye" to server. + +Server::ctcp_send_reply(data) +  Send CTCP reply. This will be "CTCP flood protected" so if there's too +  many CTCP requests in buffer, this reply might not get sent. The data +  is the full raw command to be sent to server, like +    "NOTICE nick :\001VERSION irssi\001" + +Server::isupport(name) +  Returns the value of the named item in the ISUPPORT (005) numeric to the +  script. If the item is not present returns undef, if the item has no value +  then "" is returned use defined $server->isupport("name") if you need to +  check whether a property is present. +  See http://tools.ietf.org/id/draft-brocklesby-irc-isupport-03.txt +  for more information on the ISUPPORT numeric. + + *** IRC channels + +Ban->{} +  ban - The ban +  setby - Nick of who set the ban +  time - Timestamp when ban was set + +Channel::bans() +  Return a list of bans in channel. + +Channel::ban_get_mask(nick) +  Get ban mask for `nick'. + +Channel::banlist_add(ban, nick, time) +   Add a new ban to channel. + +Channel::banlist_remove(ban) +   Remove a ban from channel. + + + *** DCC + +Dcc->{} +  type - Type of the DCC: chat, send, get +  orig_type - Original DCC type that was sent to us - same as type except +              GET and SEND are swapped +  created - Time stamp when the DCC record was created + +  server - Server record where the DCC was initiated. +  servertag - Tag of the server where the DCC was initiated. +  mynick - Our nick to use in DCC chat. +  nick - Other side's nick name. + +  chat - Dcc chat record if the request came through DCC chat +  target - Who the request was sent to - your nick, channel or empty +           if you sent the request +  arg - Given argument .. file name usually + +  addr - Other side's IP address. +  port - Port we're connecting in. + +  starttime - Unix time stamp when the DCC transfer was started +  transfd - Bytes transferred + +Dcc::Chat->{} +  id - Unique identifier - usually same as nick +  mirc_ctcp - Send CTCPs without the CTCP_MESSAGE prefix +  connection_lost - Other side closed connection + +Dcc::Get->{} +  (..contains all the same data as core Dcc object..) +  size - File size +  skipped - Bytes skipped from start (resuming file) + +  get_type - What to do if file exists? 0=default, 1=rename, 2=overwrite, +             3=resume +  file - The real file name which we use. +  file_quoted - 1 if file name was received quoted ("file name") + +Dcc::Send->{} +  (..contains all the same data as core Dcc object..) +  size - File size +  skipped - Bytes skipped from start (resuming file) + +  file_quoted - 1 if file name was received quoted ("file name") +  waitforend - File is sent, just wait for the replies from the other side +  gotalldata - Got all acks from the other end + + +dccs() - return list of all dcc connections + +Dcc::destroy() +  Destroy DCC connection. + +Dcc +dcc_find_item(type, nick, arg) +  Find DCC connection. + +Dcc +dcc_find_by_port(nick, port) +  Find DCC connection by port. + +Dcc +Windowitem::get_dcc(item) +  If `item' is a query of a =nick, return DCC chat record of nick. + +Dcc::chat_send(data) +  Send `data' to dcc chat. + +Server::dcc_ctcp_message(target, notice, msg) +Dcc::ctcp_message(target, notice, msg) +  Send a CTCP message/notify to target. + + + *** Netsplits + +Netsplit->{} +  nick - Nick +  address - Nick's host +  destroy - Timestamp when this record should be destroyed +  server - Netsplitserver object +  channels - list of channels (Netsplitchannel objects) the nick was in + +Netsplitserver->{} +  server - The server nick was in +  destserver - The other server where split occured. +  count - Number of splits in server + +Netsplitchannel->{} +  name - Channel name +  nick - Nick object + +Netsplit +Server::netsplit_find(nick, address) +  Check if nick!address is on the other side of netsplit. Netsplit records +  are automatically removed after 30 minutes (current default).. + +Nick +Server::netsplit_find_channel(nick, address, channel) +  Find nick record for nick!address in channel `channel'. + + + *** Notify list + +Notifylist->{} +  mask - Notify nick mask +  away_check - Notify away status changes +  idle_check_time - Notify when idle time is reset and idle was bigger +                    than this (seconds) +  ircnets - List of ircnets (strings) the notify is checked + +notifies() - Return list of all notifies + +Notifylist +notifylist_add(mask, ircnets, away_check, idle_check_time) +  Add new item to notify list. + +notifylist_remove(mask) +  Remove item from notify list. + +Notifylist +notifylist_find(mask, ircnet) +  Find notify. + +Server +notifylist_ison(nick, serverlist) +  Check if `nick' is in IRC. `serverlist' is a space separated +  list of server tags. If it's empty string, all servers will be checked. + +Server::notifylist_ison_server(nick) +  Check if `nick' is on IRC server. + +Notifylist::ircnets_match(ircnet) +  Returns 1 if notify is checked in `ircnet'. + + *** Proxy clients + +Client->{} +  nick - nick of the client +  host - host of the client +  proxy_address - address of the proxy server +  server - Irc::Server for which we proxy to this client +  pass_sent - whether the client already send a PASS command +  user_sent - whether the client already send a USER command +  connected - whether the client is connected and ready +  want_ctcp - whether the client wants to receive CTCPs +  ircnet - network tag of the network we proxy + +  +All the content of this site is copyright © 2000-2010 The Irssi project. diff --git a/docs/signals.txt b/docs/signals.txt new file mode 100644 index 0000000..a9b07ec --- /dev/null +++ b/docs/signals.txt @@ -0,0 +1,335 @@ +core +---- + +* Requires to work properly: + + "gui exit" + "gui dialog", char *type, char *text + "send command", char *command, SERVER_REC, WI_ITEM_REC + +* Provides signals: + +chat-protocols.c: + "chat protocol created", CHAT_PROTOCOL_REC + "chat protocol updated", CHAT_PROTOCOL_REC + "chat protocol destroyed", CHAT_PROTOCOL_REC + +channels.c: + "channel created", CHANNEL_REC, int automatic + "channel destroyed", CHANNEL_REC + +chatnets.c: + "chatnet created", CHATNET_REC + "chatnet destroyed", CHATNET_REC + +commands.c: + "commandlist new", COMMAND_REC + "commandlist remove", COMMAND_REC + "error command", int err, char *cmd + + "send command", char *args, SERVER_REC, WI_ITEM_REC + "send text", char *line, SERVER_REC, WI_ITEM_REC + "command "<cmd>, char *args, SERVER_REC, WI_ITEM_REC + "default command", char *args, SERVER_REC, WI_ITEM_REC + +ignore.c: + "ignore created", IGNORE_REC + "ignore destroyed", IGNORE_REC + "ignore changed", IGNORE_REC + +log.c: + "log new", LOG_REC + "log remove", LOG_REC + "log create failed", LOG_REC + "log locked", LOG_REC + "log started", LOG_REC + "log stopped", LOG_REC + "log rotated", LOG_REC + "log written", LOG_REC, char *line + +modules.c: + "module loaded", MODULE_REC, MODULE_FILE_REC + "module unloaded", MODULE_REC, MODULE_FILE_REC + "module error", int error, char *text, char *rootmodule, char *submodule + +nicklist.c: + "nicklist new", CHANNEL_REC, NICK_REC + "nicklist remove", CHANNEL_REC, NICK_REC + "nicklist changed", CHANNEL_REC, NICK_REC, char *old_nick + "nicklist host changed", CHANNEL_REC, NICK_REC + "nicklist gone changed", CHANNEL_REC, NICK_REC + "nicklist serverop changed", CHANNEL_REC, NICK_REC + +pidwait.c: + "pidwait", int pid, int status + +queries.c: + "query created", QUERY_REC, int automatic + "query destroyed", QUERY_REC + "query nick changed", QUERY_REC, char *orignick + "window item name changed", WI_ITEM_REC + "query address changed", QUERY_REC + "query server changed", QUERY_REC, SERVER_REC + +rawlog.c: + "rawlog", RAWLOG_REC, char *data + +server.c: + "server looking", SERVER_REC + "server connected", SERVER_REC + "server connecting", SERVER_REC, ulong *ip + "server connect failed", SERVER_REC + "server disconnected", SERVER_REC + "server quit", SERVER_REC, char *msg + "server sendmsg", SERVER_REC, char *target, char *msg, int target_type + +settings.c: + "setup changed" + "setup reread", char *fname + "setup saved", char *fname, int autosaved + + +IRC core +-------- + +* Provides signals: + +bans.c: + "ban type changed", char *bantype + +channels, nicklist: + "channel joined", CHANNEL_REC + "channel wholist", CHANNEL_REC + "channel sync", CHANNEL_REC + + "channel topic changed", CHANNEL_REC + +ctcp.c: + + "ctcp msg", SERVER_REC, char *args, char *nick, char *addr, char *target + "ctcp msg "<cmd>, SERVER_REC, char *args, char *nick, char *addr, char *target + "default ctcp msg", SERVER_REC, char *args, char *nick, char *addr, char *target + "ctcp reply", SERVER_REC, char *args, char *nick, char *addr, char *target + "ctcp reply "<cmd>, SERVER_REC, char *args, char *nick, char *addr, char *target + "default ctcp reply", SERVER_REC, char *args, char *nick, char *addr, char *target + "ctcp action", SERVER_REC, char *args, char *nick, char *addr, char *target + +irc-log.c: + "awaylog show", LOG_REC, int away_msgs, int filepos + +irc-nicklist.c: + "server nick changed", SERVER_REC + +irc-servers.c: + "event connected", SERVER_REC + +irc.c: + + "server event", SERVER_REC, char *data, char *sender_nick, char *sender_address + "event "<cmd>, SERVER_REC, char *args, char *sender_nick, char *sender_address + "default event", SERVER_REC, char *data, char *sender_nick, char *sender_address + "whois default event", SERVER_REC, char *args, char *sender_nick, char *sender_address + + "server incoming", SERVER_REC, char *data + +(for perl parser..) + "redir "<cmd>, SERVER_REC, char *args, char *sender_nick, char *sender_address + +lag.c: + "server lag", SERVER_REC + "server lag disconnect", SERVER_REC + +massjoin.c: + "massjoin", CHANNEL_REC, GSList of NICK_RECs + +mode-lists.c: + "ban new", CHANNEL_REC, BAN_REC + "ban remove", CHANNEL_REC, BAN_REC, char *setby + +modes.c: + "channel mode changed", CHANNEL_REC, char *setby + "nick mode changed", CHANNEL_REC, NICK_REC, char *setby, char *mode, char *type + "user mode changed", SERVER_REC, char *old + "away mode changed", SERVER_REC + +netsplit.c: + "netsplit server new", SERVER_REC, NETSPLIT_SERVER_REC + "netsplit server remove", SERVER_REC, NETSPLIT_SERVER_REC + "netsplit new", NETSPLIT_REC + "netsplit remove", NETSPLIT_REC + +IRC modules +----------- + +* Provides signals: + +dcc*.c: + + "dcc ctcp "<cmd>, char *args, DCC_REC + "default dcc ctcp", char *args, DCC_REC + "dcc unknown ctcp", char *args, char *sender, char *sendaddr + + "dcc reply "<cmd>, char *args, DCC_REC + "default dcc reply", char *args, DCC_REC + "dcc unknown reply", char *args, char *sender, char *sendaddr + + "dcc chat message", DCC_REC, char *msg + + "dcc created", DCC_REC + "dcc destroyed", DCC_REC + "dcc connected", DCC_REC + "dcc rejecting", DCC_REC + "dcc closed", DCC_REC + "dcc request", DCC_REC, char *sendaddr + "dcc request send", DCC_REC + "dcc chat message", DCC_REC, char *msg + "dcc transfer update", DCC_REC + "dcc get receive", DCC_REC + "dcc error connect", DCC_REC + "dcc error file create", DCC_REC, char *filename + "dcc error file open", char *nick, char *filename, int errno + "dcc error get not found", char *nick + "dcc error send exists", char *nick, char *filename + "dcc error unknown type", char *type + "dcc error close not found", char *type, char *nick, char *filename + +autoignore.c: + + "autoignore new", SERVER_REC, AUTOIGNORE_REC + "autoignore remove", SERVER_REC, AUTOIGNORE_REC + +flood.c: + + "flood", SERVER_REC, char *nick, char *host, int level, char *target + +notifylist.c: + + "notifylist new", NOTIFYLIST_REC + "notifylist remove", NOTIFYLIST_REC + "notifylist joined", SERVER_REC, char *nick, char *user, char *host, char *realname, char *awaymsg + "notifylist away changed", SERVER_REC, char *nick, char *user, char *host, char *realname, char *awaymsg + "notifylist left", SERVER_REC, char *nick, char *user, char *host, char *realname, char *awaymsg + +proxy/listen.c: + + "proxy client connected", CLIENT_REC + "proxy client disconnected", CLIENT_REC + "proxy client command", CLIENT_REC, char *args, char *data + "proxy client dump", CLIENT_REC, char *data + +FE common +--------- + +* Requires to work properly: + + "gui print text", WINDOW_REC, int fg, int bg, int flags, char *text, TEXT_DEST_REC + +(Can be used to determine when all "gui print text"s are sent (not required)) + "gui print text finished", WINDOW_REC + +* Provides signals: + +completion.c: + "complete word", GList * of char*, WINDOW_REC, char *word, char *linestart, int *want_space + +fe-common-core.c: + "irssi init read settings" + +fe-exec.c: + "exec new", PROCESS_REC + "exec remove", PROCESS_REC, int status + "exec input", PROCESS_REC, char *text + +fe-messages.c: + "message public", SERVER_REC, char *msg, char *nick, char *address, char *target + "message private", SERVER_REC, char *msg, char *nick, char *address + "message own_public", SERVER_REC, char *msg, char *target + "message own_private", SERVER_REC, char *msg, char *target, char *orig_target + "message join", SERVER_REC, char *channel, char *nick, char *address + "message part", SERVER_REC, char *channel, char *nick, char *address, char *reason + "message quit", SERVER_REC, char *nick, char *address, char *reason + "message kick", SERVER_REC, char *channel, char *nick, char *kicker, char *address, char *reason + "message nick", SERVER_REC, char *newnick, char *oldnick, char *address + "message own_nick", SERVER_REC, char *newnick, char *oldnick, char *address + "message invite", SERVER_REC, char *channel, char *nick, char *address + "message topic", SERVER_REC, char *channel, char *topic, char *nick, char *address + +keyboard.c: + "keyinfo created", KEYINFO_REC + "keyinfo destroyed", KEYINFO_REC + +printtext.c: + "print text", TEXT_DEST_REC *dest, char *text, char *stripped + +themes.c: + "theme created", THEME_REC + "theme destroyed", THEME_REC + +window-activity.c: + "window hilight", WINDOW_REC + "window dehilight", WINDOW_REC + "window activity", WINDOW_REC, int old_level + "window item hilight", WI_ITEM_REC + "window item activity", WI_ITEM_REC, int old_level + +window-items.c: + "window item new", WINDOW_REC, WI_ITEM_REC + "window item remove", WINDOW_REC, WI_ITEM_REC + "window item moved", WINDOW_REC, WI_ITEM_REC, WINDOW_REC + "window item changed", WINDOW_REC, WI_ITEM_REC + "window item server changed", WINDOW_REC, WI_ITEM_REC + +windows.c: + "window created", WINDOW_REC + "window destroyed", WINDOW_REC + "window changed", WINDOW_REC, WINDOW_REC old + "window changed automatic", WINDOW_REC + "window server changed", WINDOW_REC, SERVER_REC + "window refnum changed", WINDOW_REC, int old + "window name changed", WINDOW_REC + "window history changed", WINDOW_REC, char *oldname + "window level changed", WINDOW_REC + +FE IRC +------ + +fe-events.c: + "default event numeric", SERVER_REC, char *data, char *nick, char *address + +fe-irc-messages.c: + "message irc op_public", SERVER_REC, char *msg, char *nick, char *address, char *target + "message irc own_wall", SERVER_REC, char *msg, char *target + "message irc own_action", SERVER_REC, char *msg, char *target + "message irc action", SERVER_REC, char *msg, char *nick, char *address, char *target + "message irc own_notice", SERVER_REC, char *msg, char *target + "message irc notice", SERVER_REC, char *msg, char *nick, char *address, char *target + "message irc own_ctcp", SERVER_REC, char *cmd, char *data, char *target + "message irc ctcp", SERVER_REC, char *cmd, char *data, char *nick, char *address, char *target + +fe-modes.c: + "message irc mode", SERVER_REC, char *channel, char *nick, char *addr, char *mode + +dcc/fe-dcc-chat-messages.c: + "message dcc own", DCC_REC *dcc, char *msg + "message dcc own_action", DCC_REC *dcc, char *msg + "message dcc own_ctcp", DCC_REC *dcc, char *cmd, char *data + "message dcc", DCC_REC *dcc, char *msg + "message dcc action", DCC_REC *dcc, char *msg + "message dcc ctcp", DCC_REC *dcc, char *cmd, char *data + +Text FE +------- + +gui-readline.c: + "gui key pressed", int key + +gui-printtext.c: + "beep" + +Perl +---- + +"script error", PERL_SCRIPT_REC, char *errormsg + +  +All the content of this site is copyright © 2000-2010 The Irssi project. diff --git a/history-search/history_search.pl b/history-search/history_search.pl new file mode 100644 index 0000000..d54e264 --- /dev/null +++ b/history-search/history_search.pl @@ -0,0 +1,194 @@ +# Search within your typed history as you type (like ctrl-R in bash) +# Usage: +# * First do: /bind ^R /history_search +# * Then type ctrl-R and type what you're searching for + +# Copyright 2007  Wouter Coekaerts <coekie@irssi.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA + +use strict; +use Irssi; +use Irssi::TextUI; +use Data::Dumper; + +use vars qw($VERSION %IRSSI); +$VERSION = '1.0'; +%IRSSI = ( +    authors     => 'Wouter Coekaerts', +    contact     => 'coekie@irssi.org', +    name        => 'history_search', +    description => 'Search within your typed history as you type (like ctrl-R in bash)', +    license     => 'GPLv2 or later', +    url         => 'http://wouter.coekaerts.be/irssi/', +    changed     => '04/08/07' +); + +my $prompt_append  = 1; +my $prompt_content = ''; + +# create a new statusbar item + +Irssi::statusbar_item_register ( 'custom_prompt', 0, 'custom_prompt' ); + +Irssi::signal_add_last 'gui print text finished' => sub { +    Irssi::statusbar_items_redraw ( 'custom_prompt' ); +}; + +Irssi::signal_register({'change prompt' => [qw/string int/]}); +Irssi::signal_add('change prompt' => \&handle_change_prompt_sig); + +sub handle_change_prompt_sig { +    my ($text, $append) = @_; +    print "sig args: ", Dumper(\@_); +    $prompt_content = $text; +    $prompt_append = $append; +    print "text: $prompt_content, append: $prompt_append"; + +    Irssi::statusbar_items_redraw('custom_prompt'); +} + +# TODO: make these work wiht subcommand (runsub) + +Irssi::command_bind('set_prompt' => \&dothing ); +Irssi::command_set_options('set_prompt', '+string @append'); + +Irssi::command_bind('install_prompt' => \&install_prompt); +Irssi::command_bind('uninstall_prompt' => \&uninstall_prompt); + +Irssi::settings_add_bool('custom_prompt', 'autoinstall_custom_prompt', 0); + +if (Irssi::settings_get_bool('autoinstall_custom_prompt')) { +    install_prompt(); +} + +sub install_prompt { +    Irssi::command("/statusbar prompt add -priority '-5' -alignment left" +                   . " -before prompt custom_prompt"); +    Irssi::command("/statusbar prompt remove prompt"); +    Irssi::command("/statusbar prompt remove prompt_empty"); +} + +sub uninstall_prompt { +    Irssi::command("/statusbar prompt remove custom_prompt"); +    Irssi::command("/statusbar prompt add -priority '-1' " +                   . "-before input -alignment left prompt"); +    Irssi::command("/statusbar prompt add -priority '-2' " +                   . "-before input -alignment left prompt_empty"); +} + +sub dothing { +    #my ($str, $append) = @_; +    #Irssi::print("str is $str, append=$append"); +    my $parsed = [Irssi::command_parse_options('set_prompt', $_[0])]; +    my $args = $parsed->[0] // {}; +    my $remainder = $parsed->[1] // ''; + +    my ($str, $append) = ('', 1); +    print Dumper $args; +    if (exists ($args->{string})) { +        $str = $args->{string}; +    } + +    if (exists($args->{append})) { +        $append = $args->{append}; +    } +    print "append in dothing: $append"; +    Irssi::signal_emit('change prompt', $str, $append); +} + +sub custom_prompt { +    my ($sb_item, $get_size_only) = @_; + +    my ($width, $padChar, $padNum, $length); + +    #my $prompt_str = '%K[%W$tag%c/%K$cumode%n$*%K]%n '; + +    my $theme = Irssi::current_theme; +    my $prompt = ''; + +    my $var = ''; +    if (window_is_empty(Irssi::active_win)) { +        $var = 'winname'; +    } else { +        $var = '[.15]itemname'; +    } + +    if ($prompt_append) { +        $prompt = $theme->format_expand("{prompt \$$var}"); +    } + +    my $trailing_space = ''; +    if ($prompt =~ /(\s*)$/ && length $prompt_content) { +        $trailing_space = $1; +    } + +    $prompt .= $prompt_content . $trailing_space; +    $sb_item->default_handler($get_size_only, $prompt, undef, 1); +} + +sub window_is_empty { +    my $window = shift; +    return $window->{name} eq $window->get_active_name; +} + +sub UNLOAD { +    print Dumper(\@_); +    uninstall_prompt(); +} +# my $prev_typed; +# my $prev_startpos; +# my $enabled = 0; + +# Irssi::command_bind('history_search', sub { +# 	$enabled = ! $enabled; +# 	if ($enabled) { +# 		$prev_typed = ''; +# 		$prev_startpos = 0; +# 	} +# }); + +# Irssi::signal_add_last 'gui key pressed' => sub { +# 	my ($key) = @_; +	 +# 	if ($key == 10) { # enter +# 		$enabled = 0; +# 	} + +# 	return unless $enabled; +	 +# 	my $prompt = Irssi::parse_special('$L'); +# 	my $pos = Irssi::gui_input_get_pos(); +	 +# 	if ($pos < $prev_startpos) { +# 		$enabled = 0; +# 		return; +# 	} +	 +# 	my $typed = substr($prompt, $prev_startpos, ($pos-$prev_startpos)); +	 +# 	my $history = ($typed eq '') ? '' : Irssi::parse_special('$!' . $typed . '!'); +# 	if ($history eq '') { +# 		$history = $typed; +# 	} +	 +# 	my $startpos = index(lc($history), lc($typed)); +		 +# 	Irssi::gui_input_set($history); +# 	Irssi::gui_input_set_pos($startpos + length($typed)); +	 +# 	$prev_typed = $typed; +# 	$prev_startpos = $startpos; +# }; diff --git a/history-search/irssi/config b/history-search/irssi/config new file mode 100644 index 0000000..052c67c --- /dev/null +++ b/history-search/irssi/config @@ -0,0 +1,266 @@ +servers = ( +  { address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; }, +  {  +    address = "irc.open-ircnet.net"; +    chatnet = "IRCnet"; +    port = "6667"; +  }, +  { address = "irc.efnet.org"; chatnet = "EFNet"; port = "6667"; }, +  {  +    address = "irc.undernet.org"; +    chatnet = "Undernet"; +    port = "6667"; +  }, +  { address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; }, +  {  +    address = "irc.quakenet.org"; +    chatnet = "QuakeNet"; +    port = "6667"; +  }, +  { address = "irc.oftc.net"; chatnet = "OFTC"; port = "6667"; }, +  { +    address = "irc.gamesurge.net"; +    chatnet = "GameSurge"; +    port = "6667"; +  }, +  { address = "irc.webchat.org"; chatnet = "WebChat"; port = "6667"; }, +  { address = "irc.rizon.net"; chatnet = "Rizon"; port = "6667"; }, +  { address = "irc.link-net.org"; chatnet = "LinkNet"; port = "6667"; }, +  { address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; } +); + +chatnets = { +  IRCnet = { +    type = "IRC"; +    max_kicks = "4"; +    max_msgs = "5"; +    max_whois = "4"; +    max_query_chans = "5"; +  }; +  EFNet = {  +    type = "IRC"; +    max_kicks = "4"; +    max_msgs = "3"; +    max_whois = "1"; +  }; +  Undernet = { +    type = "IRC"; +    max_kicks = "1"; +    max_msgs = "3"; +    max_whois = "30"; +  }; +  DALnet = { +    type = "IRC"; +    max_kicks = "4"; +    max_msgs = "3"; +    max_whois = "30"; +  }; +  QuakeNet = { +    type = "IRC"; +    max_kicks = "1"; +    max_msgs = "3"; +    max_whois = "30"; +  }; +  OFTC = {  +    type = "IRC"; +    max_kicks = "1"; +    max_msgs = "3"; +    max_whois = "30"; +  }; +  GameSurge = { +    type = "IRC"; +    max_kicks = "1"; +    max_msgs = "3"; +    max_whois = "30"; +  }; +  WebChat = { +    type = "IRC"; +    max_kicks = "1"; +    max_msgs = "3"; +    max_whois = "30"; +  }; +  Rizon = {  +    type = "IRC"; +    max_kicks = "1"; +    max_msgs = "3"; +    max_whois = "30"; +  }; +  LinkNet = { +    type = "IRC"; +    max_kicks = "1"; +    max_msgs = "3"; +    max_whois = "30"; +  }; +  SILC = { type = "SILC"; }; +}; + +channels = ( +  { name = "#irssi"; chatnet = "ircnet"; autojoin = "No"; }, +  { name = "silc"; chatnet = "silc"; autojoin = "No"; } +); + +aliases = { +  J = "join"; +  WJOIN = "join -window"; +  WQUERY = "query -window"; +  LEAVE = "part"; +  BYE = "quit"; +  EXIT = "quit"; +  SIGNOFF = "quit"; +  DESCRIBE = "action"; +  DATE = "time"; +  HOST = "userhost"; +  LAST = "lastlog"; +  SAY = "msg *"; +  WI = "whois"; +  WII = "whois $0 $0"; +  WW = "whowas"; +  W = "who"; +  N = "names"; +  M = "msg"; +  T = "topic"; +  C = "clear"; +  CL = "clear"; +  K = "kick"; +  KB = "kickban"; +  KN = "knockout"; +  BANS = "ban"; +  B = "ban"; +  MUB = "unban *"; +  UB = "unban"; +  IG = "ignore"; +  UNIG = "unignore"; +  SB = "scrollback"; +  UMODE = "mode $N"; +  WC = "window close"; +  WN = "window new hide"; +  SV = "say Irssi $J ($V) - http://irssi.org/"; +  GOTO = "sb goto"; +  CHAT = "dcc chat"; +  RUN = "SCRIPT LOAD"; +  CALC = "exec - if which bc &>/dev/null\\; then echo '$*' | bc | awk '{print \"$*=\"$$1}'\\; else echo bc was not found\\; fi"; +  SBAR = "STATUSBAR"; +  INVITELIST = "mode $C +I"; +  Q = "QUERY"; +  "MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save"; +  EXEMPTLIST = "mode $C +e"; +  ATAG = "WINDOW SERVER"; +  UNSET = "set -clear"; +  RESET = "set -default"; +  s = "script"; +  rltest = "/script unload history_search; /script load history_search.pl"; +}; + +statusbar = { +  # formats: +  # when using {templates}, the template is shown only if it's argument isn't +  # empty unless no argument is given. for example {sb} is printed always, +  # but {sb $T} is printed only if $T isn't empty. + +  items = { +    # start/end text in statusbars +    barstart = "{sbstart}"; +    barend = "{sbend}"; + +    topicbarstart = "{topicsbstart}"; +    topicbarend = "{topicsbend}"; + +    # treated "normally", you could change the time/user name to whatever +    time = "{sb $Z}"; +    user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}"; + +    # treated specially .. window is printed with non-empty windows, +    # window_empty is printed with empty windows +    window = "{sb $winref:$tag/$itemname{sbmode $M}}"; +    window_empty = "{sb $winref{sbservertag $tag}}"; +    prompt = "{prompt $[.15]itemname}"; +    prompt_empty = "{prompt $winname}"; +    topic = " $topic"; +    topic_empty = " Irssi v$J - http://www.irssi.org"; + +    # all of these treated specially, they're only displayed when needed +    lag = "{sb Lag: $0-}"; +    act = "{sb Act: $0-}"; +    more = "-- more --"; +  }; + +  # there's two type of statusbars. root statusbars are either at the top +  # of the screen or at the bottom of the screen. window statusbars are at +  # the top/bottom of each split window in screen. +  default = { +    # the "default statusbar" to be displayed at the bottom of the window. +    # contains all the normal items. +    window = { +      disabled = "no"; + +      # window, root +      type = "window"; +      # top, bottom +      placement = "bottom"; +      # number +      position = "1"; +      # active, inactive, always +      visible = "active"; + +      # list of items in statusbar in the display order +      items = { +        barstart = { priority = "100"; }; +        time = { }; +        user = { }; +        window = { }; +        window_empty = { }; +        lag = { priority = "-1"; }; +        act = { priority = "10"; }; +        more = { priority = "-1"; alignment = "right"; }; +        barend = { priority = "100"; alignment = "right"; }; +      }; +    }; + +    # statusbar to use in inactive split windows +    window_inact = { +      type = "window"; +      placement = "bottom"; +      position = "1"; +      visible = "inactive"; +      items = { +        barstart = { priority = "100"; }; +        window = { }; +        window_empty = { }; +        more = { priority = "-1"; alignment = "right"; }; +        barend = { priority = "100"; alignment = "right"; }; +      }; +    }; + +    # we treat input line as yet another statusbar :) It's possible to +    # add other items before or after the input line item. + +    # topicbar +    topic = { +      type = "root"; +      placement = "top"; +      position = "1"; +      visible = "always"; +      items = { +        topicbarstart = { priority = "100"; }; +        topic = { }; +        topic_empty = { }; +        topicbarend = { priority = "100"; alignment = "right"; }; +      }; +    }; +    prompt = { +      items = { +        custom_prompt = { priority = "-5"; }; +        input = { priority = "10"; }; +      }; +    }; +  }; +}; +settings = { +  core = { +    real_name = "shabble"; +    user_name = "tomfeist"; +    nick = "tomfeist"; +  }; +  "fe-text" = { actlist_sort = "refnum"; }; +  "perl/core/scripts" = { autoinstall_custom_prompt = "yes"; }; +}; diff --git a/history-search/irssi/default.theme b/history-search/irssi/default.theme new file mode 100644 index 0000000..98af18b --- /dev/null +++ b/history-search/irssi/default.theme @@ -0,0 +1,294 @@ +# When testing changes, the easiest way to reload the theme is with /RELOAD. +# This reloads the configuration file too, so if you did any changes remember +# to /SAVE it first. Remember also that /SAVE overwrites the theme file with +# old data so keep backups :) + +# TEMPLATES: + +# The real text formats that irssi uses are the ones you can find with +# /FORMAT command. Back in the old days all the colors and texts were mixed +# up in those formats, and it was really hard to change the colors since you +# might have had to change them in tens of different places. So, then came +# this templating system. + +# Now the /FORMATs don't have any colors in them, and they also have very +# little other styling. Most of the stuff you need to change is in this +# theme file. If you can't change something here, you can always go back +# to change the /FORMATs directly, they're also saved in these .theme files. + +# So .. the templates. They're those {blahblah} parts you see all over the +# /FORMATs and here. Their usage is simply {name parameter1 parameter2}. +# When irssi sees this kind of text, it goes to find "name" from abstracts +# block below and sets "parameter1" into $0 and "parameter2" into $1 (you +# can have more parameters of course). Templates can have subtemplates. +# Here's a small example: +#   /FORMAT format hello {colorify {underline world}} +#   abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; } +# When irssi expands the templates in "format", the final string would be: +#   hello %G%Uworld%U%n +# ie. underlined bright green "world" text. +# and why "$0-", why not "$0"? $0 would only mean the first parameter, +# $0- means all the parameters. With {underline hello world} you'd really +# want to underline both of the words, not just the hello (and world would +# actually be removed entirely). + +# COLORS: + +# You can find definitions for the color format codes in docs/formats.txt. + +# There's one difference here though. %n format. Normally it means the +# default color of the terminal (white mostly), but here it means the +# "reset color back to the one it was in higher template". For example +# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would +# print yellow "foo" (as set with %Y) but "bar" would be green, which was +# set at the beginning before the {foo} template. If there wasn't the %g +# at start, the normal behaviour of %n would occur. If you _really_ want +# to use the terminal's default color, use %N. + +############################################################################# + +# default foreground color (%N) - -1 is the "default terminal color" +default_color = "-1"; + +# print timestamp/servertag at the end of line, not at beginning +info_eol = "false"; + +# these characters are automatically replaced with specified color +# (dark grey by default) +replaces = { "[]=" = "%K$*%n"; }; + +abstracts = { +  ## +  ## generic +  ## + +  # text to insert at the beginning of each non-message line +  line_start = "%B-%W!%B-%n "; + +  # timestamp styling, nothing by default +  timestamp = "$*"; + +  # any kind of text that needs hilighting, default is to bold +  hilight = "%_$*%_"; + +  # any kind of error message, default is bright red +  error = "%R$*%n"; + +  # channel name is printed +  channel = "%_$*%_"; + +  # nick is printed +  nick = "%_$*%_"; + +  # nick host is printed +  nickhost = "[$*]"; + +  # server name is printed +  server = "%_$*%_"; + +  # some kind of comment is printed +  comment = "[$*]"; + +  # reason for something is printed (part, quit, kick, ..) +  reason = "{comment $*}"; + +  # mode change is printed ([+o nick]) +  mode = "{comment $*}"; + +  ## +  ## channel specific messages +  ## + +  # highlighted nick/host is printed (joins) +  channick_hilight = "%C$*%n"; +  chanhost_hilight = "{nickhost %c$*%n}"; + +  # nick/host is printed (parts, quits, etc.) +  channick = "%c$*%n"; +  chanhost = "{nickhost $*}"; + +  # highlighted channel name is printed +  channelhilight = "%c$*%n"; + +  # ban/ban exception/invite list mask is printed +  ban = "%c$*%n"; + +  ## +  ## messages +  ## + +  # the basic styling of how to print message, $0 = nick mode, $1 = nick +  msgnick = "%K<%n$0$1-%K>%n %|"; + +  # message from you is printed. "msgownnick" specifies the styling of the +  # nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the +  # whole line. + +  # Example1: You want the message text to be green: +  #  ownmsgnick = "{msgnick $0 $1-}%g"; +  # Example2.1: You want < and > chars to be yellow: +  #  ownmsgnick = "%Y{msgnick $0 $1-%Y}%n"; +  #  (you'll also have to remove <> from replaces list above) +  # Example2.2: But you still want to keep <> grey for other messages: +  #  pubmsgnick = "%K{msgnick $0 $1-%K}%n"; +  #  pubmsgmenick = "%K{msgnick $0 $1-%K}%n"; +  #  pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n"; +  #  ownprivmsgnick = "%K{msgnick  $*%K}%n"; +  #  privmsgnick = "%K{msgnick  %R$*%K}%n"; + +  # $0 = nick mode, $1 = nick +  ownmsgnick = "{msgnick $0 $1-}"; +  ownnick = "%W$*%n"; + +  # public message in channel, $0 = nick mode, $1 = nick +  pubmsgnick = "{msgnick $0 $1-}"; +  pubnick = "%N$*%n"; + +  # public message in channel meant for me, $0 = nick mode, $1 = nick +  pubmsgmenick = "{msgnick $0 $1-}"; +  menick = "%Y$*%n"; + +  # public highlighted message in channel +  # $0 = highlight color, $1 = nick mode, $2 = nick +  pubmsghinick = "{msgnick $1 $0$2-%n}"; + +  # channel name is printed with message +  msgchannel = "%K:%c$*%n"; + +  # private message, $0 = nick, $1 = host +  privmsg = "[%R$0%K(%r$1-%K)%n] "; + +  # private message from you, $0 = "msg", $1 = target nick +  ownprivmsg = "[%r$0%K(%R$1-%K)%n] "; + +  # own private message in query +  ownprivmsgnick = "{msgnick  $*}"; +  ownprivnick = "%W$*%n"; + +  # private message in query +  privmsgnick = "{msgnick  %R$*%n}"; + +  ## +  ## Actions (/ME stuff) +  ## + +  # used internally by this theme +  action_core = "%W * $*%n"; + +  # generic one that's used by most actions +  action = "{action_core $*} "; + +  # own action, both private/public +  ownaction = "{action $*}"; + +  # own action with target, both private/public +  ownaction_target = "{action_core $0}%K:%c$1%n "; + +  # private action sent by others +  pvtaction = "%W (*) $*%n "; +  pvtaction_query = "{action $*}"; + +  # public action sent by others +  pubaction = "{action $*}"; + + +  ## +  ## other IRC events +  ## + +  # whois +  whois = "%# $[8]0 : $1-"; + +  # notices +  ownnotice = "[%r$0%K(%R$1-%K)]%n "; +  notice = "%K-%M$*%K-%n "; +  pubnotice_channel = "%K:%m$*"; +  pvtnotice_host = "%K(%m$*%K)"; +  servernotice = "%g!$*%n "; + +  # CTCPs +  ownctcp = "[%r$0%K(%R$1-%K)] "; +  ctcp = "%g$*%n"; + +  # wallops +  wallop = "%W$*%n: "; +  wallop_nick = "%n$*"; +  wallop_action = "%W * $*%n "; + +  # netsplits +  netsplit = "%R$*%n"; +  netjoin = "%C$*%n"; + +  # /names list +  names_prefix = ""; +  names_nick = "[%_$0%_$1-] "; +  names_nick_op = "{names_nick $*}"; +  names_nick_halfop = "{names_nick $*}"; +  names_nick_voice = "{names_nick $*}"; +  names_users = "[%g$*%n]"; +  names_channel = "%G$*%n"; + +  # DCC +  dcc = "%g$*%n"; +  dccfile = "%_$*%_"; + +  # DCC chat, own msg/action +  dccownmsg = "[%r$0%K($1-%K)%n] "; +  dccownnick = "%R$*%n"; +  dccownquerynick = "%W$*%n"; +  dccownaction = "{action $*}"; +  dccownaction_target = "{action_core $0}%K:%c$1%n "; + +  # DCC chat, others +  dccmsg = "[%G$1-%K(%g$0%K)%n] "; +  dccquerynick = "%G$*%n"; +  dccaction = "%W (*dcc*) $*%n %|"; + +  ## +  ## statusbar +  ## + +  # default background for all statusbars. You can also give +  # the default foreground color for statusbar items. +  sb_background = "%4%w"; + +  # default backround for "default" statusbar group +  #sb_default_bg = "%4"; +  # background for prompt / input line +  sb_prompt_bg = "%n"; +  # background for info statusbar +  sb_info_bg = "%8"; +  # background for topicbar (same default) +  #sb_topic_bg = "%4"; + +  # text at the beginning of statusbars. sb-item already puts +  # space there,so we don't use anything by default. +  sbstart = ""; +  # text at the end of statusbars. Use space so that it's never +  # used for anything. +  sbend = " "; + +  topicsbstart = "{sbstart $*}"; +  topicsbend = "{sbend $*}"; + +  prompt = "[$*] "; + +  sb = " %c[%n$*%c]%n"; +  sbmode = "(%c+%n$*)"; +  sbaway = " (%GzZzZ%n)"; +  sbservertag = ":$0 (change with ^X)"; +  sbnickmode = "$0"; + +  # activity in statusbar + +  # ',' separator +  sb_act_sep = "%c$*"; +  # normal text +  sb_act_text = "%c$*"; +  # public message +  sb_act_msg = "%W$*"; +  # hilight +  sb_act_hilight = "%M$*"; +  # hilight with specified color, $0 = color, $1 = text +  sb_act_hilight_color = "$0$1-%n"; +}; diff --git a/history-search/irssi/scripts b/history-search/irssi/scripts new file mode 120000 index 0000000..b870225 --- /dev/null +++ b/history-search/irssi/scripts @@ -0,0 +1 @@ +../
\ No newline at end of file diff --git a/history-search/run_irssi.sh b/history-search/run_irssi.sh new file mode 100755 index 0000000..9b73b49 --- /dev/null +++ b/history-search/run_irssi.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +/opt/stow/repo/irssi/bin/irssi --home=irssi/ diff --git a/scrolled-reminder/scrolled-reminder.pl b/scrolled-reminder/scrolled-reminder.pl new file mode 100644 index 0000000..e2775dc --- /dev/null +++ b/scrolled-reminder/scrolled-reminder.pl @@ -0,0 +1,65 @@ +use strict; +use warnings; + +use Irssi; +use Irssi::TextUI; +use Irssi::Irc; + +use Data::Dumper; + +our $VERSION = '0.01'; +our %IRSSI = ( +              authors     => 'Tom Feist', +              contact     => 'shabble@cowu.be', +              name        => 'scrolled-reminder', +              description => 'Requires confirmation to messages sent' +              . 'when the current window is scrolled up', + +              license     => 'WTFPL; http://sam.zoy.org/wtfpl/', +              url         => 'http://metavore.org/', +             ); + + +sub handle_send_text { +    my ($text, $server_tag, $win_item) = @_; +    unless ($win_item) { +        # not all windows have window-items (eg: status window) +        return; +    } + +    my $window = $win_item->window; +    my $view = $window->view; + +    if ($view->{bottom} != 1) { +        # we're scrolled up. +        unless (require_confirmation($window)) { +            Irssi::signal_stop; +        } +    } +} + +sub handle_keypress { +    my ($key) = @_; +    Irssi::print("key pressed: " . $key); +    if ($key == 3) { # Ctrl-c +    } elsif ($key == 11) { # Ctrl-k +    } else { +    } +    Irssi::signal_remove('gui key pressed', 'handle_keypress'); +} + +sub require_confirmation { +    my ($window) = @_; +    Irssi::signal_add_first('gui key pressed', 'handle_keypress'); +    $window->print("You are scrolled up Really send?"); +    write_to_prompt($window, 'Press Ctrl-K to confirm, Ctrl-C to cancel '); +} + +sub write_to_prompt { +    my ($window, $msg) = @_; +    #$window->command("insert_text $msg"); + +} + +Irssi::signal_add_first('send text', 'handle_send_text'); + diff --git a/scrolled-reminder/test.pl b/scrolled-reminder/test.pl new file mode 100644 index 0000000..e5b3d2e --- /dev/null +++ b/scrolled-reminder/test.pl @@ -0,0 +1,77 @@ +use strict; +use warnings; + +use lib '/opt/stow/lib/perl5'; + +use Irssi; +use Irssi::TextUI; +use Data::Dumper; +use vars qw/$BACON/; + +my $bob = "hello bob"; +our $HATS = "i like hats"; + +#Irssi::print(Dumper(\@INC)); +Irssi::print("Package is " . __PACKAGE__); + +#Irssi::gui_input_set("Hello"); +# my $foo = Irssi::gui_input_get_pos(); +# Irssi::print("foo is: $foo"); +my $foo = Irssi::yay_horsies("What!"); +Irssi::print($foo); + +Irssi::command_bind('prompt', 'do_prompt'); +Irssi::command_bind('emit', 'do_emit'); +Irssi::command_bind('myprint', 'do_print'); +Irssi::command_bind('myprint2', 'do_print2'); + +#Irssi::signal_add_last("gui print text", "do_gui_print"); +Irssi::signal_add("print text", "do_print_intercept"); + +sub do_print_intercept { +    my ($dest, $text, $stripped) = @_; +    #if ($text =~ m/baconbacon/) { +    $text = $text . "lvl: " . $dest->{level}; + +        $dest->{level} |= MSGLEVEL_NO_ACT; +        $dest->{level} &= ~MSGLEVEL_HILIGHT; + +#} +    Irssi::signal_continue($dest, $text, $stripped); +} + +sub do_gui_print { +    Irssi::print(Dumper(\@_)); +    Irssi::signal_stop(); +    Irssi::signal_remove('gui print text', 'do_gui_print'); +} + +sub do_prompt { +    my ($msg) = @_; +    Irssi::gui_input_set_prompt($msg); +} + +sub do_emit { +    my ($key) = @_; +    Irssi::print("emitting signal: keypress for $key"); +    #Irssi::signal_emit("gui key pressed", $key); +    Irssi::signal_emit("gui dialog", "error", "What is going on?"); +} + +sub do_print { +    my ($msg) = @_; +    my $window = Irssi::active_win; +    my $len = length $msg; + +    $window->print(Dumper($window->view)); +    # $window->print("message is $msg which is $len long"); +    # my $str = join( ', ', map { ord } split( '', $msg)); +    # $window->print($str); + +} + + +sub do_print2 { +    my ($msg) = @_; +    Irssi::print("message2 is $msg", MSGLEVEL_PUBLIC + MSGLEVEL_NOHILIGHT); +} | 
