adium 4348:e7cdff6666ab: Unquarantine .chatlog files after openi...

commits at adium.im commits at adium.im
Sun Dec 4 22:49:13 UTC 2011


details:	http://hg.adium.im/adium/rev/e7cdff6666ab
revision:	4348:e7cdff6666ab
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Sun Dec 04 23:48:34 2011 +0100

Unquarantine .chatlog files after opening them. These files are always safe.

Refs #15573

diffs (24 lines):

diff -r 5be91264f5d8 -r e7cdff6666ab Source/AIXMLAppender.m
--- a/Source/AIXMLAppender.m	Sun Dec 04 16:41:29 2011 -0500
+++ b/Source/AIXMLAppender.m	Sun Dec 04 23:48:34 2011 +0100
@@ -242,6 +242,20 @@
 			[self.fileHandle seekToFileOffset:sb.st_size - closingTagLength];
 		}
 	}
+	
+	// Make sure the log file is *not* quarantined. We created it ourself.
+	// Trust me, it's safe. (Really.)
+	FSRef fsRef;
+	
+	// The properties have to be unset on the .chatlog itself, not the .xml in it
+	if (FSPathMakeRef((UInt8 const *)[[self.path stringByDeletingLastPathComponent] fileSystemRepresentation], &fsRef, NULL) == noErr) {
+		if (LSSetItemAttribute(&fsRef, kLSRolesAll, kLSItemQuarantineProperties, NULL) != noErr) {
+			AILogWithSignature(@"Un-quarantining file %@ failed!", [self.path stringByDeletingLastPathComponent]);
+		}
+		AILogWithSignature(@"Un-quarantining file %@ succeeded!", [self.path stringByDeletingLastPathComponent]);
+	} else {
+		AILogWithSignature(@"Could not find file to quarantine: %@!", [self.path stringByDeletingLastPathComponent]);
+	}
 }
 
 /*!




More information about the commits mailing list