Messages: Fix misc issues.

This commit is contained in:
Nate
2019-09-23 21:49:22 -06:00
parent 49ae3ec3da
commit 1acf6cbf24
2 changed files with 26 additions and 7 deletions

View File

@@ -45,6 +45,7 @@
$user_uuid = $row['user_uuid'];
$authorized = true;
}
unset($sql, $parameters, $row);
//authorization failed
if (!$authorized) {

View File

@@ -82,8 +82,16 @@
$numbers[] = $number_to;
}
switch ($message['message_direction']) {
case 'inbound': $contact[$number_from]['contact_uuid'] = $message['contact_uuid']; break;
case 'outbound': $contact[$number_to]['contact_uuid'] = $message['contact_uuid']; break;
case 'inbound':
if (!is_uuid($contact[$number_from]['contact_uuid'])) {
$contact[$number_from]['contact_uuid'] = $message['contact_uuid'];
}
break;
case 'outbound':
if (!is_uuid($contact[$number_to]['contact_uuid'])) {
$contact[$number_to]['contact_uuid'] = $message['contact_uuid'];
}
break;
}
unset($number_from, $number_to);
}
@@ -131,8 +139,14 @@
}
}
unset($sql, $parameters, $rows, $row);
if (!is_null(array_diff($numbers, $destinations))) {
if (
is_array($numbers) &&
@sizeof($numbers) != 0 &&
is_array($destinations) &&
@sizeof($destinations) != 0 &&
!is_null(array_diff($numbers, $destinations))
) {
$numbers = array_diff($numbers, $destinations);
}
@@ -209,9 +223,6 @@
echo "</td></tr>\n";
}
echo "</table>\n";
echo "<center>\n";
echo " <span id='contacts_refresh_state'><img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick=\"refresh_contacts_stop();\" alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\"></span> ";
echo "</center>\n";
echo "<script>\n";
foreach ($numbers as $number) {
@@ -221,5 +232,12 @@
}
echo "</script>\n";
}
else {
echo "<div style='padding: 15px;'><center>&middot;&middot;&middot;</center>";
}
echo "<center>\n";
echo " <span id='contacts_refresh_state'><img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 3px; cursor: pointer;' onclick=\"refresh_contacts_stop();\" alt=\"".$text['label-refresh_pause']."\" title=\"".$text['label-refresh_pause']."\"></span> ";
echo "</center>\n";
?>