mirror of
https://github.com/friendica/friendica
synced 2025-05-02 09:44:23 +02:00
Merge branch 'rewrites/dbm_is_result' of github.com:Quix0r/friendica into rewrites/dbm_is_result
Signed-off-by: Roland Häder <roland@mxchange.org> Conflicts: include/Photo.php include/api.php include/cache.php include/dbstructure.php include/enotify.php include/items.php include/onepoll.php include/queue_fn.php include/session.php include/text.php mod/contacts.php mod/dfrn_request.php mod/display.php mod/events.php mod/item.php mod/message.php mod/msearch.php mod/photos.php mod/poco.php mod/profile.php mod/proxy.php mod/videos.php update.php view/theme/diabook/theme.php view/theme/vier/theme.php
This commit is contained in:
commit
63610c7b73
33 changed files with 320 additions and 260 deletions
|
@ -24,7 +24,12 @@ function remove_queue_item($id) {
|
|||
*/
|
||||
function was_recently_delayed($cid) {
|
||||
|
||||
$was_delayed = false;
|
||||
$r = q("SELECT `id` FROM `queue` WHERE `cid` = %d
|
||||
and last > UTC_TIMESTAMP() - interval 15 minute limit 1",
|
||||
intval($cid)
|
||||
);
|
||||
if(dbm::is_result($r))
|
||||
return true;
|
||||
|
||||
// Are there queue entries that were recently added?
|
||||
$r = q("SELECT `id` FROM `queue` WHERE `cid` = %d
|
||||
|
@ -32,18 +37,7 @@ function was_recently_delayed($cid) {
|
|||
intval($cid)
|
||||
);
|
||||
|
||||
$was_delayed = dbm::is_result($r);
|
||||
|
||||
// We set "term-date" to a current date if the communication has problems.
|
||||
// If the communication works again we reset this value.
|
||||
if ($was_delayed) {
|
||||
$r = q("SELECT `term-date` FROM `contact` WHERE `id` = %d AND `term-date` <= '1000-01-01' LIMIT 1",
|
||||
intval($cid)
|
||||
);
|
||||
$was_delayed = !dbm::is_result($r);
|
||||
}
|
||||
|
||||
return $was_delayed;
|
||||
return (dbm::is_result($r));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue