Skip to content
Snippets Groups Projects
Commit a5d77dca authored by Stephan Bosch's avatar Stephan Bosch
Browse files

testsuite: testsuite-mailstore - Return struct testsuite_mailstore_mail from...

testsuite: testsuite-mailstore - Return struct testsuite_mailstore_mail from testsuite_mailstore_open().

This is more flexible and needed in subsequent commit.
parent c4322964
No related branches found
No related tags found
No related merge requests found
......@@ -165,7 +165,8 @@ bool testsuite_mailstore_mailbox_create(
return TRUE;
}
static struct mail *testsuite_mailstore_open(const char *folder)
static struct testsuite_mailstore_mail *
testsuite_mailstore_open(const char *folder)
{
enum mailbox_flags flags =
MAILBOX_FLAG_SAVEONLY | MAILBOX_FLAG_POST_SESSION;
......@@ -202,7 +203,7 @@ static struct mail *testsuite_mailstore_open(const char *folder)
tmail->next = testsuite_mailstore_mail;
testsuite_mailstore_mail = tmail;
}
return tmail->mail;
return tmail;
}
box = mailbox_alloc(ns->list, folder, flags);
......@@ -235,7 +236,7 @@ static struct mail *testsuite_mailstore_open(const char *folder)
tmail->trans = t;
tmail->mail = mail_alloc(t, 0, NULL);
return tmail->mail;
return tmail;
}
static void testsuite_mailstore_free(bool all)
......@@ -272,13 +273,14 @@ void testsuite_mailstore_flush(void)
bool testsuite_mailstore_mail_index(const struct sieve_runtime_env *renv,
const char *folder, unsigned int index)
{
struct mail *mail = testsuite_mailstore_open(folder);
struct testsuite_mailstore_mail *tmail;
if (mail == NULL)
tmail = testsuite_mailstore_open(folder);
if (tmail == NULL)
return FALSE;
mail_set_seq(mail, index+1);
testsuite_message_set_mail(renv, mail);
mail_set_seq(tmail->mail, index+1);
testsuite_message_set_mail(renv, tmail->mail);
return TRUE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.