failed = TRUE;
}
}
- return failed ? -1 : 0;
+ return failed ? -1 : (changed ? 1 : 0);
}
struct subsfile_list_context *
/* Returns the next subscribed mailbox, or NULL. */
const char *subsfile_list_next(struct subsfile_list_context *ctx);
+/* Returns 1 if subscribed, 0 if no changes done, -1 if error. */
int subsfile_set_subscribed(struct mailbox_list *list, const char *path,
const char *temp_prefix, const char *name,
bool set);
const char *name, bool set)
{
uint8_t guid[MAIL_GUID_128_SIZE];
+ int ret;
- if (list->v.set_subscribed(list, name, set) < 0)
- return -1;
+ if ((ret = list->v.set_subscribed(list, name, set)) <= 0)
+ return ret;
/* subscriptions are about names, not about mailboxes. it's possible
to have a subscription to nonexistent mailbox. renames also don't