+2004-11-11 Helge Hess <helge.hess@skyrix.com>
+
+ * v0.9.53
+
+ * SOGoMailAccounts.m: added -allFolderPathes methods to retrieve the
+ names of all folders associated with the account
+
+ * SOGoMailManager.m: added -allFoldersForURL:password: method
+
2004-11-09 Helge Hess <helge.hess@skyrix.com>
* added support for toggling mail flags (v0.9.52)
password, etc)
*/
+@class NSArray;
+
@interface SOGoMailAccount : SOGoMailBaseObject
{
}
+- (NSArray *)allFolderPathes;
+
@end
#endif /* __Mailer_SOGoMailAccount_H__ */
#include "SOGoMailAccount.h"
#include "SOGoMailFolder.h"
+#include "SOGoMailManager.h"
#include "SOGoDraftsFolder.h"
#include "common.h"
return self;
}
+- (NSArray *)allFolderPathes {
+ NSArray *pathes;
+
+ pathes = [[self mailManager] allFoldersForURL:[self imap4URL]
+ password:[self imap4Password]];
+ pathes = [pathes sortedArrayUsingSelector:@selector(compare:)];
+ return pathes;
+}
+
/* IMAP4 */
- (BOOL)useSSL {
- (NSString *)imap4Separator;
- (NSString *)imap4FolderNameForURL:(NSURL *)_url;
- (NSArray *)subfoldersForURL:(NSURL *)_url password:(NSString *)_pwd;
+- (NSArray *)allFoldersForURL:(NSURL *)_url password:(NSString *)_pwd;
/* messages */
/* folder hierarchy */
- (NSArray *)_getDirectChildren:(NSArray *)_array folderName:(NSString *)_fn {
+ /*
+ Scans string '_array' for strings which start with the string in '_fn'.
+ Then split on '/'.
+ */
NSMutableArray *ma;
unsigned i, count, prefixlen;
return names;
}
+- (NSArray *)extractFoldersFromResultSet:(NSDictionary *)_result {
+ /* Note: the result is normalized, that is, it contains / as the separator */
+ return [[_result valueForKey:@"list"] allKeys];
+}
+
- (NSArray *)subfoldersForURL:(NSURL *)_url password:(NSString *)_pwd {
- // TODO: add caching
SOGoMailConnectionEntry *entry;
NSDictionary *result;
/* check hierarchy cache */
if ((result = [entry cachedHierarchyResults]) != nil)
- return [self extractSubfoldersForURL:_url fromResultSet:result];
+ return [self extractSubfoldersForURL:_url fromResultSet:result];
[self debugWithFormat:@" no folders cached yet .."];
return [self extractSubfoldersForURL:_url fromResultSet:result];
}
+- (NSArray *)allFoldersForURL:(NSURL *)_url password:(NSString *)_pwd {
+ SOGoMailConnectionEntry *entry;
+ NSDictionary *result;
+
+ if (debugKeys)
+ [self debugWithFormat:@"folders for URL: %@ ...",[_url absoluteString]];
+
+ /* check connection cache */
+
+ if ((entry = [self entryForURL:_url password:_pwd]) == nil)
+ return nil;
+
+ /* check hierarchy cache */
+
+ if ((result = [entry cachedHierarchyResults]) != nil)
+ return [self extractFoldersFromResultSet:result];
+
+ [self debugWithFormat:@" no folders cached yet .."];
+
+ /* fetch _all_ folders */
+
+ result = [[entry client] list:@"INBOX" pattern:@"*"];
+ if (![[result valueForKey:@"result"] boolValue]) {
+ [self logWithFormat:@"ERROR: listing of folder failed!"];
+ return nil;
+ }
+
+ /* cache results */
+
+ if ([result isNotNull]) {
+ if (entry == nil) /* required in case the entry was not setup */
+ entry = [self entryForURL:_url];
+
+ [entry cacheHierarchyResults:result];
+ if (debugCache) {
+ [self logWithFormat:@"cached results in entry %@: 0x%08X(%d)",
+ entry, result, [result count]];
+ }
+ }
+
+ /* extract list */
+ return [self extractFoldersFromResultSet:result];
+}
+
/* messages */
- (NSArray *)fetchUIDsInURL:(NSURL *)_url qualifier:(id)_qualifier
# Version file
-SUBMINOR_VERSION:=52
+SUBMINOR_VERSION:=53
# v0.9.44 requires NGMime v4.3.194
# v0.9.41 requires NGMime v4.3.190
+2004-11-11 Helge Hess <helge.hess@skyrix.com>
+
+ * UIxMailListView.wox: added sample move popup (v0.9.62)
+
2004-11-09 Helge Hess <helge.hess@skyrix.com>
* UIxMailListView.m: added support for toggling read/unread flags
</tr>
</var:foreach>
-<!-- TODO: fix used tree, treeNavigationNodes is the _wrong_ choice
<tr class="tableview">
<td colspan="6" class="tbtv_actcell">
+<!-- TODO: fix used tree, treeNavigationNodes is the _wrong_ choice
<var:component className="UIxMailMoveToPopUp"
const:identifier="moveto"
const:callback="moveTo"
rootNodes="clientObject.treeNavigationNodes"
/>
+-->
+ <var:popup const:name="moveto" const:id="moveto"
+ list="clientObject.mailAccountFolder.allFolderPathes"
+ item="item" value="item" displayString="item" />
</td>
</tr>
--->
</table>
+
<span id="selected_uids" style="visibility: hidden;">
</span>
</div>
checked="1"
read="1"
><var:string label:value="MoveTo" const:escapeHTML="NO" /></option>
+
<var:foreach list="sortedNodes" item="item" >
<option var:value="itemURL"
var:onClick="selectItemJS"
var:otherTagString="itemDisabledValue"
><var:string value="itemDisplayString" /></option>
</var:foreach>
+
<option value="all" disabled="1" >All</option>
</select>
\ No newline at end of file
# $Id$
-SUBMINOR_VERSION:=61
+SUBMINOR_VERSION:=62
# v0.9.50 requires NGMime v4.3.190
# v0.9.43 requires NGObjWeb v4.3.73