Minor fixes

Monotone-Parent: 8515028ade639f5e3e38f20b4eba28b16a1250b1
Monotone-Revision: b092fe6aebfa4e00c827df976eaa7e49cb1c6539

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-09-29T20:39:23
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert 2009-09-29 20:39:23 +00:00
parent 9493a33729
commit d871fe0bd8
2 changed files with 15 additions and 12 deletions

View file

@ -1145,14 +1145,20 @@ static NSString *spoolFolder = nil;
response = [_ctx response];
[response setStatus: 201];
msg = [SOGoMailObject objectWithName:
[NSString stringWithFormat: @"%d", imap4id]
[NSString stringWithFormat: @"%d", *imap4id]
inContainer: self];
if (msg)
if (msg && [msg doesMailExist])
{
location = [NSString stringWithFormat: @"%@%d.eml",
[self davURL], *imap4id];
[response setHeader: location forKey: @"location"];
}
else
{
response = (WOResponse *)
[NSException exceptionWithHTTPStatus: 500
reason: @"Failed to store message"];
}
}
return response;

View file

@ -1876,7 +1876,7 @@ function onLoadMailboxesCallback(http) {
}
function buildMailboxes(accountKeys, encoded) {
var account = new Mailbox("account", accountKeys);
var account = new Mailbox("account", accountKeys[0], null, accountKeys[1]);
var accountIndex = mailAccounts.indexOf(accountKeys);
var data = encoded.evalJSON(true);
var mailboxes = data.mailboxes;
@ -2288,16 +2288,13 @@ function getMenus() {
document.observe("dom:loaded", initMailer);
function Mailbox(type, name, unseen) {
function Mailbox(type, name, unseen, displayName) {
this.type = type;
if (typeof (name) == "object" && name.length == 2) {
this.name = name[0];
this.displayName = name[1];
}
else {
this.name = name;
this.displayName = name;
}
this.name = name;
if (displayName)
this.displayName = displayName;
else
this.displayName = name;
this.unseen = unseen;
this.parentFolder = null;
this.children = new Array();