[502] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

[D-O-H] r624 - trunk/owl

daemon@ATHENA.MIT.EDU (asedeno@MIT.EDU)
Thu Oct 29 18:06:51 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: asedeno@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Mon, 19 Feb 2007 19:04:08 -0500 (EST)

Author: asedeno
Date: 2007-02-19 19:04:08 -0500 (Mon, 19 Feb 2007)
New Revision: 624

Modified:
   trunk/owl/perlwrap.pm
Log:
Add loopwrite message class.
Trim trailing whitespace.



Modified: trunk/owl/perlwrap.pm
===================================================================
--- trunk/owl/perlwrap.pm	2007-02-19 23:58:42 UTC (rev 623)
+++ trunk/owl/perlwrap.pm	2007-02-20 00:04:08 UTC (rev 624)
@@ -32,14 +32,14 @@
 }
 $configfile ||= $ENV{HOME}."/.owlconf";
 
-# populate global variable space for legacy owlconf files 
+# populate global variable space for legacy owlconf files
 sub _format_msg_legacy_wrap {
     my ($m) = @_;
     $m->legacy_populate_global();
     return &BarnOwl::format_msg($m);
 }
 
-# populate global variable space for legacy owlconf files 
+# populate global variable space for legacy owlconf files
 sub _receive_msg_legacy_wrap {
     my ($m) = @_;
     $m->legacy_populate_global();
@@ -165,7 +165,7 @@
 		my $aval;
 		$aval = $val->[$i];
 		$aval =~ s/\n/\n$f.$i: /g;
-		$s .= "$f.$i: $aval\n";	   
+		$s .= "$f.$i: $aval\n";
 	    }
 	} else {
 	    $val =~ s/\n/\n$f: /g;
@@ -238,12 +238,24 @@
 #####################################################################
 #####################################################################
 
+package BarnOwl::Message::Loopback;
+
+use base qw( BarnOwl::Message );
+
+# all loopback messages are personal
+sub is_personal {
+  return 1;
+}
+
+#####################################################################
+#####################################################################
+
 package BarnOwl::Message::AIM;
 
 use base qw( BarnOwl::Message );
 
 # all non-loginout AIM messages are personal for now...
-sub is_personal { 
+sub is_personal {
     return !(shift->is_loginout);
 }
 
@@ -279,13 +291,13 @@
     return shift->instance;
 }
 
-sub login_tty { 
+sub login_tty {
     my ($m) = @_;
     return undef if (!$m->is_loginout);
     return $m->fields->[2];
 }
 
-sub login_host { 
+sub login_host {
     my ($m) = @_;
     return undef if (!$m->is_loginout);
     return $m->fields->[0];
@@ -295,14 +307,14 @@
 
 sub is_ping     { return (lc(shift->opcode) eq "ping"); }
 
-sub is_personal { 
+sub is_personal {
     my ($m) = @_;
     return ((lc($m->class) eq "message")
 	    && (lc($m->instance) eq "personal")
 	    && $m->is_private);
 }
 
-sub is_mail { 
+sub is_mail {
     my ($m) = @_;
     return ((lc($m->class) eq "mail") && $m->is_private);
 }
@@ -372,7 +384,7 @@
       local $reload = 1;
       BarnOwl::mainloop_hook() if *BarnOwl::mainloop_hook{CODE};
   }
-    
+
   @BarnOwl::Hooks::onMainLoop = ();
   @BarnOwl::Hooks::onStartSubs = ();
 
@@ -387,7 +399,7 @@
   package BarnOwl;
 }
 
-sub reload_init () 
+sub reload_init ()
 {
     BarnOwl::command('alias reload perl BarnOwl::reload()');
     BarnOwl::command('bindkey global "C-x C-r" command reload');
@@ -588,9 +600,9 @@
 sub indentBody($)
 {
     my $m = shift;
-    
+
     my $body = $m->body;
-    # replace newline followed by anything with 
+    # replace newline followed by anything with
     # newline plus four spaces and that thing.
     $body =~ s/\n(.)/\n    $1/g;
 


home help back first fref pref prev next nref lref last post