Added missing functions getClient and IsSieveServerConnected and the changes that comes with it
This commit is contained in:
parent
342b68fd44
commit
877082f042
|
@ -22,6 +22,7 @@
|
||||||
#define UIXPREFERENCES_H
|
#define UIXPREFERENCES_H
|
||||||
|
|
||||||
#import <SOGoUI/UIxComponent.h>
|
#import <SOGoUI/UIxComponent.h>
|
||||||
|
#import <NGImap4/NGSieveClient.h>
|
||||||
|
|
||||||
@class NSString;
|
@class NSString;
|
||||||
|
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
{
|
{
|
||||||
id item;
|
id item;
|
||||||
SOGoUser *user;
|
SOGoUser *user;
|
||||||
|
NGSieveClient *client;
|
||||||
|
|
||||||
// Addressbook
|
// Addressbook
|
||||||
NSMutableDictionary *addressBooksIDWithDisplayName;
|
NSMutableDictionary *addressBooksIDWithDisplayName;
|
||||||
|
@ -61,6 +63,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) userLongDateFormat;
|
- (NSString *) userLongDateFormat;
|
||||||
|
- (BOOL) isSieveServerAvailable;
|
||||||
|
- (id) getClient;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,12 @@ static NSArray *reminderValues = nil;
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
item = nil;
|
item = nil;
|
||||||
|
<<<<<<< HEAD
|
||||||
addressBooksIDWithDisplayName = nil;
|
addressBooksIDWithDisplayName = nil;
|
||||||
|
=======
|
||||||
|
client = [self getClient];
|
||||||
|
|
||||||
|
>>>>>>> Added missing functions getClient and IsSieveServerConnected and the changes that comes with it
|
||||||
#warning user should be the owner rather than the activeUser
|
#warning user should be the owner rather than the activeUser
|
||||||
ASSIGN (user, [context activeUser]);
|
ASSIGN (user, [context activeUser]);
|
||||||
ASSIGN (today, [NSCalendarDate date]);
|
ASSIGN (today, [NSCalendarDate date]);
|
||||||
|
@ -179,7 +184,11 @@ static NSArray *reminderValues = nil;
|
||||||
[contactsCategories release];
|
[contactsCategories release];
|
||||||
[forwardOptions release];
|
[forwardOptions release];
|
||||||
[daysOfWeek release];
|
[daysOfWeek release];
|
||||||
|
<<<<<<< HEAD
|
||||||
[addressBooksIDWithDisplayName release];
|
[addressBooksIDWithDisplayName release];
|
||||||
|
=======
|
||||||
|
[client release];
|
||||||
|
>>>>>>> Added missing functions getClient and IsSieveServerConnected and the changes that comes with it
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -919,26 +928,15 @@ static NSArray *reminderValues = nil;
|
||||||
|
|
||||||
- (NSString *) sieveCapabilities
|
- (NSString *) sieveCapabilities
|
||||||
{
|
{
|
||||||
#warning sieve caps should be deduced from the server
|
|
||||||
static NSArray *capabilities = nil;
|
static NSArray *capabilities = nil;
|
||||||
SOGoMailAccounts *folder;
|
|
||||||
SOGoMailAccount *account;
|
|
||||||
SOGoSieveManager *manager;
|
|
||||||
NGSieveClient *client;
|
|
||||||
|
|
||||||
if (!capabilities)
|
if (!capabilities)
|
||||||
{
|
{
|
||||||
folder = [[self clientObject] mailAccountsFolder: @"Mail"
|
|
||||||
inContext: context];
|
|
||||||
account = [folder lookupName: @"0" inContext: context acquire: NO];
|
|
||||||
manager = [SOGoSieveManager sieveManagerForUser: [context activeUser]];
|
|
||||||
client = [manager clientForAccount: account];
|
|
||||||
|
|
||||||
if (client)
|
if (client)
|
||||||
capabilities = [client capabilities];
|
capabilities = [client capabilities];
|
||||||
else
|
else
|
||||||
capabilities = [NSArray array];
|
capabilities = [NSArray array];
|
||||||
[capabilities retain];
|
[capabilities retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [capabilities jsonRepresentation];
|
return [capabilities jsonRepresentation];
|
||||||
|
@ -1216,12 +1214,36 @@ static NSArray *reminderValues = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
- (NSString *) sogoVersion
|
- (NSString *) sogoVersion
|
||||||
{
|
{
|
||||||
// The variable SOGoVersion comes from the import: SOGo/Build.h
|
// The variable SOGoVersion comes from the import: SOGo/Build.h
|
||||||
return [NSString stringWithString: SOGoVersion];
|
return [NSString stringWithString: SOGoVersion];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=======
|
||||||
|
- (id) getClient{
|
||||||
|
SOGoMailAccount *account;
|
||||||
|
SOGoMailAccounts *folder;
|
||||||
|
SOGoSieveManager *manager;
|
||||||
|
NGSieveClient *realClient;
|
||||||
|
|
||||||
|
folder = [[self clientObject] mailAccountsFolder: @"Mail" inContext: context];
|
||||||
|
account = [folder lookupName: @"0" inContext: context acquire: NO];
|
||||||
|
manager = [SOGoSieveManager sieveManagerForUser: [context activeUser]];
|
||||||
|
realClient = [manager clientForAccount: account];
|
||||||
|
|
||||||
|
return realClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) isSieveServerAvailable {
|
||||||
|
return (([client isConnected])
|
||||||
|
? true
|
||||||
|
: false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
>>>>>>> Added missing functions getClient and IsSieveServerConnected and the changes that comes with it
|
||||||
- (id <WOActionResults>) defaultAction
|
- (id <WOActionResults>) defaultAction
|
||||||
{
|
{
|
||||||
id <WOActionResults> results;
|
id <WOActionResults> results;
|
||||||
|
|
Loading…
Reference in a new issue