Added the possibility of retreiving the number of unseen
messages from the INBOX. Monotone-Parent: 043af14fd2ae984a7c53179d03394ad062129d22 Monotone-Revision: 22a0204fbcb44500dd41a225b263a8be90401353 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-10-03T13:54:24 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
95f54c2c96
commit
4109cf5e27
|
@ -35,6 +35,7 @@
|
||||||
NSString *trashFolderName;
|
NSString *trashFolderName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (WOResponse *) statusFoldersAction;
|
||||||
- (WOResponse *) listMailboxesAction;
|
- (WOResponse *) listMailboxesAction;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -122,6 +122,40 @@
|
||||||
return folders;
|
return folders;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSDictionary *) _statusFolders
|
||||||
|
{
|
||||||
|
SOGoMailFolder *inbox;
|
||||||
|
NGImap4Client *client;
|
||||||
|
SOGoMailAccount *co;
|
||||||
|
NSNumber *unseen;
|
||||||
|
|
||||||
|
co = [self clientObject];
|
||||||
|
inbox = [co inboxFolderInContext: context];
|
||||||
|
client = [[inbox imap4Connection] client];
|
||||||
|
unseen = [[client status: [inbox relativeImap4Name] flags: [NSArray arrayWithObject: @"UNSEEN"]]
|
||||||
|
objectForKey: @"unseen"];
|
||||||
|
|
||||||
|
if (!unseen)
|
||||||
|
unseen = [NSNumber numberWithInt: 0];
|
||||||
|
|
||||||
|
return [NSDictionary dictionaryWithObjectsAndKeys: unseen, @"unseen", nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (WOResponse *) statusFoldersAction
|
||||||
|
{
|
||||||
|
WOResponse *response;
|
||||||
|
NSDictionary *data;
|
||||||
|
|
||||||
|
response = [self responseWithStatus: 200];
|
||||||
|
data = [self _statusFolders];
|
||||||
|
|
||||||
|
[response setHeader: @"text/plain; charset=utf-8"
|
||||||
|
forKey: @"content-type"];
|
||||||
|
[response appendContentString: [data jsonRepresentation]];
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
- (WOResponse *) listMailboxesAction
|
- (WOResponse *) listMailboxesAction
|
||||||
{
|
{
|
||||||
id infos, inboxQuota;
|
id infos, inboxQuota;
|
||||||
|
|
|
@ -372,6 +372,11 @@
|
||||||
actionClass = "UIxMailFolderActions";
|
actionClass = "UIxMailFolderActions";
|
||||||
actionName = "createFolder";
|
actionName = "createFolder";
|
||||||
};
|
};
|
||||||
|
statusFolders = {
|
||||||
|
protectedBy = "View";
|
||||||
|
actionClass = "UIxMailAccountActions";
|
||||||
|
actionName = "statusFolders";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue