diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-12-15 00:04:30 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-12-15 00:04:30 -0800 |
commit | 6f2a5117dc04267f7571314639e19265cfc21dec (patch) | |
tree | b4892f8007551fcdfa0bd38e1419fd312413d1d6 /include/queue_fn.php | |
parent | b13241564b994762e5c1a4747f74acc6cd27adf5 (diff) | |
download | volse-hubzilla-6f2a5117dc04267f7571314639e19265cfc21dec.tar.gz volse-hubzilla-6f2a5117dc04267f7571314639e19265cfc21dec.tar.bz2 volse-hubzilla-6f2a5117dc04267f7571314639e19265cfc21dec.zip |
more queue api
Diffstat (limited to 'include/queue_fn.php')
-rw-r--r-- | include/queue_fn.php | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/include/queue_fn.php b/include/queue_fn.php index 41001bb19..5c6570f66 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -1,16 +1,29 @@ <?php /** @file */ -function update_queue_time($id) { - logger('queue: requeue item ' . $id); - q("UPDATE outq SET outq_updated = '%s' WHERE outq_hash = '%s'", +function update_queue_time($id, $add_priority = 0) { + logger('queue: requeue item ' . $id,LOGGER_DEBUG); + q("UPDATE outq SET outq_updated = '%s', outq_priority = outq_priority + %d WHERE outq_hash = '%s'", dbesc(datetime_convert()), + intval($add_priority), dbesc($id) ); } -function remove_queue_item($id) { - logger('queue: remove queue item ' . $id); - q("DELETE FROM outq WHERE hash = '%s'", +function remove_queue_item($id,$channel_id = 0) { + logger('queue: remove queue item ' . $id,LOGGER_DEBUG); + $sql_extra = (($channel_id) ? " and outq_channel = " . intval($channel_id) . " " : ''); + + q("DELETE FROM outq WHERE outq_hash = '%s' $sql_extra", + dbesc($id) + ); +} + +function queue_set_delivered($id,$channel = 0) { + logger('queue: set delivered ' . $id,LOGGER_DEBUG); + $sql_extra = (($channel_id) ? " and outq_channel = " . intval($channel_id) . " " : ''); + + q("update outq set outq_delivered = 1, outq_updated = '%s' where outq_hash = '%s' $sql_extra ", + dbesc(datetime_convert()), dbesc($id) ); } |