diff options
author | zotlabs <mike@macgirvin.com> | 2019-05-06 04:15:34 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-05-06 04:15:34 -0700 |
commit | 6e0bf04276074ad958024133f52a3be0ce88801a (patch) | |
tree | ccac971e77745846cb8fc3d06bbeebe69cca159b | |
parent | 88d283a89d581222b9684f896f922aac55ab8a4d (diff) | |
download | volse-hubzilla-6e0bf04276074ad958024133f52a3be0ce88801a.tar.gz volse-hubzilla-6e0bf04276074ad958024133f52a3be0ce88801a.tar.bz2 volse-hubzilla-6e0bf04276074ad958024133f52a3be0ce88801a.zip |
possible xchan (protocol) confusion in include/follow
-rw-r--r-- | include/follow.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/follow.php b/include/follow.php index 1b35f1b32..7e0e1644a 100644 --- a/include/follow.php +++ b/include/follow.php @@ -169,18 +169,19 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) } if($wf || $d) { - $r = q("select * from xchan where xchan_hash = '%s' or xchan_url = '%s' limit 1", + $r = q("select * from xchan where xchan_hash = '%s' or xchan_url = '%s'", dbesc(($wf) ? $wf : $url), dbesc($url) ); } } + $xchan = zot_record_preferred($r,'xchan_network'); + // if discovery was a success we should have an xchan record in $r - if($r) { - $xchan = $r[0]; - $xchan_hash = $r[0]['xchan_hash']; + if($xchan) { + $xchan_hash = $xchan['xchan_hash']; $their_perms = 0; } } @@ -191,7 +192,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) return $result; } - $allowed = (($is_zot || in_array($r[0]['xchan_network'],['rss','zot6'])) ? 1 : 0); + $allowed = (($is_zot || in_array($xchan['xchan_network'],['rss','zot6'])) ? 1 : 0); $x = array('channel_id' => $uid, 'follow_address' => $url, 'xchan' => $r[0], 'allowed' => $allowed, 'singleton' => 0); |