Changeset 5789230 for functions.c


Ignore:
Timestamp:
Jun 5, 2003, 2:26:51 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
aac889a
Parents:
ae4cd12
Message:
'isloginout' and 'isprivate' are now message attributes
improved 'info' function lists seperate info for zephyr, aim and
   also prints all message attributes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r2824f79 r5789230  
    12101210{
    12111211  owl_message *m;
    1212   owl_fmtext fm;
     1212  owl_fmtext fm, attrfm;
    12131213  ZNotice_t *n;
    12141214  char buff[10000], tmpbuff[1024];
     
    12261226  }
    12271227
    1228   owl_fmtext_append_normal(&fm, "Msg Id    : ");
     1228  owl_fmtext_append_bold(&fm, "General Information:\n");
     1229  owl_fmtext_append_normal(&fm, "  Msg Id    : ");
    12291230  sprintf(buff, "%i", owl_message_get_id(m));
    12301231  owl_fmtext_append_normal(&fm, buff);
    12311232  owl_fmtext_append_normal(&fm, "\n");
    12321233
    1233   owl_fmtext_append_normal(&fm, "Type      : ");
     1234  owl_fmtext_append_normal(&fm, "  Type      : ");
    12341235  owl_fmtext_append_bold(&fm, owl_message_type_to_string(m));
    12351236  owl_fmtext_append_normal(&fm, "\n");
    12361237
    12371238  if (owl_message_is_direction_in(m)) {
    1238     owl_fmtext_append_normal(&fm, "Direction : in\n");
     1239    owl_fmtext_append_normal(&fm, "  Direction : in\n");
    12391240  } else if (owl_message_is_direction_out(m)) {
    1240     owl_fmtext_append_normal(&fm, "Direction : out\n");
     1241    owl_fmtext_append_normal(&fm, "  Direction : out\n");
    12411242  } else if (owl_message_is_direction_none(m)) {
    1242     owl_fmtext_append_normal(&fm, "Direction : none\n");
     1243    owl_fmtext_append_normal(&fm, "  Direction : none\n");
    12431244  } else {
    1244     owl_fmtext_append_normal(&fm, "Direction : unknown\n");
    1245   }
    1246 
    1247   owl_fmtext_append_normal(&fm, "Time      : ");
     1245    owl_fmtext_append_normal(&fm, "  Direction : unknown\n");
     1246  }
     1247
     1248  owl_fmtext_append_normal(&fm, "  Time      : ");
    12481249  owl_fmtext_append_normal(&fm, owl_message_get_timestr(m));
    12491250  owl_fmtext_append_normal(&fm, "\n");
    12501251
    12511252  if (!owl_message_is_type_admin(m)) {
    1252     owl_fmtext_append_normal(&fm, "Sender    : ");
     1253    owl_fmtext_append_normal(&fm, "  Sender    : ");
    12531254    owl_fmtext_append_normal(&fm, owl_message_get_sender(m));
    12541255    owl_fmtext_append_normal(&fm, "\n");
    12551256   
    1256     owl_fmtext_append_normal(&fm, "Recipient : ");
     1257    owl_fmtext_append_normal(&fm, "  Recipient : ");
    12571258    owl_fmtext_append_normal(&fm, owl_message_get_recipient(m));
    12581259    owl_fmtext_append_normal(&fm, "\n");
     
    12601261   
    12611262  if (owl_message_is_type_zephyr(m)) {
    1262     owl_fmtext_append_bold(&fm, "  Zephyr Specific Info\n");
     1263    owl_fmtext_append_bold(&fm, "\nZephyr Specific Information:\n");
    12631264   
    1264     owl_fmtext_append_normal(&fm, "Class     : ");
     1265    owl_fmtext_append_normal(&fm, "  Class     : ");
    12651266    owl_fmtext_append_normal(&fm, owl_message_get_class(m));
    12661267    owl_fmtext_append_normal(&fm, "\n");
    1267     owl_fmtext_append_normal(&fm, "Instance  : ");
     1268    owl_fmtext_append_normal(&fm, "  Instance  : ");
    12681269    owl_fmtext_append_normal(&fm, owl_message_get_instance(m));
    12691270    owl_fmtext_append_normal(&fm, "\n");
    1270     owl_fmtext_append_normal(&fm, "Opcode    : ");
     1271    owl_fmtext_append_normal(&fm, "  Opcode    : ");
    12711272    owl_fmtext_append_normal(&fm, owl_message_get_opcode(m));
    12721273    owl_fmtext_append_normal(&fm, "\n");
    12731274   
    1274     owl_fmtext_append_normal(&fm, "Time      : ");
     1275    owl_fmtext_append_normal(&fm, "  Time      : ");
    12751276    owl_fmtext_append_normal(&fm, owl_message_get_timestr(m));
    12761277    owl_fmtext_append_normal(&fm, "\n");
     
    12791280      n=owl_message_get_notice(m);
    12801281
    1281       owl_fmtext_append_normal(&fm, "Kind      : ");
     1282      owl_fmtext_append_normal(&fm, "  Kind      : ");
    12821283      if (n->z_kind==UNSAFE) {
    12831284        owl_fmtext_append_normal(&fm, "UNSAFE\n");
     
    13011302        owl_fmtext_append_normal(&fm, "ILLEGAL VALUE\n");
    13021303      }
    1303       owl_fmtext_append_normal(&fm, "Host      : ");
     1304      owl_fmtext_append_normal(&fm, "  Host      : ");
    13041305      owl_fmtext_append_normal(&fm, owl_message_get_hostname(m));
    13051306      owl_fmtext_append_normal(&fm, "\n");
    1306       sprintf(buff, "Port      : %i\n", n->z_port);
     1307      sprintf(buff, "  Port      : %i\n", n->z_port);
    13071308      owl_fmtext_append_normal(&fm, buff);
    13081309
    1309       owl_fmtext_append_normal(&fm,    "Auth      : ");
     1310      owl_fmtext_append_normal(&fm,    "  Auth      : ");
    13101311      if (n->z_auth == ZAUTH_FAILED) {
    13111312        owl_fmtext_append_normal(&fm, "FAILED\n");
     
    13191320      }
    13201321
    1321       sprintf(buff, "Checkd Ath: %i\n", n->z_checked_auth);
    1322       sprintf(buff, "%sMulti notc: %s\n", buff, n->z_multinotice);
    1323       sprintf(buff, "%sNum other : %i\n", buff, n->z_num_other_fields);
    1324       sprintf(buff, "%sMsg Len   : %i\n", buff, n->z_message_len);
     1322      /* fix this */
     1323      sprintf(buff, "  Checkd Ath: %i\n", n->z_checked_auth);
     1324      sprintf(buff, "%s  Multi notc: %s\n", buff, n->z_multinotice);
     1325      sprintf(buff, "%s  Num other : %i\n", buff, n->z_num_other_fields);
     1326      sprintf(buff, "%s  Msg Len   : %i\n", buff, n->z_message_len);
    13251327      owl_fmtext_append_normal(&fm, buff);
    13261328     
    1327       sprintf(buff, "Fields    : %i\n", owl_zephyr_get_num_fields(n));
     1329      sprintf(buff, "  Fields    : %i\n", owl_zephyr_get_num_fields(n));
    13281330      owl_fmtext_append_normal(&fm, buff);
    13291331     
    13301332      fields=owl_zephyr_get_num_fields(n);
    13311333      for (i=0; i<fields; i++) {
    1332         sprintf(buff, "Field %i   : ", i+1);
     1334        sprintf(buff, "  Field %i   : ", i+1);
    13331335       
    13341336        ptr=owl_zephyr_get_field(n, i+1, &len);
     
    13521354        owl_fmtext_append_normal(&fm, buff);
    13531355      }
    1354       owl_fmtext_append_normal(&fm, "Default Fm:");
     1356      owl_fmtext_append_normal(&fm, "  Default Fm:");
    13551357      owl_fmtext_append_normal(&fm, n->z_default_format);
    13561358    }
     
    13581360
    13591361  if (owl_message_is_type_aim(m)) {
    1360     owl_fmtext_append_bold(&fm, "  AIM Specific Info\n");   
    1361   }
     1362    owl_fmtext_append_bold(&fm, "\nAIM Specific Information:\n");
     1363  }
     1364
     1365  owl_fmtext_append_bold(&fm, "\nOwl Message Attributes:\n");
     1366  owl_message_attributes_tofmtext(m, &attrfm);
     1367  owl_fmtext_append_fmtext(&fm, &attrfm);
    13621368 
    13631369  owl_function_popless_fmtext(&fm);
     1370  owl_fmtext_free(&fm);
     1371  owl_fmtext_free(&attrfm);
    13641372}
    13651373
     
    17511759      }
    17521760     
    1753       if (owl_message_is_login(m)) {
     1761      if (owl_message_is_loginout(m)) {
    17541762        class="MESSAGE";
    17551763        inst="PERSONAL";
     
    23592367
    23602368  /* narrow personal and login messages to the sender or recip as appropriate */
    2361   if (owl_message_is_personal(m) || owl_message_is_login(m)) {
     2369  if (owl_message_is_personal(m) || owl_message_is_loginout(m)) {
    23622370    if (owl_message_is_type_zephyr(m)) {
    23632371      if (owl_message_is_direction_in(m)) {
     
    24062414  /* for now we skip admin messages. */
    24072415  if (owl_message_is_type_admin(m)
    2408       || owl_message_is_login(m)
     2416      || owl_message_is_loginout(m)
    24092417      || !owl_message_is_type_zephyr(m)) {
    24102418    owl_function_makemsg("smartzpunt doesn't support this message type.");
Note: See TracChangeset for help on using the changeset viewer.