8#include "../../ctdl_module.h"
23#include <libcitadel.h>
24#include "../../citadel.h"
25#include "../../server.h"
26#include "../../sysdep_decls.h"
27#include "../../citserver.h"
28#include "../../support.h"
29#include "../../config.h"
30#include "../../user_ops.h"
31#include "../../database.h"
32#include "../../room_ops.h"
33#include "../../msgbase.h"
34#include "../../internet_addressing.h"
39#include "../../genstamp.h"
49 if (!strncasecmp(oper,
"FLAGS", 5)) {
51 Imap->
flags[seq] |= bits_to_twiddle;
53 else if (!strncasecmp(oper,
"+FLAGS", 6)) {
54 Imap->
flags[seq] |= bits_to_twiddle;
56 else if (!strncasecmp(oper,
"-FLAGS", 6)) {
57 Imap->
flags[seq] &= (~bits_to_twiddle);
66 unsigned int bits_to_twiddle = 0;
74 int last_item_twiddled = (-1);
79 if (cbmstrcasestr(oper,
".SILENT")) {
85 if (ss_msglist == NULL)
return;
89 strcpy(whichflags, Cmd->
Params[i].Key);
90 if (whichflags[0]==
'(') {
91 safestrncpy(whichflags, &whichflags[1],
94 if (whichflags[strlen(whichflags)-1]==
')') {
95 whichflags[strlen(whichflags)-1]=0;
97 string_trim(whichflags);
102 num_flags = num_tokens(whichflags,
' ');
103 for (j=0; j<num_flags; ++j) {
104 extract_token(flag, whichflags, j,
' ',
sizeof flag);
106 if ((!strcasecmp(flag,
"\\Deleted"))
107 || (!strcasecmp(flag,
"Deleted"))) {
112 if ((!strcasecmp(flag,
"\\Seen"))
113 || (!strcasecmp(flag,
"Seen"))) {
116 if ((!strcasecmp(flag,
"\\Answered"))
117 || (!strcasecmp(flag,
"Answered"))) {
124 for (i = 0; i < Imap->
num_msgs; ++i) {
126 last_item_twiddled = i;
128 ss_msglist[num_ss++] = Imap->
msgids[i];
142 if ( (last_item_twiddled >= 0) && (num_ss > 0) ) {
174 IReply(
"BAD invalid parameters");
182 IReply(
"BAD invalid parameters");
187 Cmd.
CmdBuf = NewStrBufPlain(NULL, StrLength(
IMAP->Cmd.CmdBuf));
192 IReply(
"BAD invalid data item list");
199 IReply(
"OK STORE completed");
210 IReply(
"BAD invalid parameters");
218 IReply(
"BAD invalid parameters");
223 Cmd.
CmdBuf = NewStrBufPlain(NULL, StrLength(
IMAP->Cmd.CmdBuf));
228 IReply(
"BAD invalid data item list");
235 IReply(
"OK UID STORE completed");
void imap_pick_range(const char *supplied_range, int is_uid)
int imap_extract_data_items(citimap_command *Cmd)
void imap_fetch_flags(int seq)
void imap_store(int num_parms, ConstStr *Params)
void imap_do_store(citimap_command *Cmd)
void imap_do_store_msg(int seq, const char *oper, unsigned int bits_to_twiddle)
void imap_uidstore(int num_parms, ConstStr *Params)
void CtdlSetSeen(long *target_msgnums, int num_target_msgnums, int target_setting, int which_set, struct ctdluser *which_user, struct ctdlroom *which_room)
int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void)
void imap_rescan_msgids(void)
int imap_do_expunge(void)