[1164] in BarnOwl Developers

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

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

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:13:40 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
X-Original-To: nelhage@nelhage.com
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Thu, 21 Aug 2008 18:18:51 -0400 (EDT)

Author: nelhage
Date: 2008-08-21 18:18:51 -0400 (Thu, 21 Aug 2008)
New Revision: 1111

Modified:
   trunk/owl/functions.c
   trunk/owl/perlwrap.pm
Log:
Make owl_function_reply call methods to get the replycmd.

For backwards compatibility, we add default sub replycmd and sub
replysendercmd to BarnOwl::Message, which just return the value of the
property.


Modified: trunk/owl/functions.c
===================================================================
--- trunk/owl/functions.c	2008-08-21 18:37:38 UTC (rev 1110)
+++ trunk/owl/functions.c	2008-08-21 22:18:51 UTC (rev 1111)
@@ -2135,9 +2135,11 @@
       }
     } else {
       char *cmd;
-      if((type==0 && (cmd=owl_message_get_attribute_value(m, "replycmd")))
-         || (type==1 && (cmd=owl_message_get_attribute_value(m, "replysendercmd")))) {
-        buff = owl_strdup(cmd);
+      if((type == 0 &&
+          (cmd=owl_perlconfig_message_call_method(m, "replycmd", 0, NULL))) ||
+         (type == 1 &&
+          (cmd=owl_perlconfig_message_call_method(m, "replysendercmd", 0, NULL)))) {
+        buff = cmd;
       }
     }
 

Modified: trunk/owl/perlwrap.pm
===================================================================
--- trunk/owl/perlwrap.pm	2008-08-21 18:37:38 UTC (rev 1110)
+++ trunk/owl/perlwrap.pm	2008-08-21 22:18:51 UTC (rev 1111)
@@ -361,6 +361,12 @@
 sub login_host  { return undef; }
 sub login_tty   { return undef; }
 
+# This is for back-compat with old messages that set these properties
+# New protocol implementations are encourages to user override these
+# methods.
+sub replycmd         { return shift->{replycmd}};
+sub replysendercmd   { return shift->{replysendercmd}};
+
 sub pretty_sender    { return shift->sender; }
 sub pretty_recipient { return shift->recipient; }
 


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