[589] in BarnOwl Developers

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

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

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:07:43 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: Sun, 22 Apr 2007 15:12:12 -0400 (EDT)

Author: nelhage
Date: 2007-04-22 15:12:12 -0400 (Sun, 22 Apr 2007)
New Revision: 703

Modified:
   /
   trunk/owl/functions.c
   trunk/owl/message.c
Log:
 r21132@phanatique:  nelhage | 2007-04-22 15:11:07 -0400
 Improving the private/personal distinction by fixing owl_message_is_personal
 * ``private'' means to/or from an individual, not a chat/class/etc.
 * ``personal'' means ``matches the personal filter''



Property changes on: 
___________________________________________________________________
Name: svk:merge
   - 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:24493
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/barnowl:21131
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h:18636
   + 6122c8b4-0e12-0410-9533-8bcd7c66c992:/local/dirty-owl-hacks:24493
6aa88b72-b502-0410-8cb4-a5dd0230fb79:/owl-local:1356
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/barnowl:21132
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h:18636

Modified: trunk/owl/functions.c
===================================================================
--- trunk/owl/functions.c	2007-04-22 19:11:57 UTC (rev 702)
+++ trunk/owl/functions.c	2007-04-22 19:12:12 UTC (rev 703)
@@ -2892,7 +2892,7 @@
 
   /* narrow personal and login messages to the sender or recip as appropriate */
   if (owl_message_is_type_zephyr(m)) {
-    if (owl_message_is_personal(m) || owl_message_is_loginout(m)) {
+    if (owl_message_is_private(m) || owl_message_is_loginout(m)) {
       if (owl_message_is_direction_in(m)) {
         zperson=short_zuser(owl_message_get_sender(m));
       } else {
@@ -2904,7 +2904,7 @@
     }
 
     /* narrow class MESSAGE, instance foo, recip * messages to class, inst */
-    if (!strcasecmp(owl_message_get_class(m), "message") && !owl_message_is_personal(m)) {
+    if (!strcasecmp(owl_message_get_class(m), "message")) {
       filtname=owl_function_classinstfilt(owl_message_get_class(m), owl_message_get_instance(m));
       return(filtname);
     }

Modified: trunk/owl/message.c
===================================================================
--- trunk/owl/message.c	2007-04-22 19:11:57 UTC (rev 702)
+++ trunk/owl/message.c	2007-04-22 19:12:12 UTC (rev 703)
@@ -549,15 +549,12 @@
 
 int owl_message_is_personal(owl_message *m)
 {
-  if (owl_message_is_type_zephyr(m)) {
-    if (strcasecmp(owl_message_get_class(m), "message")) return(0);
-    if (strcasecmp(owl_message_get_instance(m), "personal")) return(0);
-    if (!strcasecmp(owl_message_get_recipient(m), owl_zephyr_get_sender()) ||
-	!strcasecmp(owl_message_get_sender(m), owl_zephyr_get_sender())) {
-      return(1);
-    }
+  owl_filter * f = owl_global_get_filter(&g, "personal");
+  if(!f) {
+      owl_function_error("personal filter is not defined");
+      return (0);
   }
-  return(0);
+  return owl_filter_message_match(f, m);
 }
 
 int owl_message_is_question(owl_message *m)
@@ -837,7 +834,8 @@
 
   
   /* set the "isprivate" attribute if it's a private zephyr.
-   ``private'' means recipient is */
+   ``private'' means recipient is non-empty and doesn't start wit 
+   `@' */
   if (*n->z_recipient && *n->z_recipient != '@') {
     owl_message_set_isprivate(m);
   }
@@ -975,10 +973,13 @@
   } else {
     owl_message_set_hostname(m, hostbuff);
   }
-  owl_zwrite_free(&z);
 
-  if(owl_message_is_personal(m))
+  /* set the "isprivate" attribute if it's a private zephyr. */
+  if (owl_zwrite_is_personal(&z)) {
     owl_message_set_isprivate(m);
+  }
+
+  owl_zwrite_free(&z);
 }
 
 void owl_message_pretty_zsig(owl_message *m, char *buff)


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