diff options
Diffstat (limited to 'src/mail.c')
-rw-r--r-- | src/mail.c | 33 |
1 files changed, 28 insertions, 5 deletions
@@ -260,8 +260,33 @@ mail_stats () } mu_address_t +get_uploader_email (struct uploader_info *info, struct file_triplet *trp, + const char **errp) +{ + mu_address_t addr; + mu_address_t rcpt = NULL; + int rc; + + rc = mu_address_create (&addr, info->email); + if (rc) + { + *errp = mu_strerror (rc); + return NULL; + } + + mu_address_set_personal (addr, 1, info->realname); + + /* This hack makes sure that mu_address_to_string (rcpt) will + return full email address (with personal part) */ + mu_address_union (&rcpt, addr); + mu_address_destroy (&addr); + + return rcpt; +} + +mu_address_t get_recipient (struct access_method *method, struct file_triplet *trp, - char **errp) + const char **errp) { unsigned nrows, ncols, i; mu_address_t rcpt = NULL; @@ -327,7 +352,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev, struct notification *ntf) { mu_address_t rcpt = NULL; - char *errp; + const char *errp; switch (ntf->tgt) { case notify_admin: @@ -335,8 +360,7 @@ do_notify (struct file_triplet *trp, enum notification_event ev, break; case notify_user: - rcpt = get_recipient (trp->spool->access_method[user_data_method], - trp, &errp); + rcpt = get_uploader_email (trp->uploader, trp, &errp); break; case notify_owner: @@ -387,7 +411,6 @@ notify (struct notification *notification_list, { struct notification *p; - fill_project_name (trp); for (p = notification_list; p; p = p->next) if (p->ev == ev) do_notify (trp, ev, p); |