[847] in BarnOwl Developers

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

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

daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:10:21 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: Fri, 11 Jan 2008 22:17:19 -0500 (EST)

Author: nelhage
Date: 2008-01-11 22:17:19 -0500 (Fri, 11 Jan 2008)
New Revision: 837

Modified:
   trunk/owl/owl.c
   trunk/owl/stylefunc.c
Log:
Nuke the vt style as well

Modified: trunk/owl/owl.c
===================================================================
--- trunk/owl/owl.c	2008-01-12 03:15:06 UTC (rev 836)
+++ trunk/owl/owl.c	2008-01-12 03:17:19 UTC (rev 837)
@@ -253,12 +253,7 @@
   s=owl_malloc(sizeof(owl_style));
   owl_style_create_internal(s, "basic", &owl_stylefunc_basic, "Basic message formatting.");
   owl_global_add_style(&g, s);
-#if 0
   s=owl_malloc(sizeof(owl_style));
-  owl_style_create_internal(s, "vt", &owl_stylefunc_vt, "VT message formatting.");
-  owl_global_add_style(&g, s);
-#endif
-  s=owl_malloc(sizeof(owl_style));
   owl_style_create_internal(s, "oneline", &owl_stylefunc_oneline, "Formats for one-line-per-message");
   owl_global_add_style(&g, s);
 

Modified: trunk/owl/stylefunc.c
===================================================================
--- trunk/owl/stylefunc.c	2008-01-12 03:15:06 UTC (rev 836)
+++ trunk/owl/stylefunc.c	2008-01-12 03:17:19 UTC (rev 837)
@@ -349,205 +349,3 @@
   }    
 
 }
