aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-29 22:24:37 -0700
committerfriendica <info@friendica.com>2013-09-29 22:24:37 -0700
commit49882c13a4fb67da29862034ddcfd9a55757f2ee (patch)
tree30995b77da5d7529f41b45de350022361853bd2f
parent3f79a9581ad5effef1f231d6d6d37c03f02121f5 (diff)
downloadvolse-hubzilla-49882c13a4fb67da29862034ddcfd9a55757f2ee.tar.gz
volse-hubzilla-49882c13a4fb67da29862034ddcfd9a55757f2ee.tar.bz2
volse-hubzilla-49882c13a4fb67da29862034ddcfd9a55757f2ee.zip
there's our directory sync packet (aka transaction log). Now we just have to pass them around and act on them.
-rw-r--r--mod/dirsearch.php18
1 files changed, 14 insertions, 4 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 3fec691be..a7e785c1b 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -135,11 +135,21 @@ function dirsearch_content(&$a) {
if($sync) {
-
- $r = q("select xchan.*, updates.* from xchan left join updates on ud_hash = xchan_hash where ud_date >= '%s' and ud_guid != '' order by ud_date desc",
+ $spkt = array('transactions' => array());
+ $r = q("select * from updates where ud_date >= '%s' and ud_guid != '' order by ud_date desc",
dbesc($sync)
);
-
+ if($r) {
+ foreach($r as $rr) {
+ $spkt['transactions'][] = array(
+ 'hash' => $rr['ud_hash'],
+ 'address' => $rr['ud_addr'],
+ 'transaction_id' => $rr['ud_guid'],
+ 'timestamp' => $rr['ud_date']
+ );
+ }
+ }
+ json_return_and_die($spkt);
}
else {
$r = q("SELECT xchan.*, xprof.* from xchan left join xprof on xchan_hash = xprof_hash where $logic $sql_extra and not ( xchan_flags & %d ) and not ( xchan_flags & %d ) $safesql $order $qlimit ",
@@ -183,7 +193,7 @@ function dirsearch_content(&$a) {
}
$ret['results'] = $entries;
- if(($kw) && (! $sync)) {
+ if($kw) {
$k = dir_tagadelic($kw);
if($k) {
$ret['keywords'] = array();