Changeset 9c590d4 for logging.c


Ignore:
Timestamp:
Jun 6, 2007, 11:31:49 PM (13 years ago)
Author:
Alex Vandiver <alexmv@mit.edu>
Branches:
master, barnowl_perlaim, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
d0961fe
Parents:
48609ce
git-author:
Alex Vandiver <alexmv@mit.edu> (06/06/07 23:31:44)
git-committer:
Alex Vandiver <alexmv@mit.edu> (06/06/07 23:31:49)
Message:
Outgoing CC'd messages get logged to all recipients
File:
1 edited

Legend:

Unmodified
Added
Removed
  • logging.c

    r42947f1 r9c590d4  
    132132{
    133133  char filename[MAXPATHLEN], *logpath;
    134   char *to;
     134  char *to, *temp;
     135
     136  /* expand ~ in path names */
     137  logpath = owl_text_substitute(owl_global_get_logpath(&g), "~", owl_global_get_homedir(&g));
    135138
    136139  /* Figure out what path to log to */
    137140  if (owl_message_is_type_zephyr(m)) {
    138       to = short_zuser(owl_message_get_recipient(m));
     141    // If this has CC's, do all but the "recipient" which we'll do below
     142    to = owl_message_get_cc_without_recipient(m);
     143    if (to != NULL) {
     144      temp = strtok(to, " ");
     145      while (temp != NULL) {
     146          temp = short_zuser(temp);
     147          snprintf(filename, MAXPATHLEN, "%s/%s", logpath, temp);
     148          owl_log_append(m, filename);
     149          temp = strtok(NULL, " ");
     150      }
     151      owl_free(to);
     152    }
     153    to = short_zuser(owl_message_get_recipient(m));
    139154  } else if (owl_message_is_type_jabber(m)) {
    140       to = owl_sprintf("jabber:%s", owl_message_get_recipient(m));
     155    to = owl_sprintf("jabber:%s", owl_message_get_recipient(m));
    141156  } else if (owl_message_is_type_aim(m)) {
    142       char *temp;
    143       temp = owl_aim_normalize_screenname(owl_message_get_recipient(m));
    144       downstr(temp);
    145       to = owl_sprintf("aim:%s", temp);
    146       owl_free(temp);
    147   } else {
    148       to = owl_sprintf("loopback");
    149   }
    150 
    151   /* expand ~ in path names */
    152   logpath = owl_text_substitute(owl_global_get_logpath(&g), "~", owl_global_get_homedir(&g));
     157    temp = owl_aim_normalize_screenname(owl_message_get_recipient(m));
     158    downstr(temp);
     159    to = owl_sprintf("aim:%s", temp);
     160    owl_free(temp);
     161  } else {
     162    to = owl_sprintf("loopback");
     163  }
     164
    153165  snprintf(filename, MAXPATHLEN, "%s/%s", logpath, to);
     166  owl_log_append(m, filename);
    154167  owl_free(to);
    155168
     169  snprintf(filename, MAXPATHLEN, "%s/all", logpath);
    156170  owl_log_append(m, filename);
    157 
    158   snprintf(filename, MAXPATHLEN, "%s/all", logpath);
    159171  owl_free(logpath);
    160 
    161   owl_log_append(m, filename);
    162172}
    163173
Note: See TracChangeset for help on using the changeset viewer.