+sub event_send_text {
+ my ( $line, $server, $win ) = @_;
+ my $awin = Irssi::active_win();
+
+ # if the window where we got our text was the twitter window, and the user
+ # wants to be lazy, tweet away!
+ if ( ($awin->get_active_name() eq $window->{name})
+ and Irssi::settings_get_bool("tweet_window_input") ) {
+ &cmd_tweet($line, $server, $win);
+ }
+}
+
+Irssi::signal_add( "send text", "event_send_text" );
+
+Irssi::theme_register([
+ 'twirssi_tweet', '[$0%B@$1%n$2] $3',
+ 'twirssi_reply', '[$0\--> %B@$1%n$2] $3',
+ 'twirssi_dm', '[$0%B@$1%n (%WDM%n)] $2',
+]);
+