From 59649948d3d3bd149acc905951f59a3b30dc72c8 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Sun, 26 Jun 2016 16:50:04 +0000 Subject: [PATCH] Repaired active mode... --- include/functions.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/functions.php b/include/functions.php index a9f126b..4fb1635 100644 --- a/include/functions.php +++ b/include/functions.php @@ -296,8 +296,18 @@ function getActualMode($metaLastHeard, $mmdvmconfigs) { $now = new DateTime(); $hangtime = getConfigItem("General", "ModeHang", $mmdvmconfigs); - $timestamp->add(new DateInterval('PT' . $hangtime . 'S')); - + + if ($hangtime != "") { + $timestamp->add(new DateInterval('PT' . $hangtime . 'S')); + } else { + $source = $listElem[6]; + if ($source === "Network") { + $hangtime = getConfigItem("General", "NetModeHang", $mmdvmconfigs); + } else { + $hangtime = getConfigItem("General", "RFModeHang", $mmdvmconfigs); + } + $timestamp->add(new DateInterval('PT' . $hangtime . 'S')); + } if ($now->format('U') > $timestamp->format('U')) { return "idle"; } else {