Changeset 37eab7f for message.c


Ignore:
Timestamp:
Oct 25, 2003, 11:53:43 PM (17 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:
eec69e1
Parents:
8c92848
Message:
Added the loopback message type
Added the loopwrite command
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    rf4d0975 r37eab7f  
    313313}
    314314
     315void owl_message_set_type_loopback(owl_message *m)
     316{
     317  m->type=OWL_MESSAGE_TYPE_LOOPBACK;
     318}
     319
    315320void owl_message_set_type_zephyr(owl_message *m)
    316321{
     
    329334}
    330335
     336int owl_message_is_type_loopback(owl_message *m)
     337{
     338  if (m->type==OWL_MESSAGE_TYPE_LOOPBACK) return(1);
     339  return(0);
     340}
     341
    331342int owl_message_is_type_zephyr(owl_message *m)
    332343{
     
    345356  if (m->type==OWL_MESSAGE_TYPE_GENERIC) return(1);
    346357  return(0);
    347 }
    348 
    349 char *owl_message_type_to_string(owl_message *m)
    350 {
    351   if (m->type==OWL_MESSAGE_TYPE_ADMIN) return("admin");
    352   if (m->type==OWL_MESSAGE_TYPE_GENERIC) return("generic");
    353   if (m->type==OWL_MESSAGE_TYPE_ZEPHYR) return("zephyr");
    354   if (m->type==OWL_MESSAGE_TYPE_AIM) return("aim");
    355   if (m->type==OWL_MESSAGE_TYPE_JABBER) return("jabber");
    356   if (m->type==OWL_MESSAGE_TYPE_ICQ) return("icq");
    357   if (m->type==OWL_MESSAGE_TYPE_MSN) return("msn");
    358   return("unknown");
    359358}
    360359
     
    449448  return(m->hostname);
    450449}
    451 
    452450
    453451void owl_message_curs_waddstr(owl_message *m, WINDOW *win, int aline, int bline, int acol, int bcol, int color)
     
    597595  case OWL_MESSAGE_TYPE_MSN:
    598596    return("msn");
     597  case OWL_MESSAGE_TYPE_LOOPBACK:
     598    return("loopback");
    599599  default:
    600600    return("unknown");
     
    677677  owl_message_set_body(m, text);
    678678  owl_message_set_attribute(m, "adminheader", header); /* just a hack for now */
     679}
     680
     681/* caller should set the direction */
     682void owl_message_create_loopback(owl_message *m, char *text)
     683{
     684  owl_message_init(m);
     685  owl_message_set_type_loopback(m);
     686  owl_message_set_body(m, text);
     687  owl_message_set_sender(m, "loopback-sender");
     688  owl_message_set_recipient(m, "loopback-recipient");
     689  owl_message_set_isprivate(m);
    679690}
    680691
     
    817828}
    818829
    819 
    820830void owl_message_pretty_zsig(owl_message *m, char *buff)
    821831{
Note: See TracChangeset for help on using the changeset viewer.