Repaired active mode...

This commit is contained in:
dg9vh 2016-08-10 20:25:48 +00:00
parent fc0369be0f
commit d554429975
2 changed files with 22 additions and 19 deletions

View file

@ -298,25 +298,28 @@ function getActualMode($metaLastHeard, $mmdvmconfigs) {
if (startsWith($mode, "DMR")) { if (startsWith($mode, "DMR")) {
$mode = "DMR"; $mode = "DMR";
} }
if ($listElem[6] ==="") {
$now = new DateTime();
$hangtime = getConfigItem("General", "ModeHang", $mmdvmconfigs);
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 {
return $mode; return $mode;
} else {
$now = new DateTime();
$hangtime = getConfigItem("General", "ModeHang", $mmdvmconfigs);
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 {
return $mode;
}
} }
} }

View file

@ -1,3 +1,3 @@
<?php <?php
define("VERSION", "20160721-1"); define("VERSION", "20160810-1");
?> ?>