[846] in BarnOwl Developers
[D-O-H] r836 - 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:15:07 -0500 (EST)
Author: nelhage
Date: 2008-01-11 22:15:06 -0500 (Fri, 11 Jan 2008)
New Revision: 836
Modified:
trunk/owl/stylefunc.c
Log:
Nuke the stylefunc_default C code
Modified: trunk/owl/stylefunc.c
===================================================================
--- trunk/owl/stylefunc.c 2008-01-12 02:32:01 UTC (rev 835)
+++ trunk/owl/stylefunc.c 2008-01-12 03:15:06 UTC (rev 836)
@@ -220,182 +220,6 @@
}
}
-void owl_stylefunc_default(owl_fmtext *fm, owl_message *m)
-{
- char *shorttimestr;
-#ifdef HAVE_LIBZEPHYR
- char *ptr, *zsigbuff, frombuff[LINE];
- ZNotice_t *n;
-#endif
-
- shorttimestr=owl_message_get_shorttimestr(m);
-
- if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
-#ifdef HAVE_LIBZEPHYR
- n=owl_message_get_notice(m);
-
- /* 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';
- }
-
- /* 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, " ");
- owl_fmtext_append_normal(fm, shorttimestr);
- owl_fmtext_append_normal(fm, "\n");
- } else {
- owl_fmtext_append_normal(fm, owl_message_get_class(m));
- owl_fmtext_append_normal(fm, " / ");
- owl_fmtext_append_normal(fm, owl_message_get_instance(m));
- owl_fmtext_append_normal(fm, " / ");
- owl_fmtext_append_bold(fm, frombuff);
- if (strcasecmp(owl_message_get_realm(m), ZGetRealm())) {
- owl_fmtext_append_normal(fm, " {");
- owl_fmtext_append_normal(fm, owl_message_get_realm(m));
- owl_fmtext_append_normal(fm, "}");
- }
- if (strcmp(owl_message_get_opcode(m), "")) {
- owl_fmtext_append_normal(fm, " [");
- owl_fmtext_append_normal(fm, owl_message_get_opcode(m));
- owl_fmtext_append_normal(fm, "]");
- }
-
- owl_fmtext_append_normal(fm, " ");
- owl_fmtext_append_normal(fm, shorttimestr);
-
- /* stick on the zsig */
- zsigbuff=owl_malloc(strlen(owl_message_get_zsig(m))+30);
- owl_message_pretty_zsig(m, zsigbuff);
- owl_fmtext_append_normal(fm, " (");
- owl_fmtext_append_ztext(fm, zsigbuff);
- owl_fmtext_append_normal(fm, ")");
- owl_fmtext_append_normal(fm, "\n");
- owl_free(zsigbuff);
-
- owl_style_basic_format_body(fm, m);
-
- /* 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);
- }
- }
- }
-
-#endif
- } else if (owl_message_is_type_zephyr(m) && owl_message_is_direction_out(m)) {
- char *zsigbuff, *foo;
-
- 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, " ");
- owl_fmtext_append_normal(fm, shorttimestr);
-
- 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_style_basic_format_body(fm, m);
- } else if (owl_message_is_type_aim(m)) {
- 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, " ");
- owl_fmtext_append_normal(fm, shorttimestr);
- owl_fmtext_append_normal(fm, "\n");
- } else if (owl_message_is_direction_in(m)) {
- 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_normal(fm, " ");
- owl_fmtext_append_normal(fm, shorttimestr);
-
- owl_fmtext_append_bold(fm, "\n");
- owl_style_basic_format_body(fm, m);
- } else if (owl_message_is_direction_out(m)) {
- 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, " ");
- owl_fmtext_append_normal(fm, shorttimestr);
- owl_fmtext_append_normal(fm, "\n");
- owl_style_basic_format_body(fm, m);
- }
- } else if (owl_message_is_type_admin(m)) {
- char *header;
-
- header=owl_message_get_attribute_value(m, "adminheader");
-
- 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_style_basic_format_body(fm, m);
- } else {
- char *header;
-
- header=owl_sprintf("%s from: %s to: %s",
- owl_message_get_type(m),
- owl_message_get_sender(m),
- owl_message_get_recipient(m));
-
- owl_fmtext_append_normal(fm, OWL_TABSTR);
- owl_fmtext_append_normal(fm, header);
- owl_fmtext_append_normal(fm, " ");
- owl_fmtext_append_normal(fm, shorttimestr);
- owl_fmtext_append_normal(fm, "\n");
- owl_style_basic_format_body(fm, m);
- }
- owl_free(shorttimestr);
-}
-
void owl_stylefunc_oneline(owl_fmtext *fm, owl_message *m)
{
char *tmp;