From 7355eae1dc7a04eac5cc46b4e95e57a461a71db6 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Fri, 10 Jan 2014 14:10:53 -0500 Subject: [PATCH] Now able to set Active Sync metadata in the user settings --- SoObjects/SOGo/SOGoUserSettings.h | 12 +++++++++--- SoObjects/SOGo/SOGoUserSettings.m | 28 +++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/SoObjects/SOGo/SOGoUserSettings.h b/SoObjects/SOGo/SOGoUserSettings.h index 6a07fb962..673f148c8 100644 --- a/SoObjects/SOGo/SOGoUserSettings.h +++ b/SoObjects/SOGo/SOGoUserSettings.h @@ -1,8 +1,6 @@ /* SOGoUserSettings.h - this file is part of SOGo * - * Copyright (C) 2009 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2009-2013 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +24,7 @@ #import "SOGoDefaultsSource.h" @class NSArray; +@class NSMutableDictionary; @class NSString; @interface SOGoUserSettings : SOGoDefaultsSource @@ -35,6 +34,13 @@ - (NSArray *) subscribedCalendars; - (NSArray *) subscribedAddressBooks; + +/* Microsoft Active Sync support */ +- (void) setMicrosoftActiveSyncMetadata: (NSDictionary *) theMetadata + forDevice: (NSString *) theDeviceID; + +- (NSMutableDictionary *) microsoftActiveSyncMetadataForDevice: (NSString *) theDevice; + @end #endif /* SOGOUSERSETTINGS_H */ diff --git a/SoObjects/SOGo/SOGoUserSettings.m b/SoObjects/SOGo/SOGoUserSettings.m index 9739e6f85..107b5d835 100644 --- a/SoObjects/SOGo/SOGoUserSettings.m +++ b/SoObjects/SOGo/SOGoUserSettings.m @@ -1,8 +1,6 @@ /* SOGoUserSettings.m - this file is part of SOGo * - * Copyright (C) 2009-2011 Inverse inc. - * - * Author: Wolfgang Sourdeau + * Copyright (C) 2009-2013 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,4 +69,28 @@ static Class SOGoUserProfileKlass = Nil; return [self _subscribedFoldersForModule: @"Contacts"]; } +/* Microsoft Active Sync support */ +- (void) setMicrosoftActiveSyncMetadata: (NSDictionary *) theMetadata + forDevice: (NSString *) theDeviceID +{ + if (theMetadata && theDeviceID) + { + NSMutableDictionary *d; + + d = [NSMutableDictionary dictionaryWithDictionary: [self dictionaryForKey: @"SOGoMicrosoftActiveSyncMetadata"]]; + [d setObject: theMetadata forKey: theDeviceID]; + + [self setObject: d forKey: @"SOGoMicrosoftActiveSyncMetadata"]; + } +} + +- (NSMutableDictionary *) microsoftActiveSyncMetadataForDevice: (NSString *) theDevice +{ + NSDictionary *d; + + d = [self dictionaryForKey: @"SOGoMicrosoftActiveSyncMetadata"]; + + return [NSMutableDictionary dictionaryWithDictionary: [d objectForKey: theDevice]]; +} + @end