int i;
for (i = 0; i < m->msg_count; i++)
{
- struct PopEmailData *edata = m->emails[i]->edata;
+ struct PopEmailData *edata = pop_edata_get(m->emails[i]);
if (mutt_str_strcmp(line, edata->uid) == 0)
break;
}
for (int i = 0; i < m->msg_count; i++)
{
- struct PopEmailData *edata = m->emails[i]->edata;
+ struct PopEmailData *edata = pop_edata_get(m->emails[i]);
/* if the id we get is known for a header: done (i.e. keep in cache) */
if (edata->uid && (mutt_str_strcmp(edata->uid, id) == 0))
return 0;
{
if (!m->quiet)
mutt_progress_update(&progress, i + 1 - old_count, -1);
- struct PopEmailData *edata = m->emails[i]->edata;
+ struct PopEmailData *edata = pop_edata_get(m->emails[i]);
#ifdef USE_HCACHE
void *data = mutt_hcache_fetch(hc, edata->uid, strlen(edata->uid));
if (data)
for (i = 0, j = 0, rc = 0; (rc == 0) && (i < m->msg_count); i++)
{
- struct PopEmailData *edata = m->emails[i]->edata;
+ struct PopEmailData *edata = pop_edata_get(m->emails[i]);
if (m->emails[i]->deleted && (m->emails[i]->refno != -1))
{
j++;
struct Progress progress;
struct PopAccountData *adata = pop_adata_get(m);
struct Email *e = m->emails[msgno];
- struct PopEmailData *edata = e->edata;
+ struct PopEmailData *edata = pop_edata_get(e);
bool bcache = true;
/* see if we already have the message in body cache */
return 0;
}
+/**
+ * pop_edata_get - Get the private data for this Email
+ * @retval ptr Private Email data
+ */
+struct PopEmailData *pop_edata_get(struct Email *e)
+{
+ if (!e)
+ return NULL;
+ return e->edata;
+}
+
/**
* pop_connect - Open connection
* @param adata POP Account data
struct Mailbox *m = data;
for (int i = 0; i < m->msg_count; i++)
{
- struct PopEmailData *edata = m->emails[i]->edata;
+ struct PopEmailData *edata = pop_edata_get(m->emails[i]);
if (mutt_str_strcmp(edata->uid, endp) == 0)
{
m->emails[i]->refno = index;
#include "conn/conn.h"
#include "mutt/mutt.h"
+struct Email;
struct Mailbox;
struct Progress;
int pop_reconnect(struct Mailbox *m);
void pop_logout(struct Mailbox *m);
struct PopAccountData *pop_adata_get(struct Mailbox *m);
+struct PopEmailData *pop_edata_get(struct Email *e);
#endif /* MUTT_POP_POP_PRIVATE_H */