diff options
-rw-r--r-- | src/misc/importanceHelper.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/misc/importanceHelper.cpp b/src/misc/importanceHelper.cpp index 96f80183..37612085 100644 --- a/src/misc/importanceHelper.cpp +++ b/src/misc/importanceHelper.cpp @@ -63,6 +63,7 @@ const importanceHelper::Importance importanceHelper::getImportance(const ref <co const importanceHelper::Importance importanceHelper::getImportance(const ref <const header> hdr) { + // Try "X-Priority" field try { const ref <const defaultField> fld = hdr->findField("X-Priority").dynamicCast <const defaultField>(); @@ -88,15 +89,24 @@ const importanceHelper::Importance importanceHelper::getImportance(const ref <co } catch (exceptions::no_such_field) { - const ref <const defaultField> fld = hdr->findField("Importance").dynamicCast <const defaultField>(); - const string value = utility::stringUtils::toLower(utility::stringUtils::trim(fld->getValue())); - - if (value == "low") - return (IMPORTANCE_LOWEST); - else if (value == "high") - return (IMPORTANCE_HIGHEST); - else + // Try "Importance" field + try + { + const ref <const defaultField> fld = hdr->findField("Importance").dynamicCast <const defaultField>(); + const string value = utility::stringUtils::toLower(utility::stringUtils::trim(fld->getValue())); + + if (value == "low") + return (IMPORTANCE_LOWEST); + else if (value == "high") + return (IMPORTANCE_HIGHEST); + else + return (IMPORTANCE_NORMAL); + } + catch (exceptions::no_such_field) + { + // Default return (IMPORTANCE_NORMAL); + } } // Should not go here... |