-
-void owl_stylefunc_vt(owl_fmtext *fm, owl_message *m)
-{
-#ifdef HAVE_LIBZEPHYR
-  char *body, *indent, *ptr, frombuff[LINE];
-  owl_fmtext fm_first, fm_other, fm_tmp;
-  ZNotice_t *n;
-#endif
-  char *sender, *hostname, *timestr, *classinst1, *classinst2;
-
-  if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
-#ifdef HAVE_LIBZEPHYR
-    n=owl_message_get_notice(m);
-
-    /* get the body */
-    body=owl_malloc(strlen(owl_message_get_body(m))+30);
-    strcpy(body, owl_message_get_body(m));
-    
-    /* add a newline if we need to */
-    if (body[0]!='\0' && body[strlen(body)-1]!='\n') {
-      strcat(body, "\n");
-    }
-
-    owl_fmtext_init_null(&fm_tmp);
-    owl_fmtext_append_ztext(&fm_tmp, body);
-    owl_fmtext_init_null(&fm_first);
-    owl_fmtext_truncate_lines(&fm_tmp, 0, 1, &fm_first);
-
-    /* do the indenting into indent */
-    indent=owl_malloc(strlen(body)+owl_text_num_lines(body)*OWL_MSGTAB+10);
-    owl_text_indent(indent, body, 31);
-
-    owl_fmtext_free(&fm_tmp);
-    owl_fmtext_init_null(&fm_tmp);
-    owl_fmtext_append_ztext(&fm_tmp, indent);
-    owl_fmtext_init_null(&fm_other);
-    owl_fmtext_truncate_lines(&fm_tmp, 1, owl_fmtext_num_lines(&fm_tmp)-1, &fm_other);
-    owl_fmtext_free(&fm_tmp);
-    
-    /* edit the from addr for printing */
-    strcpy(frombuff, owl_message_get_sender(m));
-    ptr=strchr(frombuff, '@');
-    if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) {
-      *ptr='\0';
-    }
-    sender=owl_sprintf("%-9.9s", frombuff);
-
-    hostname=owl_sprintf("%-9.9s", owl_message_get_hostname(m));
-    timestr=owl_strdup("00:00");
-    classinst1=owl_sprintf("<%s>[%s]", owl_message_get_class(m), owl_message_get_instance(m));
-    classinst2=owl_sprintf("%-9.9s", classinst1);
-    
-    /* set the message for printing */
-    owl_fmtext_append_normal(fm, OWL_TABSTR);
-    
-    if (owl_message_is_ping(m) && owl_message_is_private(m)) {
-      owl_fmtext_append_bold(fm, "PING");
-      owl_fmtext_append_normal(fm, " from ");
-      owl_fmtext_append_bold(fm, frombuff);
-      owl_fmtext_append_normal(fm, "\n");
-    } else if (owl_message_is_loginout(m)) {
-      char *host, *tty;
-      
-      host=owl_message_get_attribute_value(m, "loginhost");
-      tty=owl_message_get_attribute_value(m, "logintty");
-      
-      if (owl_message_is_login(m)) {
-	owl_fmtext_append_bold(fm, "LOGIN");
-      } else if (owl_message_is_logout(m)) {
-	owl_fmtext_append_bold(fm, "LOGOUT");
-      }
-      if (owl_message_is_pseudo(m)) owl_fmtext_append_bold(fm, " (PSEUDO)");
-
-      owl_fmtext_append_normal(fm, " for ");
-      ptr=short_zuser(owl_message_get_instance(m));
-      owl_fmtext_append_bold(fm, ptr);
-      owl_free(ptr);
-      owl_fmtext_append_normal(fm, " at ");
-      owl_fmtext_append_normal(fm, host ? host : "");
-      owl_fmtext_append_normal(fm, " ");
-      owl_fmtext_append_normal(fm, tty ? tty : "");
-      owl_fmtext_append_normal(fm, "\n");
-    } else {
-      owl_fmtext_append_normal(fm, sender);
-      owl_fmtext_append_normal(fm, "|");
-      owl_fmtext_append_normal(fm, hostname);
-      owl_fmtext_append_normal(fm, " ");
-      owl_fmtext_append_normal(fm, timestr);
-      owl_fmtext_append_normal(fm, " ");
-      owl_fmtext_append_normal(fm, classinst2);
-
-      owl_fmtext_append_normal(fm, "   ");
-      owl_fmtext_append_fmtext(fm, &fm_first);
-      owl_fmtext_append_fmtext(fm, &fm_other);
-
-      owl_fmtext_free(&fm_other);
-      owl_fmtext_free(&fm_first);
-      
-      /* make private messages bold for smaat users */
-      if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES)) {
-	if (owl_message_is_personal(m)) {
-	  owl_fmtext_addattr(fm, OWL_FMTEXT_ATTR_BOLD);
-	}
-      }
-    }
-
-    owl_free(sender);
-    owl_free(hostname);
-    owl_free(timestr);
-    owl_free(classinst1);
-    owl_free(classinst2);
-    
-    owl_free(body);
-    owl_free(indent);
-#endif
-  } else if (owl_message_is_type_zephyr(m) && owl_message_is_direction_out(m)) {
-    char *indent, *text, *zsigbuff, *foo;
-    
-    text=owl_message_get_body(m);
-    
-    indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
-    owl_text_indent(indent, text, OWL_MSGTAB);
-    owl_fmtext_append_normal(fm, OWL_TABSTR);
-    owl_fmtext_append_normal(fm, "Zephyr sent to ");
-    foo=short_zuser(owl_message_get_recipient(m));
-    owl_fmtext_append_normal(fm, foo);
-    owl_free(foo);
-    owl_fmtext_append_normal(fm, "  (Zsig: ");
-    
-    zsigbuff=owl_malloc(strlen(owl_message_get_zsig(m))+30);
-    owl_message_pretty_zsig(m, zsigbuff);
-    owl_fmtext_append_ztext(fm, zsigbuff);
-    owl_free(zsigbuff);
-    
-    owl_fmtext_append_normal(fm, ")");
-    owl_fmtext_append_normal(fm, "\n");
-    owl_fmtext_append_ztext(fm, indent);
-    if (text[strlen(text)-1]!='\n') {
-      owl_fmtext_append_normal(fm, "\n");
-    }
-    
-    owl_free(indent);
-  } else if (owl_message_is_type_aim(m)) {
-    char *indent;
-    
-    if (owl_message_is_loginout(m)) {
-      owl_fmtext_append_normal(fm, OWL_TABSTR);
-      if (owl_message_is_login(m)) {
-	owl_fmtext_append_bold(fm, "AIM LOGIN");
-      } else {
-	owl_fmtext_append_bold(fm, "AIM LOGOUT");
-      }
-      owl_fmtext_append_normal(fm, " for ");
-      owl_fmtext_append_normal(fm, owl_message_get_sender(m));
-      owl_fmtext_append_normal(fm, "\n");
-    } else if (owl_message_is_direction_in(m)) {
-      indent=owl_malloc(strlen(owl_message_get_body(m))+owl_text_num_lines(owl_message_get_body(m))*OWL_MSGTAB+10);
-      owl_text_indent(indent, owl_message_get_body(m), OWL_MSGTAB);
-      owl_fmtext_append_bold(fm, OWL_TABSTR);
-      owl_fmtext_append_bold(fm, "AIM from ");
-      owl_fmtext_append_bold(fm, owl_message_get_sender(m));
-      owl_fmtext_append_bold(fm, "\n");
-      owl_fmtext_append_bold(fm, indent);
-      if (indent[strlen(indent)-1]!='\n') {
-	owl_fmtext_append_normal(fm, "\n");
-      }
-      owl_free(indent);
-    } else if (owl_message_is_direction_out(m)) {
-      indent=owl_malloc(strlen(owl_message_get_body(m))+owl_text_num_lines(owl_message_get_body(m))*OWL_MSGTAB+10);
-      owl_text_indent(indent, owl_message_get_body(m), OWL_MSGTAB);
-      owl_fmtext_append_normal(fm, OWL_TABSTR);
-      owl_fmtext_append_normal(fm, "AIM sent to ");
-      owl_fmtext_append_normal(fm, owl_message_get_recipient(m));
-      owl_fmtext_append_normal(fm, "\n");
-      owl_fmtext_append_ztext(fm, indent);
-      if (indent[strlen(indent)-1]!='\n') {
-	owl_fmtext_append_normal(fm, "\n");
-      }
-      owl_free(indent);
-    }
-  } else if (owl_message_is_type_admin(m)) {
-    char *text, *header, *indent;
-    
-    text=owl_message_get_body(m);
-    header=owl_message_get_attribute_value(m, "adminheader");
-    
-    indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
-    owl_text_indent(indent, text, OWL_MSGTAB);
-    owl_fmtext_append_normal(fm, OWL_TABSTR);
-    owl_fmtext_append_bold(fm, "OWL ADMIN ");
-    owl_fmtext_append_ztext(fm, header);
-    owl_fmtext_append_normal(fm, "\n");
-    owl_fmtext_append_ztext(fm, indent);
-    if (text[strlen(text)-1]!='\n') {
-      owl_fmtext_append_normal(fm, "\n");
-    }
-    
-    owl_free(indent);
-  } else {
-
-  }
-}


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