Fixup default SMS template to not include timestamp

This commit is contained in:
Richard Frith-Macdonald 2020-10-08 12:29:12 +01:00
parent 8969536f35
commit d5bf5edce1

View file

@ -1183,8 +1183,8 @@ replaceFields(NSDictionary *fields, NSString *template)
if (nil == s) if (nil == s)
{ {
/* Use few spaces so that more of the /* Use few spaces so that more of the
* message fits into an Sms. */ * message fits into an Sms. Omit Timestamp */
s = @"{Server}({Host}):{Timestamp} {Type}-{Message}"; s = @"{Server}({Host}) {Type}-{Message}";
} }
} }
[event->m setObject: s forKey: @"Replacement"]; [event->m setObject: s forKey: @"Replacement"];
@ -1771,21 +1771,11 @@ replaceFields(NSDictionary *fields, NSString *template)
NSEnumerator *e = [destinations objectEnumerator]; NSEnumerator *e = [destinations objectEnumerator];
NSString *d; NSString *d;
NSString *s; NSString *s;
NSString *t;
/* /*
* Perform {field-name} substitutions, but to shorten the message * Perform {field-name} substitutions.
* remove any Timestamp value from the dictionary.
*/ */
t = RETAIN([m objectForKey: @"Timestamp"]);
[m removeObjectForKey: @"Timestamp"];
s = replaceFields(m, [m objectForKey: @"Replacement"]); s = replaceFields(m, [m objectForKey: @"Replacement"]);
if (t != nil)
{
[m setObject: t forKey: @"Timestamp"];
RELEASE(t);
}
if (sms == nil) if (sms == nil)
{ {
sms = [NSMutableDictionary new]; sms = [NSMutableDictionary new];