mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-02-16 00:21:01 +00:00
tagging
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@36497 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
43a8768871
commit
d8038e3c02
2 changed files with 30 additions and 3 deletions
11
EcAlerter.h
11
EcAlerter.h
|
@ -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
|
||||
|
|
22
EcAlerter.m
22
EcAlerter.m
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue