view src/imap/cmd-subscribe.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 cc795d74d08f
children 31c4bb26a1e9
line wrap: on
line source

/* Copyright (C) 2002 Timo Sirainen */

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

int _cmd_subscribe_full(struct client *client, int subscribe)
{
	const char *mailbox;

	/* <mailbox> */
	if (!client_read_string_args(client, 1, &mailbox))
		return FALSE;

	if (!client_verify_mailbox_name(client, mailbox, subscribe, FALSE))
		return TRUE;

	if (client->storage->set_subscribed(client->storage,
					    mailbox, subscribe)) {
		client_send_tagline(client, subscribe ?
				    "OK Subscribe completed." :
				    "OK Unsubscribe completed.");
	} else {
		client_send_storage_error(client);
	}

	return TRUE;
}

int cmd_subscribe(struct client *client)
{
	return _cmd_subscribe_full(client, TRUE);
}