20 |
/* |
/* |
21 |
* Now you're messing with a sumbitch |
* Now you're messing with a sumbitch |
22 |
*/ |
*/ |
|
static int get_attribute_type __P ((const char *, int *)); |
|
23 |
|
|
24 |
int |
int |
25 |
imap4d_store (struct imap4d_command *command, char *arg) |
imap4d_store (struct imap4d_command *command, char *arg) |
122 |
int type = 0; |
int type = 0; |
123 |
char item[64] = ""; |
char item[64] = ""; |
124 |
util_token (item, sizeof (item), &items); |
util_token (item, sizeof (item), &items); |
125 |
if (get_attribute_type (item, &type)) |
if (!util_attribute_to_type (item, &type)) |
126 |
{ |
{ |
127 |
if (how == STORE_ADD ) |
if (how == STORE_ADD ) |
128 |
attribute_set_flags (attr, type); |
attribute_set_flags (attr, type); |
156 |
return RESP_OK; |
return RESP_OK; |
157 |
} |
} |
158 |
|
|
|
static int |
|
|
get_attribute_type (const char *item, int *type) |
|
|
{ |
|
|
if (strcasecmp (item, "\\Answered") == 0) |
|
|
*type = MU_ATTRIBUTE_ANSWERED; |
|
|
else if (strcasecmp (item, "\\Deleted") == 0) |
|
|
*type = MU_ATTRIBUTE_DELETED; |
|
|
else if (strcasecmp (item, "\\Draft") == 0) |
|
|
*type = MU_ATTRIBUTE_DRAFT; |
|
|
else if (strcasecmp (item, "\\Flagged") == 0) |
|
|
*type = MU_ATTRIBUTE_FLAGGED; |
|
|
else if (strcasecmp (item, "\\Recent") == 0) |
|
|
*type = MU_ATTRIBUTE_RECENT; |
|
|
else if (strcasecmp (item, "\\Seen") == 0) |
|
|
*type = MU_ATTRIBUTE_SEEN; |
|
|
else |
|
|
return 0; |
|
|
return 1; |
|
|
} |
|