Changeset db2dd3d


Ignore:
Timestamp:
Oct 21, 2003, 9:43:29 AM (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:
8c92848
Parents:
15283bb
Message:
Display CC in outgoing CC messages
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r15283bb rdb2dd3d  
    332.0.11-pre-1
    44        Updated basic help
     5        Display CC: in outgoing CC messages
    56       
    672.0.10
  • zwrite.c

    r2a2bb60 rdb2dd3d  
    216216void owl_zwrite_set_message(owl_zwrite *z, char *msg)
    217217{
     218  int i, j;
     219  char toline[LINE];
     220
    218221  if (z->message) owl_free(z->message);
    219   z->message=owl_strdup(msg);
     222
     223  j=owl_list_get_size(&(z->recips));
     224  if (j>0 && z->cc) {
     225    strcpy(toline, "CC: ");
     226    for (i=0; i<j; i++) {
     227      if (strcmp(z->realm, "")) {
     228        sprintf(toline, "%s%s@%s ", toline, (char *) owl_list_get_element(&(z->recips), i), z->realm);
     229      } else {
     230        sprintf(toline, "%s%s ", toline, (char *) owl_list_get_element(&(z->recips), i));
     231      }
     232    }
     233    z->message=owl_sprintf("%s\n%s", toline, msg);
     234  } else {
     235    z->message=owl_strdup(msg);
     236  }
    220237}
    221238
     
    241258  j=owl_list_get_size(&(z->recips));
    242259  if (j>0) {
    243     char *tmpmsg=NULL;
    244     char toline[LINE];
    245 
    246     if (z->cc) {
    247       strcpy(toline, "CC: ");
    248       for (i=0; i<j; i++) {
    249         if (strcmp(z->realm, "")) {
    250           sprintf(toline, "%s%s@%s ", toline, (char *) owl_list_get_element(&(z->recips), i), z->realm);
    251         } else {
    252           sprintf(toline, "%s%s ", toline, (char *) owl_list_get_element(&(z->recips), i));
    253         }
    254       }
    255       tmpmsg=owl_malloc(strlen(z->message)+strlen(toline)+30);
    256       sprintf(tmpmsg, "%s\n%s", toline, z->message);
    257     }
    258 
    259260    for (i=0; i<j; i++) {
    260261      if (strcmp(z->realm, "")) {
     
    263264        strcpy(to, owl_list_get_element(&(z->recips), i));
    264265      }
    265       if (z->cc) {
    266         send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, tmpmsg);
    267       } else {
    268         send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
    269       }
    270     }
    271     if (z->cc) {
    272       owl_free(tmpmsg);
     266      send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
    273267    }
    274268  } else {
Note: See TracChangeset for help on using the changeset viewer.