git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@36497 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-04-09 13:12:59 +00:00
parent 43a8768871
commit d8038e3c02
2 changed files with 30 additions and 3 deletions

View file

@ -116,6 +116,17 @@
* them to a nice readable version, and also match a default rule to
* log full details to the technical team.</em>
* </desc>
* <term>Tag</term>
* <desc>Specifies a tag to be associated with this event during execution
* of any subsequent rules (until/unless the event is re-tagged).<br />
* The tag actually associated with the event is obtained by treating
* the tag value as a template and substituting in any values (as for
* the Replace and Rewrite fields).
* </desc>
* <term>Tagged</term>
* <desc>The message is matched if (and only if) it has been tagged
* with a value exactly equal to the value of this field.
* </desc>
* <term>Flush</term>
* <desc>A boolean (YES or NO) saying whether stored messages due to
* be sent out later should be sent out immediately after processing

View file

@ -478,6 +478,13 @@ replaceFields(NSDictionary *fields, NSString *template)
RELEASE(pool);
pool = [NSAutoreleasePool new];
d = [rules objectAtIndex: i];
s = [d objectForKey: @"Tagged"];
if (s != nil && NO == [s isEqual: [m objectForKey: @"Tag"]])
{
continue; // Not a match.
}
s = [d objectForKey: @"Type"];
if (s != nil && [s isEqualToString: type] == NO)
{
@ -573,10 +580,15 @@ replaceFields(NSDictionary *fields, NSString *template)
[m setObject: s forKey: @"Message"];
}
/* Remove any old Replacement setting ... will set up specifically
* for the output alert type later.
/* Set the tag for this event if necessary ... done *after*
* all matching, but before sending out the alerts.
*/
[m removeObjectForKey: @"Replacement"];
if (nil != [d objectForKey: @"Tag"])
{
NSString *s = replaceFields(m, [d objectForKey: @"Tag"]);
[m setObject: s forKey: @"Tag"];
}
NS_DURING
{
@ -614,6 +626,7 @@ replaceFields(NSDictionary *fields, NSString *template)
localException);
}
NS_ENDHANDLER
[m removeObjectForKey: @"Replacement"];
NS_DURING
{
@ -659,6 +672,7 @@ replaceFields(NSDictionary *fields, NSString *template)
localException);
}
NS_ENDHANDLER
[m removeObjectForKey: @"Replacement"];
NS_DURING
{
@ -731,6 +745,7 @@ replaceFields(NSDictionary *fields, NSString *template)
localException);
}
NS_ENDHANDLER
[m removeObjectForKey: @"Replacement"];
[m removeObjectForKey: @"EmailIdentifier"];
[m removeObjectForKey: @"EmailInReplyTo"];
@ -772,6 +787,7 @@ replaceFields(NSDictionary *fields, NSString *template)
localException);
}
NS_ENDHANDLER
[m removeObjectForKey: @"Replacement"];
s = [d objectForKey: @"Flush"];
if (s != nil)