Commit 6a161127 6a1611277377bbff3631748d7f41297704eba470 by Sergey Poznyakoff

(fetch_flags0): New function. Produces untagged

fetch response for FETCH and STORE commands. If necessary outputs
also UID.
1 parent 1db967b3
...@@ -282,14 +282,22 @@ fetch_envelope (struct fetch_command *command, char **arg) ...@@ -282,14 +282,22 @@ fetch_envelope (struct fetch_command *command, char **arg)
282 282
283 /* FLAGS: The flags that are set for this message. */ 283 /* FLAGS: The flags that are set for this message. */
284 /* FIXME: User flags not done. If enable change the PERMANENTFLAGS in SELECT */ 284 /* FIXME: User flags not done. If enable change the PERMANENTFLAGS in SELECT */
285 static int 285 void
286 fetch_flags (struct fetch_command *command, char **arg) 286 fetch_flags0 (const char *prefix, message_t msg, int isuid)
287 { 287 {
288 attribute_t attr = NULL; 288 attribute_t attr = NULL;
289 int space = 0; 289 int space = 0;
290 (void)arg; /* No argments. */ 290
291 message_get_attribute (command->msg, &attr); 291 message_get_attribute (msg, &attr);
292 util_send ("%s (", command->name); 292 if (isuid)
293 {
294 struct fetch_command *fcmd = &fetch_command_table[F_UID];
295 fcmd->msg = msg;
296 util_send ("(");
297 fetch_uid (fcmd, NULL);
298 util_send (" ");
299 }
300 util_send ("%s (", prefix);
293 if (attribute_is_deleted (attr)) 301 if (attribute_is_deleted (attr))
294 { 302 {
295 util_send ("\\Deleted"); 303 util_send ("\\Deleted");
...@@ -322,10 +330,19 @@ fetch_flags (struct fetch_command *command, char **arg) ...@@ -322,10 +330,19 @@ fetch_flags (struct fetch_command *command, char **arg)
322 util_send (" "); 330 util_send (" ");
323 util_send (" \\Draft"); 331 util_send (" \\Draft");
324 } 332 }
333 if (isuid)
334 util_send (")");
325 util_send (")"); 335 util_send (")");
336 }
337
338 static int
339 fetch_flags (struct fetch_command *command, char **arg)
340 {
341 fetch_flags0 (command->name, command->msg, 0);
326 return RESP_OK; 342 return RESP_OK;
327 } 343 }
328 344
345
329 /* INTERNALDATE The internal date of the message. 346 /* INTERNALDATE The internal date of the message.
330 Format: 347 Format:
331 348
......