aboutsummaryrefslogtreecommitdiffstats
path: root/mod/fhublocs.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-11-01 11:17:04 +0100
committerMario Vavti <mario@mariovavti.com>2015-11-01 11:17:04 +0100
commit0353b0e04f86945cb640f6e12031dd18981d5aeb (patch)
tree972b36210c15090bd6b915f2e3136bf3587bac9d /mod/fhublocs.php
parentd6d96e8c89918740f3fae5757124d2c9b58a3a81 (diff)
parentca81ab784a0d1975ae1780eb0b5003eb8fbb832f (diff)
downloadvolse-hubzilla-0353b0e04f86945cb640f6e12031dd18981d5aeb.tar.gz
volse-hubzilla-0353b0e04f86945cb640f6e12031dd18981d5aeb.tar.bz2
volse-hubzilla-0353b0e04f86945cb640f6e12031dd18981d5aeb.zip
Merge branch 'master' of https://github.com/redmatrix/hubzilla
Diffstat (limited to 'mod/fhublocs.php')
-rw-r--r--mod/fhublocs.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/mod/fhublocs.php b/mod/fhublocs.php
index d2f15b728..dce00e383 100644
--- a/mod/fhublocs.php
+++ b/mod/fhublocs.php
@@ -13,14 +13,24 @@ function fhublocs_content(&$a) {
$o = '';
$r = q("select * from channel where channel_removed = 0");
+ $sitekey = get_config('system','pubkey');
if($r) {
foreach($r as $rr) {
+ $found = false;
$primary_address = '';
$x = zot_get_hublocs($rr['channel_hash']);
if($x) {
- $o .= 'Hubloc exists for ' . $rr['channel_name'] . EOL;
- continue;
+ foreach($x as $xx) {
+ if($xx['hubloc_url'] === z_root() && $xx['hubloc_sitekey'] === $sitekey) {
+ $found = true;
+ break;
+ }
+ }
+ if($found) {
+ $o .= 'Hubloc exists for ' . $rr['channel_name'] . EOL;
+ continue;
+ }
}
$y = q("select xchan_addr from xchan where xchan_hash = '%s' limit 1",
dbesc($rr['channel_hash'])
@@ -53,7 +63,7 @@ function fhublocs_content(&$a) {
dbesc(base64url_encode(rsa_sign(z_root(),$rr['channel_prvkey']))),
dbesc(get_app()->get_hostname()),
dbesc(z_root() . '/post'),
- dbesc(get_config('system','pubkey')),
+ dbesc($sitekey),
dbesc('zot')
);