*
* This is an implementation of the Bynari variant of the METADATA extension.
*
+ * Copyright (c) 2007-2009 by the citadel.org team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "citserver.h"
#include "support.h"
#include "config.h"
-#include "room_ops.h"
#include "user_ops.h"
#include "policy.h"
#include "database.h"
#include "imap_misc.h"
#include "genstamp.h"
-
+#include "ctdl_module.h"
/*
* Implements the SETMETADATA command.
set_view = VIEW_MAILBOX;
}
- ret = imap_grabroom(roomname, parms[2], 0);
+ ret = imap_grabroom(roomname, parms[2], 1);
if (ret != 0) {
cprintf("%s NO Invalid mailbox name or access denied\r\n",
parms[0]);
}
/*
- * usergoto() formally takes us to the desired room. (If another
+ * CtdlUserGoto() formally takes us to the desired room. (If another
* folder is selected, save its name so we can return there!!!!!)
*/
if (IMAP->selected) {
strcpy(savedroom, CC->room.QRname);
}
- usergoto(roomname, 0, 0, &msgs, &new);
+ CtdlUserGoto(roomname, 0, 0, &msgs, &new);
/*
* Always set the per-user view to the requested one.
)
|| (msgs == 0) /* hack: if room is empty, assume we just created it */
) {
- lgetroom(&CC->room, CC->room.QRname);
+ CtdlGetRoomLock(&CC->room, CC->room.QRname);
CC->room.QRdefaultview = set_view;
- lputroom(&CC->room);
+ CtdlPutRoomLock(&CC->room);
cprintf("%s OK SETANNOTATION complete\r\n", parms[0]);
}
* If a different folder was previously selected, return there now.
*/
if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
- usergoto(savedroom, 0, 0, &msgs, &new);
+ CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
}
return;
}
return;
}
- ret = imap_grabroom(roomname, parms[2], 0);
+ ret = imap_grabroom(roomname, parms[2], 1);
if (ret != 0) {
cprintf("%s NO Invalid mailbox name or access denied\r\n",
parms[0]);
}
/*
- * usergoto() formally takes us to the desired room. (If another
+ * CtdlUserGoto() formally takes us to the desired room. (If another
* folder is selected, save its name so we can return there!!!!!)
*/
if (IMAP->selected) {
strcpy(savedroom, CC->room.QRname);
}
- usergoto(roomname, 0, 0, &msgs, &new);
+ CtdlUserGoto(roomname, 0, 0, &msgs, &new);
cprintf("* METADATA ");
imap_strout(parms[2]);
else if (!strcasecmp(&CC->room.QRname[11], SENTITEMS)) {
cprintf("mail.sentitems");
}
+ else if (!strcasecmp(&CC->room.QRname[11], USERDRAFTROOM)) {
+ cprintf("mail.drafts");
+ }
else if (!strcasecmp(&CC->room.QRname[11], USERCALENDARROOM)) {
cprintf("event.default");
}
* If a different folder was previously selected, return there now.
*/
if ( (IMAP->selected) && (strcasecmp(roomname, savedroom)) ) {
- usergoto(savedroom, 0, 0, &msgs, &new);
+ CtdlUserGoto(savedroom, 0, 0, &msgs, &new);
}
cprintf("%s OK GETMETADATA complete\r\n", parms[0]);