[878] in BarnOwl Developers

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

[D-O-H] r866 - branches/barnowl_sqlite/owl

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:10:41 2009

Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Mon, 14 Jan 2008 02:44:03 -0500 (EST)

Author: nelhage
Date: 2008-01-14 02:44:02 -0500 (Mon, 14 Jan 2008)
New Revision: 866

Modified:
   branches/barnowl_sqlite/owl/message.c
Log:
Time for our weekly two-minute hate on owl.

Kludge around the ``private''/``isprivate'' discrepancy in stock owl.


Modified: branches/barnowl_sqlite/owl/message.c
===================================================================
--- branches/barnowl_sqlite/owl/message.c	2008-01-14 07:20:36 UTC (rev 865)
+++ branches/barnowl_sqlite/owl/message.c	2008-01-14 07:44:02 UTC (rev 866)
@@ -76,6 +76,18 @@
  */
 char *owl_message_get_attribute_value(owl_message *m, char *attrname)
 {
+  /*
+   * Horrible kludge for historical reasons.
+   *
+   * Stock owl stores a ``isprivate'' field in C code, and a
+   * ``private'' field in perl, and converts between them when
+   * marshalling. Since perl and C now read the same objects, we unify
+   * on ``private'', but need to provide support for old filters which
+   * use ``isprivate''.
+   *
+   * This kludge could arguably live in filter.c instead.
+   */
+  if(!strcmp(attrname, "isprivate")) attrname = "private";
   SV *attr = owl_message_get_attribute_internal(m, attrname);
   if(attr == NULL || !SvOK(attr)) return NULL;
   return SvPV_nolen(attr);


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