App.Models.ImapFolder = Backbone.Model.extend({
	defaults: {
		localName:'',
		globalName:'',
		newName:null,
		selectable:false,
		isMainFolder:0,
		hasChildren:false
	},

	sync: function(method,model,options){
		options || (options = {});
		url = App.baseUrl + '/inbox/folder';
		
		switch(method){
			case "read":
			case "create":
				options.url = url+'?acct='+this.collection.getCurrentAcct();
				break;
			case "delete":
			case "update":
				options.url = url+'/'+this.id+'?acct='+this.collection.getCurrentAcct();
		}

		if(options.url){
			return Backbone.sync.call(model, method, model, options);
		}
	}
});

