diff options
author | zotlabs <mike@macgirvin.com> | 2017-01-28 15:01:19 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-01-28 15:01:19 -0800 |
commit | 5aa0017e91cac135ef8b84c138becb09decb1d58 (patch) | |
tree | c44b5632ab4493bfc8731b7614e8ee66bf260bca /include/network.php | |
parent | f90d5f3dc8b26d5a1fd3e44013385bda9a7361b2 (diff) | |
download | volse-hubzilla-5aa0017e91cac135ef8b84c138becb09decb1d58.tar.gz volse-hubzilla-5aa0017e91cac135ef8b84c138becb09decb1d58.tar.bz2 volse-hubzilla-5aa0017e91cac135ef8b84c138becb09decb1d58.zip |
provide lowlevel xchan storage function to ensure that all non-null rows are initialised
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/include/network.php b/include/network.php index 4391f1bfe..73fd417ea 100644 --- a/include/network.php +++ b/include/network.php @@ -1121,16 +1121,17 @@ function discover_by_url($url,$arr = null) { if(! $photo) $photo = z_root() . '/images/rss_icon.png'; - $r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_pubkey, xchan_addr, xchan_url, xchan_name, xchan_network, xchan_instance_url, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", - dbesc($guid), - dbesc($guid), - dbesc($pubkey), - dbesc($addr), - dbesc($profile), - dbesc($name), - dbesc($network), - dbesc(z_root()), - dbesc(datetime_convert()) + $r = xchan_store_lowlevel( + [ + 'xchan_hash' => $guid, + 'xchan_guid' => $guid, + 'xchan_pubkey' => $pubkey, + 'xchan_addr' => $addr, + 'xchan_url' => $profile, + 'xchan_name' => $name, + 'xchan_name_date' => datetime_convert(), + 'xchan_network' => $network + ] ); $photos = import_xchan_photo($photo,$guid); @@ -1449,6 +1450,20 @@ function discover_by_webbie($webbie) { ); } else { + + $r = xchan_store_lowlevel( + [ + 'xchan_hash' => $address, + 'xchan_guid' => (($diaspora_guid) ? $diaspora_guid : $location), + 'xchan_pubkey' => $pubkey, + 'xchan_addr' => $address, + 'xchan_url' => $location, + 'xchan_name' => $fullname, + 'xchan_name_date' => datetime_convert(), + 'xchan_network' => $network + ] + ); + $r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_pubkey, xchan_addr, xchan_url, xchan_name, xchan_network, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", dbesc($address), dbesc(($diaspora_guid) ? $diaspora_guid : $location), |