aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-15 03:48:43 -0700
committerfriendica <info@friendica.com>2013-09-15 03:48:43 -0700
commit129a119c84d87bffe099cea7ac5b0ed511c26f80 (patch)
tree831b0d681e2748aded17bc59ee4580a72ecd5cd5 /include/zot.php
parentaefb0f823353d15a281d3c94ec6fc044e1b62580 (diff)
downloadvolse-hubzilla-129a119c84d87bffe099cea7ac5b0ed511c26f80.tar.gz
volse-hubzilla-129a119c84d87bffe099cea7ac5b0ed511c26f80.tar.bz2
volse-hubzilla-129a119c84d87bffe099cea7ac5b0ed511c26f80.zip
implement what I hope will now be the server side of directory sync, add viewsrc to item_photo_menu, and log what changed in import_xchan update objects so we can find out why there are so many updates when nothing _obvious_ has changed that should trigger it.
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/include/zot.php b/include/zot.php
index 53031a6c5..c461486f0 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -417,6 +417,7 @@ function import_xchan($arr) {
$dirmode = intval(get_config('system','directory_mode'));
$changed = false;
+ $what = '';
if(! (is_array($arr) && array_key_exists('success',$arr) && $arr['success'])) {
logger('import_xchan: invalid data packet: ' . print_r($arr,true));
@@ -492,7 +493,7 @@ function import_xchan($arr) {
logger('import_xchan: existing: ' . print_r($r[0],true), LOGGER_DATA);
logger('import_xchan: new: ' . print_r($arr,true), LOGGER_DATA);
-
+ $what .= 'xchan ';
$changed = true;
}
}
@@ -532,6 +533,7 @@ function import_xchan($arr) {
intval($new_flags)
);
+ $what .= 'new_xchan';
$changed = true;
}
@@ -552,7 +554,7 @@ function import_xchan($arr) {
dbesc($xchan_hash)
);
-
+ $what .= 'photo ';
$changed = true;
}
@@ -605,6 +607,7 @@ function import_xchan($arr) {
dbesc(datetime_convert()),
intval($r[0]['hubloc_id'])
);
+ $what = 'primary_hub ';
$changed = true;
}
continue;
@@ -644,7 +647,7 @@ function import_xchan($arr) {
dbesc(datetime_convert()),
dbesc(datetime_convert())
);
-
+ $what .= 'newhub ';
$changed = true;
}
@@ -656,7 +659,7 @@ function import_xchan($arr) {
$r = q("delete from hubloc where hubloc_id = %d limit 1",
intval($x['hubloc_id'])
);
-
+ $what .= 'removed_hub';
$changed = true;
}
}
@@ -670,7 +673,7 @@ function import_xchan($arr) {
if(array_key_exists('profile',$arr) && is_array($arr['profile'])) {
$profile_changed = import_directory_profile($xchan_hash,$arr['profile']);
if($profile_changed) {
-
+ $what .= 'profile ';
$changed = true;
}
}
@@ -689,6 +692,7 @@ function import_xchan($arr) {
if(array_key_exists('site',$arr) && is_array($arr['site'])) {
$profile_changed = import_site($arr['site'],$arr['key']);
if($profile_changed) {
+ $what .= 'site ';
$changed = true;
}
}
@@ -698,6 +702,7 @@ function import_xchan($arr) {
if($changed) {
$guid = random_string() . '@' . get_app()->get_hostname();
update_modtime($xchan_hash,$guid);
+ logger('import_xchan: changed: ' . $what,LOGGER_DEBUG);
}
if(! x($ret,'message')) {
@@ -1396,6 +1401,7 @@ function import_directory_profile($hash,$profile) {
$update = false;
foreach($r[0] as $k => $v) {
if((array_key_exists($k,$arr)) && ($arr[$k] != $v)) {
+ logger('import_directory_profile: update' . $k . ' => ' . $arr[$k]);
$update = true;
break;
}
@@ -1431,6 +1437,7 @@ function import_directory_profile($hash,$profile) {
}
else {
$update = true;
+ logger('import_directory_profile: new profile');
$x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_age, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_keywords) values ('%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
dbesc($arr['xprof_hash']),
dbesc($arr['xprof_desc']),