text stringlengths 0 357 |
|---|
if (item->att_type==MAILIMAP_MSG_ATT_ITEM_STATIC) |
{ |
if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_UID) |
{ |
return item->att_data.att_static->att_data.att_uid; |
} |
} |
} |
} |
return 0; |
} |
static char* unquote_rfc724_mid(const char* in) |
{ |
/* remove < and > from the given message id */ |
char* out = dc_strdup(in); |
int out_len = strlen(out); |
if (out_len > 2) { |
if (out[0]=='<') { out[0] = ' '; } |
if (out[out_len-1]=='>') { out[out_len-1] = ' '; } |
dc_trim(out); |
} |
return out; |
} |
static const char* peek_rfc724_mid(struct mailimap_msg_att* msg_att) |
{ |
if (msg_att==NULL) { |
return NULL; |
} |
/* search the UID in a list of attributes returned by a FETCH command */ |
clistiter* iter1; |
for (iter1=clist_begin(msg_att->att_list); iter1!=NULL; iter1=clist_next(iter1)) |
{ |
struct mailimap_msg_att_item* item = (struct mailimap_msg_att_item*)clist_content(iter1); |
if (item) |
{ |
if (item->att_type==MAILIMAP_MSG_ATT_ITEM_STATIC) |
{ |
if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_ENVELOPE) |
{ |
struct mailimap_envelope* env = item->att_data.att_static->att_data.att_env; |
if (env && env->env_message_id) { |
return env->env_message_id; |
} |
} |
} |
} |
} |
return NULL; |
} |
static int peek_flag_keyword(struct mailimap_msg_att* msg_att, const char* flag_keyword) |
{ |
/* search $MDNSent in a list of attributes returned by a FETCH command */ |
if (msg_att==NULL || msg_att->att_list==NULL || flag_keyword==NULL) { |
return 0; |
} |
clistiter *iter1, *iter2; |
for (iter1=clist_begin(msg_att->att_list); iter1!=NULL; iter1=clist_next(iter1)) |
{ |
struct mailimap_msg_att_item* item = (struct mailimap_msg_att_item*)clist_content(iter1); |
if (item) |
{ |
if (item->att_type==MAILIMAP_MSG_ATT_ITEM_DYNAMIC) |
{ |
if (item->att_data.att_dyn->att_list /*I've seen NULL here ...*/) |
{ |
for (iter2=clist_begin(item->att_data.att_dyn->att_list); iter2!=NULL ; iter2=clist_next(iter2)) |
{ |
struct mailimap_flag_fetch* flag_fetch =(struct mailimap_flag_fetch*) clist_content(iter2); |
if (flag_fetch && flag_fetch->fl_type==MAILIMAP_FLAG_FETCH_OTHER) |
{ |
struct mailimap_flag* flag = flag_fetch->fl_flag; |
if (flag) |
{ |
if (flag->fl_type==MAILIMAP_FLAG_KEYWORD && flag->fl_data.fl_keyword!=NULL |
&& strcmp(flag->fl_data.fl_keyword, flag_keyword)==0) { |
return 1; /* flag found */ |
} |
} |
} |
} |
} |
} |
} |
} |
return 0; |
} |
static void peek_body(struct mailimap_msg_att* msg_att, char** p_msg, size_t* p_msg_bytes, uint32_t* flags, int* deleted) |
{ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.