From b94f1603bb4891f9c000699d4583ceeffbe3acf1 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 30 Aug 2013 15:16:25 +0200 Subject: [PATCH] Implement CONTACTEMAIL and CONTACTPAGER macros. --- lib/icinga/user.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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; }