view src/imap/cmd-rename.c @ 903:fd8888f6f037 HEAD

Naming style changes, finally got tired of most of the typedefs. Also the previous enum -> macro change reverted so that we don't use the highest bit anymore, that's incompatible with old indexes so they will be rebuilt.
author Timo Sirainen <tss@iki.fi>
date Sun, 05 Jan 2003 15:09:51 +0200
parents 20769b7516a2
children 31c4bb26a1e9
line wrap: on
line source

/* Copyright (C) 2002 Timo Sirainen */

#include "common.h"
#include "commands.h"

int cmd_rename(struct client *client)
{
	const char *oldname, *newname;

	/* <old name> <new name> */
	if (!client_read_string_args(client, 2, &oldname, &newname))
		return FALSE;

	if (!client_verify_mailbox_name(client, newname, FALSE, TRUE))
		return TRUE;

	if (client->storage->rename_mailbox(client->storage,
					    oldname, newname))
		client_send_tagline(client, "OK Rename completed.");
	else
		client_send_storage_error(client);

	return TRUE;
}