aboutsummaryrefslogtreecommitdiffstats
path: root/include/hubloc.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-04-23 19:49:41 -0700
committerfriendica <info@friendica.com>2015-04-23 19:49:41 -0700
commit6679734135fb04f4a7beccb81663bf1e9574f062 (patch)
tree887488543d98b5dd297d917718bdd99844e83ba5 /include/hubloc.php
parent08b757a22cd2804bfec8ecf682b6987b8c06ca49 (diff)
parentc696860cc53bc25558d83de5eda65d9b583da382 (diff)
downloadvolse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.gz
volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.tar.bz2
volse-hubzilla-6679734135fb04f4a7beccb81663bf1e9574f062.zip
Merge branch 'master' into tres
Conflicts: include/Contact.php include/ItemObject.php include/api.php include/attach.php include/diaspora.php include/dir_fns.php include/enotify.php include/event.php include/expire.php include/items.php include/notifier.php include/notify.php include/photos.php include/taxonomy.php include/text.php include/widgets.php include/zot.php mod/admin.php mod/channel.php mod/dirsearch.php mod/display.php mod/editwebpage.php mod/events.php mod/home.php mod/item.php mod/manage.php mod/mood.php mod/network.php mod/page.php mod/photos.php mod/ping.php mod/post.php mod/thing.php mod/viewsrc.php view/css/mod_events.css
Diffstat (limited to 'include/hubloc.php')
-rw-r--r--include/hubloc.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/hubloc.php b/include/hubloc.php
index 2367744ec..515223f53 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -169,10 +169,22 @@ function hubloc_change_primary($hubloc) {
return true;
}
-
+
+// We use the post url to distinguish between http and https hublocs.
+// The https might be alive, and the http dead.
+
+function hubloc_mark_as_down($posturl) {
+ $r = q("update hubloc set hubloc_status = ( hubloc_status | %d ) where hubloc_callback = '%s'",
+ intval(HUBLOC_OFFLINE),
+ dbesc($posturl)
+ );
+}
+
function xchan_store($arr) {
+ logger('xchan_store: ' . print_r($arr,true));
+
if(! $arr['hash'])
$arr['hash'] = $arr['guid'];
if(! $arr['hash'])
@@ -191,7 +203,7 @@ function xchan_store($arr) {
if(! $arr['url'])
$arr['url'] = z_root();
if(! $arr['photo'])
- $arr['photo'] = get_default_profile_photo();
+ $arr['photo'] = z_root() . '/' . get_default_profile_photo();
$r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_addr, xchan_url, xchan_connurl, xchan_follow, xchan_connpage, xchan_name, xchan_network, xchan_instance_url, xchan_hidden, xchan_orphan, xchan_censored, xchan_selfcensored, xchan_system, xchan_pubforum, xchan_deleted, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s','%s','%s','%s',%d, %d, %d, %d, %d, %d, %d, '%s') ",
dbesc($arr['hash']),
@@ -251,12 +263,12 @@ function xchan_fetch($arr) {
if(! $key)
return false;
- $r = q("select * from xchan where $key = '$v'");
+ $r = q("select * from xchan where $key = '$v' limit 1");
if(! $r)
return false;
$ret = array();
- foreach($r as $k => $v) {
+ foreach($r[0] as $k => $v) {
if($k === 'xchan_addr')
$ret['address'] = $v;
else