Changeset 3abf28b for message.c


Ignore:
Timestamp:
Jun 1, 2003, 9:11:25 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:
75e3879
Parents:
df0d93a
Message:
make smartnarrow work for AIM
  (though it will crash on names with spaces)
don't set an away message by default
better default format
bold them like personal zephyrs
same with terminal bell
do some basic HTML stripping (buggy, in progress)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • message.c

    rdf0d93a r3abf28b  
    529529}
    530530
    531 void owl_message_create_aim(owl_message *m, char *sender, char *recipient, char *text)
     531void owl_message_create_incoming_aim(owl_message *m, char *sender, char *recipient, char *text)
    532532{
    533533  char *indent;
     
    538538  owl_message_set_recipient(m, recipient);
    539539  owl_message_set_type_aim(m);
     540  owl_message_set_direction_in(m);
     541
     542  indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
     543  owl_text_indent(indent, text, OWL_MSGTAB);
     544  owl_fmtext_init_null(&(m->fmtext));
     545  owl_fmtext_append_bold(&(m->fmtext), OWL_TABSTR);
     546  owl_fmtext_append_bold(&(m->fmtext), "AIM from ");
     547  owl_fmtext_append_bold(&(m->fmtext), sender);
     548  owl_fmtext_append_bold(&(m->fmtext), "\n");
     549  owl_fmtext_append_bold(&(m->fmtext), indent);
     550  if (text[strlen(text)-1]!='\n') {
     551    owl_fmtext_append_bold(&(m->fmtext), "\n");
     552  }
     553 
     554  owl_free(indent);
     555}
     556
     557void owl_message_create_outgoing_aim(owl_message *m, char *sender, char *recipient, char *text)
     558{
     559  char *indent;
     560
     561  owl_message_init(m);
     562  owl_message_set_body(m, text);
     563  owl_message_set_sender(m, sender);
     564  owl_message_set_recipient(m, recipient);
     565  owl_message_set_type_aim(m);
     566  owl_message_set_direction_out(m);
    540567
    541568  indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
     
    543570  owl_fmtext_init_null(&(m->fmtext));
    544571  owl_fmtext_append_normal(&(m->fmtext), OWL_TABSTR);
    545   owl_fmtext_append_normal(&(m->fmtext), "AIM: ");
    546   owl_fmtext_append_normal(&(m->fmtext), sender);
    547   owl_fmtext_append_normal(&(m->fmtext), " -> ");
     572  owl_fmtext_append_normal(&(m->fmtext), "AIM sent to ");
    548573  owl_fmtext_append_normal(&(m->fmtext), recipient);
    549574  owl_fmtext_append_normal(&(m->fmtext), "\n");
     
    889914    owl_fmtext_append_ztext(&(m->fmtext), indent);
    890915
    891     /* make personal messages bold for smaat users */
     916    /* make private messages bold for smaat users */
    892917    if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES)) {
    893918      if (owl_message_is_personal(m)) {
Note: See TracChangeset for help on using the changeset viewer.