2011-03-07 23:17:14 +01:00
|
|
|
/* MAPIStoreFAIMessage.m - this file is part of SOGo
|
|
|
|
*
|
2012-08-17 21:04:57 +02:00
|
|
|
* Copyright (C) 2011-2012 Inverse inc
|
2011-03-07 23:17:14 +01:00
|
|
|
*
|
|
|
|
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
|
|
|
*
|
|
|
|
* 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
|
2011-08-12 17:02:01 +02:00
|
|
|
* the Free Software Foundation; either version 3, or (at your option)
|
2011-03-07 23:17:14 +01:00
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This file is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2012-06-01 17:15:30 +02:00
|
|
|
#import <SOGo/SOGoUser.h>
|
|
|
|
|
2011-07-13 23:41:58 +02:00
|
|
|
#import "MAPIStoreActiveTables.h"
|
2011-12-01 23:36:35 +01:00
|
|
|
#import "MAPIStoreContext.h"
|
2012-01-29 20:55:21 +01:00
|
|
|
#import "MAPIStoreUserContext.h"
|
2011-07-20 20:28:37 +02:00
|
|
|
#import "NSObject+MAPIStore.h"
|
2011-07-13 23:41:58 +02:00
|
|
|
|
2011-03-07 23:17:14 +01:00
|
|
|
#import "MAPIStoreFAIMessage.h"
|
|
|
|
|
2011-07-13 23:41:58 +02:00
|
|
|
#undef DEBUG
|
2012-04-04 16:33:59 +02:00
|
|
|
#include <stdbool.h>
|
2011-11-09 16:02:29 +01:00
|
|
|
#include <talloc.h>
|
|
|
|
#include <util/time.h>
|
2011-07-13 23:41:58 +02:00
|
|
|
#include <mapistore/mapistore.h>
|
2011-12-01 23:36:35 +01:00
|
|
|
#include <mapistore/mapistore_errors.h>
|
2011-07-13 23:41:58 +02:00
|
|
|
|
2011-03-07 23:17:14 +01:00
|
|
|
@implementation MAPIStoreFAIMessage
|
|
|
|
|
2011-07-13 23:41:58 +02:00
|
|
|
- (NSArray *) activeContainerMessageTables
|
|
|
|
{
|
|
|
|
return [[MAPIStoreActiveTables activeTables]
|
|
|
|
activeTablesForFMID: [container objectId]
|
|
|
|
andType: MAPISTORE_FAI_TABLE];
|
|
|
|
}
|
|
|
|
|
2012-03-02 21:44:24 +01:00
|
|
|
- (int) getPidTagAssociated: (void **) data
|
|
|
|
inMemCtx: (TALLOC_CTX *) memCtx
|
2011-06-07 02:17:46 +02:00
|
|
|
{
|
2011-07-11 23:40:47 +02:00
|
|
|
return [self getYes: data inMemCtx: memCtx];
|
2011-06-07 02:17:46 +02:00
|
|
|
}
|
|
|
|
|
2013-03-13 20:04:11 +01:00
|
|
|
- (enum mapistore_error) saveMessage: (TALLOC_CTX *) memCtx;
|
2011-12-01 23:36:35 +01:00
|
|
|
{
|
|
|
|
enum mapistore_error rc;
|
|
|
|
MAPIStoreContext *context;
|
2012-01-29 20:55:21 +01:00
|
|
|
SOGoUser *ownerUser;
|
2011-12-01 23:36:35 +01:00
|
|
|
|
|
|
|
context = [self context];
|
2012-01-29 20:55:21 +01:00
|
|
|
ownerUser = [[self userContext] sogoUser];
|
|
|
|
if ([[context activeUser] isEqual: ownerUser])
|
2013-03-13 20:04:11 +01:00
|
|
|
rc = [super saveMessage: memCtx];
|
2011-12-01 23:36:35 +01:00
|
|
|
else
|
|
|
|
rc = MAPISTORE_ERR_DENIED;
|
|
|
|
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
2011-12-02 00:04:20 +01:00
|
|
|
- (BOOL) subscriberCanReadMessage
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL) subscriberCanModifyMessage
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
2011-03-07 23:17:14 +01:00
|
|
|
@end
|