Skip to content

Commit

Permalink
lib-mail: message-part-data: Renamed struct message_part_envelope_dat…
Browse files Browse the repository at this point in the history
…a to message_part_envelope.
  • Loading branch information
stephanbosch authored and GitLab committed Jan 30, 2017
1 parent 042a584 commit b674bd9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/lib-imap/imap-bodystructure.c
Expand Up @@ -196,7 +196,7 @@ static void part_write_body(const struct message_part *part,
child_data = part->children->data;

str_append(str, " (");
imap_envelope_write_part_data(child_data->envelope, str);
imap_envelope_write(child_data->envelope, str);
str_append(str, ") ");

part_write_bodystructure_siblings(part->children, str, extended);
Expand Down
8 changes: 4 additions & 4 deletions src/lib-imap/imap-envelope.c
Expand Up @@ -39,7 +39,7 @@ static void imap_write_address(string_t *str, struct message_address *addr)
str_append_c(str, ')');
}

void imap_envelope_write_part_data(struct message_part_envelope_data *data,
void imap_envelope_write(struct message_part_envelope *data,
string_t *str)
{
#define NVL(str, nullstr) ((str) != NULL ? (str) : (nullstr))
Expand Down Expand Up @@ -147,12 +147,12 @@ imap_envelope_parse_addresses(const struct imap_arg *arg,
}

bool imap_envelope_parse_args(const struct imap_arg *args,
pool_t pool, struct message_part_envelope_data **envlp_r,
pool_t pool, struct message_part_envelope **envlp_r,
const char **error_r)
{
struct message_part_envelope_data *envlp;
struct message_part_envelope *envlp;

envlp = p_new(pool, struct message_part_envelope_data, 1);
envlp = p_new(pool, struct message_part_envelope, 1);

if (!imap_arg_get_nstring(args++, &envlp->date)) {
*error_r = "Invalid date field";
Expand Down
6 changes: 3 additions & 3 deletions src/lib-imap/imap-envelope.h
Expand Up @@ -2,15 +2,15 @@
#define IMAP_ENVELOPE_H

struct imap_arg;
struct message_part_envelope_data;
struct message_part_envelope;

/* Write envelope to given string */
void imap_envelope_write_part_data(struct message_part_envelope_data *data,
void imap_envelope_write(struct message_part_envelope *data,
string_t *str);

/* Parse envelope from arguments */
bool imap_envelope_parse_args(const struct imap_arg *args,
pool_t pool, struct message_part_envelope_data **envlp_r,
pool_t pool, struct message_part_envelope **envlp_r,
const char **error_r);

#endif
8 changes: 4 additions & 4 deletions src/lib-mail/message-part-data.c
Expand Up @@ -141,16 +141,16 @@ envelope_get_field(const char *name)
}

void message_part_envelope_parse_from_header(pool_t pool,
struct message_part_envelope_data **data,
struct message_part_envelope **data,
struct message_header_line *hdr)
{
struct message_part_envelope_data *d;
struct message_part_envelope *d;
enum envelope_field field;
struct message_address **addr_p;
const char **str_p;

if (*data == NULL) {
*data = p_new(pool, struct message_part_envelope_data, 1);
*data = p_new(pool, struct message_part_envelope, 1);
}

if (hdr == NULL)
Expand Down Expand Up @@ -425,7 +425,7 @@ void message_part_data_parse_from_header(pool_t pool,
struct message_header_line *hdr)
{
struct message_part_data *part_data;
struct message_part_envelope_data *envelope;
struct message_part_envelope *envelope;
bool parent_rfc822;

if (hdr == NULL) {
Expand Down
6 changes: 3 additions & 3 deletions src/lib-mail/message-part-data.h
Expand Up @@ -12,7 +12,7 @@ struct message_part_param {
const char *value;
};

struct message_part_envelope_data {
struct message_part_envelope {
const char *date, *subject;
struct message_address *from, *sender, *reply_to;
struct message_address *to, *cc, *bcc;
Expand All @@ -35,7 +35,7 @@ struct message_part_data {
const char *const *content_language;
const char *content_location;

struct message_part_envelope_data *envelope;
struct message_part_envelope *envelope;
};

extern const char *message_part_envelope_headers[];
Expand All @@ -55,7 +55,7 @@ bool message_part_data_is_plain_7bit(const struct message_part *part)

/* Update envelope data based from given header field */
void message_part_envelope_parse_from_header(pool_t pool,
struct message_part_envelope_data **_data,
struct message_part_envelope **_data,
struct message_header_line *hdr);

/* Parse a single header. Note that this modifies part->context. */
Expand Down
2 changes: 1 addition & 1 deletion src/lib-storage/index/index-mail-headers.c
Expand Up @@ -265,7 +265,7 @@ static void index_mail_parse_finish_imap_envelope(struct index_mail *mail)
string_t *str;

str = str_new(mail->mail.data_pool, 256);
imap_envelope_write_part_data(mail->data.envelope_data, str);
imap_envelope_write(mail->data.envelope_data, str);
mail->data.envelope = str_c(str);

if (mail_cache_field_can_add(_mail->transaction->cache_trans,
Expand Down
2 changes: 1 addition & 1 deletion src/lib-storage/index/index-mail.h
Expand Up @@ -85,7 +85,7 @@ struct index_mail_data {
struct message_binary_part *bin_parts;
const char *envelope, *body, *bodystructure, *guid, *filename;
const char *from_envelope, *body_snippet;
struct message_part_envelope_data *envelope_data;
struct message_part_envelope *envelope_data;

uint32_t seq;
uint32_t cache_flags;
Expand Down

0 comments on commit b674bd9

Please sign in to comment.