Changeset 6500907


Ignore:
Timestamp:
Jul 21, 2011, 5:12:15 PM (13 years ago)
Author:
Jason Gross <jgross@mit.edu>
Branches:
master, release-1.10, release-1.9
Children:
f661cee, 092806c
Parents:
14be3a5
git-author:
Jason Gross <jgross@mit.edu> (07/20/11 02:55:11)
git-committer:
Jason Gross <jgross@mit.edu> (07/21/11 17:12:15)
Message:
Correctly display multiline fields in :info

Commit 259e60a8abc2d2d41bc7a484b02a334fdd13857f removed the length limit
on :info, but kept the replacement of '\n' with '~' and '\r' with '!'.
This replacement came with the initial commit, with a comment of "/*
just for testing for now */".  This commit does away with that
replacement, and indents the fields for display purposes.

This is particularly useful for messages that have very long fields,
such as the original xml field for jabber messages.

Trailing newlines (e.g., in formats or in the message body) are doubled,
because the code is simpler that way, and because I don't see a
compelling reason to strip them.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r837bd81 r6500907  
    14301430#ifdef HAVE_LIBZEPHYR
    14311431    if (owl_message_is_direction_in(m)) {
    1432       char *tmpbuff;
     1432      char *tmpbuff, *tmpbuff2;
    14331433      int i, fields;
    14341434
     
    14761476
    14771477        for (i = 0; i < fields; i++) {
    1478           tmpbuff = owl_zephyr_get_field_as_utf8(n, i + 1);
    1479 
    1480           g_strdelimit(tmpbuff, "\n", '~');
    1481           g_strdelimit(tmpbuff, "\r", '!');
    1482 
    1483           owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i + 1, tmpbuff);
    1484           g_free(tmpbuff);
     1478          tmpbuff = owl_zephyr_get_field_as_utf8(n, i + 1);
     1479          tmpbuff2 = owl_text_indent(tmpbuff, 14, false);
     1480          owl_fmtext_appendf_normal(&fm, "  Field %i   : %s\n", i + 1, tmpbuff2);
     1481          g_free(tmpbuff2);
     1482          g_free(tmpbuff);
    14851483        }
    1486         owl_fmtext_appendf_normal(&fm, "  Default Fm: %s\n", n->z_default_format);
     1484        tmpbuff = owl_text_indent(n->z_default_format, 14, false);
     1485        owl_fmtext_appendf_normal(&fm, "  Default Fm: %s\n", tmpbuff);
     1486        g_free(tmpbuff);
    14871487      }
    14881488
  • message.c

    rdde1b4d r6500907  
    125125    p = m->attributes->pdata[i];
    126126
    127     tmpbuff = g_strdup(owl_pair_get_value(p));
    128     g_strdelimit(tmpbuff, "\n", '~');
    129     g_strdelimit(tmpbuff, "\r", '!');
    130     buff = g_strdup_printf("  %-15.15s: %s\n", owl_pair_get_key(p), tmpbuff);
    131     g_free(tmpbuff);
     127    buff = g_strdup(owl_pair_get_value(p));
     128    if (buff) {
     129      tmpbuff = owl_text_indent(buff, 19, false);
     130      g_free(buff);
     131      buff = g_strdup_printf("  %-15.15s: %s\n", owl_pair_get_key(p), tmpbuff);
     132      g_free(tmpbuff);
     133    }
    132134
    133135    if(buff == NULL) {
Note: See TracChangeset for help on using the changeset viewer.