Changeset 839697d
- Timestamp:
- May 7, 2010, 9:40:35 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 4727d31
- Parents:
- a41c8d1
- git-author:
- Nelson Elhage <nelhage@mit.edu> (05/07/10 20:31:20)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (05/07/10 21:40:35)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
logging.c
r91634ec r839697d 128 128 char filename[MAXPATHLEN], *logpath; 129 129 char *to, *temp; 130 GList *cc; 130 131 131 132 /* expand ~ in path names */ … … 135 136 if (owl_message_is_type_zephyr(m)) { 136 137 /* If this has CC's, do all but the "recipient" which we'll do below */ 137 to = owl_message_get_cc_without_recipient(m); 138 if (to != NULL) { 139 temp = strtok(to, " "); 140 while (temp != NULL) { 141 temp = short_zuser(temp); 142 snprintf(filename, MAXPATHLEN, "%s/%s", logpath, temp); 143 owl_log_append(m, filename); 144 temp = strtok(NULL, " "); 145 } 146 owl_free(to); 147 } 138 cc = owl_message_get_cc_without_recipient(m); 139 while (cc != NULL) { 140 temp = short_zuser(cc->data); 141 snprintf(filename, MAXPATHLEN, "%s/%s", logpath, temp); 142 owl_log_append(m, filename); 143 144 owl_free(cc->data); 145 cc = g_list_delete_link(cc, cc); 146 } 147 148 148 to = short_zuser(owl_message_get_recipient(m)); 149 149 } else if (owl_message_is_type_jabber(m)) { … … 325 325 * the sender, as well. 326 326 */ 327 char *cc, *temp; 327 char *temp; 328 GList *cc; 328 329 cc = owl_message_get_cc_without_recipient(m); 329 if (cc != NULL) { 330 temp = strtok(cc, " "); 331 while (temp != NULL) { 332 temp = short_zuser(temp); 333 if (strcasecmp(temp, frombuff) != 0) { 334 snprintf(filename, MAXPATHLEN, "%s/%s", logpath, temp); 335 owl_log_append(m, filename); 336 } 337 temp = strtok(NULL, " "); 330 while (cc != NULL) { 331 temp = short_zuser(cc->data); 332 if (strcasecmp(temp, frombuff) != 0) { 333 snprintf(filename, MAXPATHLEN, "%s/%s", logpath, temp); 334 owl_log_append(m, filename); 338 335 } 339 owl_free(cc); 336 337 owl_free(cc->data); 338 cc = g_list_delete_link(cc, cc); 340 339 } 341 340 } -
message.c
r9a7b4f2 r839697d 584 584 585 585 /* caller must free return value */ 586 char*owl_message_get_cc_without_recipient(const owl_message *m)587 { 588 char *cc, * out, *end, *shortuser, *recip;586 GList *owl_message_get_cc_without_recipient(const owl_message *m) 587 { 588 char *cc, *shortuser, *recip; 589 589 const char *user; 590 GList *out = NULL; 590 591 591 592 cc = owl_message_get_cc(m); … … 594 595 595 596 recip = short_zuser(owl_message_get_recipient(m)); 596 out = owl_malloc(strlen(cc) + 2);597 end = out;598 597 599 598 user = strtok(cc, " "); … … 601 600 shortuser = short_zuser(user); 602 601 if (strcasecmp(shortuser, recip) != 0) { 603 strcpy(end, user); 604 end[strlen(user)] = ' '; 605 end += strlen(user) + 1; 602 out = g_list_prepend(out, owl_strdup(user)); 606 603 } 607 604 owl_free(shortuser); 608 605 user = strtok(NULL, " "); 609 606 } 610 end[0] = '\0';611 607 612 608 owl_free(recip); 613 609 owl_free(cc); 614 615 if (strlen(out) == 0) {616 owl_free(out);617 out = NULL;618 }619 610 620 611 return(out);
Note: See TracChangeset
for help on using the changeset viewer.