From: Gunnar Beutner Date: Fri, 30 Aug 2013 13:16:25 +0000 (+0200) Subject: Implement CONTACTEMAIL and CONTACTPAGER macros. X-Git-Tag: v0.0.3~639 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b94f1603bb4891f9c000699d4583ceeffbe3acf1;p=icinga2 Implement CONTACTEMAIL and CONTACTPAGER macros. --- diff --git a/lib/icinga/user.cpp b/lib/icinga/user.cpp index 649792422..2cda97928 100644 --- a/lib/icinga/user.cpp +++ b/lib/icinga/user.cpp @@ -128,10 +128,19 @@ bool User::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res *result = GetDisplayName(); return true; } else { + String tmacro; + + if (macro == "CONTACTEMAIL") + tmacro = "email"; + else if (macro == "CONTACTPAGER") + tmacro = "pager"; + else + tmacro = macro; + Dictionary::Ptr macros = GetMacros(); - if (macros && macros->Contains(macro)) { - *result = macros->Get(macro); + if (macros && macros->Contains(tmacro)) { + *result = macros->Get(tmacro); return true; }