Changeset d09e5a1 for message.c


Ignore:
Timestamp:
May 31, 2003, 3:33:42 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:
5e53c4a
Parents:
c86a35c
Message:
Added libfaim
Added basic AIM support, including the "aimlogin", "aimwrite" and
   "aimlogout" commands
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    rc86a35c rd09e5a1  
    196196  m->type=OWL_MESSAGE_TYPE_ZEPHYR;
    197197}
     198
     199void owl_message_set_type_aim(owl_message *m) {
     200  m->type=OWL_MESSAGE_TYPE_AIM;
     201}
    198202                                               
    199203int owl_message_is_type_admin(owl_message *m) {
     
    204208int owl_message_is_type_zephyr(owl_message *m) {
    205209  if (m->type==OWL_MESSAGE_TYPE_ZEPHYR) return(1);
     210  return(0);
     211}
     212
     213int owl_message_is_type_aim(owl_message *m) {
     214  if (m->type==OWL_MESSAGE_TYPE_AIM) return(1);
    206215  return(0);
    207216}
     
    384393
    385394  owl_message_init(m);
    386 
    387395  owl_message_set_body(m, text);
    388396
     
    398406  }
    399407
     408  owl_free(indent);
     409}
     410
     411void owl_message_create_aim(owl_message *m, char *sender, char *text) {
     412  char *indent;
     413
     414  owl_message_init(m);
     415  owl_message_set_body(m, text);
     416  owl_message_set_sender(m, sender);
     417  owl_message_set_type_aim(m);
     418
     419  indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
     420  owl_text_indent(indent, text, OWL_MSGTAB);
     421  owl_fmtext_init_null(&(m->fmtext));
     422  owl_fmtext_append_normal(&(m->fmtext), OWL_TABSTR);
     423  owl_fmtext_append_normal(&(m->fmtext), "AIM: ");
     424  owl_fmtext_append_normal(&(m->fmtext), sender);
     425  owl_fmtext_append_normal(&(m->fmtext), "\n");
     426  owl_fmtext_append_ztext(&(m->fmtext), indent);
     427  if (text[strlen(text)-1]!='\n') {
     428    owl_fmtext_append_normal(&(m->fmtext), "\n");
     429  }
     430 
    400431  owl_free(indent);
    401432}
Note: See TracChangeset for help on using the changeset viewer.