From d5bf5edce10d5844713b4dcc1af918730c1ba897 Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Thu, 8 Oct 2020 12:29:12 +0100 Subject: [PATCH] Fixup default SMS template to not include timestamp --- EcAlerter.m | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/EcAlerter.m b/EcAlerter.m index 49e619e..a55d942 100644 --- a/EcAlerter.m +++ b/EcAlerter.m @@ -1183,8 +1183,8 @@ replaceFields(NSDictionary *fields, NSString *template) if (nil == s) { /* Use few spaces so that more of the - * message fits into an Sms. */ - s = @"{Server}({Host}):{Timestamp} {Type}-{Message}"; + * message fits into an Sms. Omit Timestamp */ + s = @"{Server}({Host}) {Type}-{Message}"; } } [event->m setObject: s forKey: @"Replacement"]; @@ -1771,21 +1771,11 @@ replaceFields(NSDictionary *fields, NSString *template) NSEnumerator *e = [destinations objectEnumerator]; NSString *d; NSString *s; - NSString *t; /* - * Perform {field-name} substitutions, but to shorten the message - * remove any Timestamp value from the dictionary. + * Perform {field-name} substitutions. */ - t = RETAIN([m objectForKey: @"Timestamp"]); - [m removeObjectForKey: @"Timestamp"]; s = replaceFields(m, [m objectForKey: @"Replacement"]); - if (t != nil) - { - [m setObject: t forKey: @"Timestamp"]; - RELEASE(t); - } - if (sms == nil) { sms = [NSMutableDictionary new];