mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-09 05:25:26 +00:00
Monotone-Parent: 9bdbe760f39fa9a2561fe56ce9dac03727cfb38f
Monotone-Revision: 8ef0ab24c4c10895d5e911f82260ba93fedbb853 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-10-29T21:38:25 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2007-10-29 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* GCSFolder.m ([GCSFolder -writeContent:toName:baseVersion:]):
|
||||
purge the record if previously marked as deleted.
|
||||
|
||||
2007-10-24 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* GCSFolderManager.m ([GCSFolderManager -baseTableNameWithUID:]):
|
||||
|
||||
@@ -303,6 +303,10 @@ static GCSStringFormatter *stringFormatter = nil;
|
||||
return [self _fetchValueOfColumn:@"c_version" inContentWithName:_name];
|
||||
}
|
||||
|
||||
- (NSNumber *)deletionOfContentWithName:(NSString *)_name {
|
||||
return [self _fetchValueOfColumn:@"c_deleted" inContentWithName:_name];
|
||||
}
|
||||
|
||||
- (NSString *)fetchContentWithName:(NSString *)_name {
|
||||
return [self _fetchValueOfColumn:@"c_content" inContentWithName:_name];
|
||||
}
|
||||
@@ -525,6 +529,21 @@ static GCSStringFormatter *stringFormatter = nil;
|
||||
return AUTORELEASE(qualifier);
|
||||
}
|
||||
|
||||
- (void) _purgeRecordWithName: (NSString *) recordName
|
||||
{
|
||||
NSString *delSql, *table;
|
||||
EOAdaptorChannel *channel;
|
||||
|
||||
channel = [self acquireStoreChannel];
|
||||
|
||||
table = [self storeTableName];
|
||||
delSql = [NSString stringWithFormat: @"DELETE FROM %@"
|
||||
@" WHERE c_name = %@", table,
|
||||
[self _formatRowValue: recordName]];
|
||||
[channel evaluateExpressionX: delSql];
|
||||
[self releaseChannel: channel];
|
||||
}
|
||||
|
||||
- (NSException *)writeContent:(NSString *)_content toName:(NSString *)_name
|
||||
baseVersion:(unsigned int)_baseVersion
|
||||
{
|
||||
@@ -561,6 +580,14 @@ static GCSStringFormatter *stringFormatter = nil;
|
||||
if (doLogStore)
|
||||
[self logWithFormat:@" version: %@", storedVersion];
|
||||
isNewRecord = [storedVersion isNotNull] ? NO : YES;
|
||||
if (!isNewRecord)
|
||||
{
|
||||
if ([[self deletionOfContentWithName:_name] isNotNull])
|
||||
{
|
||||
[self _purgeRecordWithName: _name];
|
||||
isNewRecord = YES;
|
||||
}
|
||||
}
|
||||
|
||||
/* check whether sequence matches */
|
||||
if (_baseVersion != 0 /* use 0 to override check */) {
|
||||
|
||||
Reference in New Issue
Block a user