aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-07-30 19:04:17 -0700
committerMario Vavti <mario@mariovavti.com>2017-07-31 17:35:08 +0200
commita4a99d2d464971b39b4806556d8687ccb8b4ef86 (patch)
tree5f766da2a450ffed6b92b1eacbee44fb99b52f8b
parent2095937c600c1770f656ac6354340815b4fde73e (diff)
downloadvolse-hubzilla-a4a99d2d464971b39b4806556d8687ccb8b4ef86.tar.gz
volse-hubzilla-a4a99d2d464971b39b4806556d8687ccb8b4ef86.tar.bz2
volse-hubzilla-a4a99d2d464971b39b4806556d8687ccb8b4ef86.zip
ensure we can work around the $is_http var in include/follow - this is left over from when the only non-webfinger connections we could make were RSS/Atom feeds.
-rw-r--r--include/follow.php27
1 files changed, 13 insertions, 14 deletions
diff --git a/include/follow.php b/include/follow.php
index 2c2f5e209..9e2fd6a9c 100644
--- a/include/follow.php
+++ b/include/follow.php
@@ -182,6 +182,11 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
$hash = get_observer_hash();
$default_group = $channel['channel_default_group'];
+ if($hash == $xchan_hash) {
+ $result['message'] = t('Cannot connect to yourself.');
+ return $result;
+ }
+
if($xchan['xchan_network'] === 'rss') {
// check service class feed limits
@@ -196,28 +201,22 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
$result['message'] = upgrade_message();
return $result;
}
- }
- if($hash == $xchan_hash) {
- $result['message'] = t('Cannot connect to yourself.');
- return $result;
+ // Always set these "remote" permissions for feeds since we cannot interact with them
+ // to negotiate a suitable permission response
+
+ set_abconfig($uid,$xchan_hash,'their_perms','view_stream',1);
+ set_abconfig($uid,$xchan_hash,'their_perms','republish',1);
+
}
+
$r = q("select abook_id, abook_xchan, abook_pending, abook_instance from abook
where abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc($xchan_hash),
intval($uid)
);
- if($is_http) {
-
- // Always set these "remote" permissions for feeds since we cannot interact with them
- // to negotiate a suitable permission response
-
- set_abconfig($uid,$xchan_hash,'their_perms','view_stream',1);
- set_abconfig($uid,$xchan_hash,'their_perms','republish',1);
- }
-
if($r) {
$abook_instance = $r[0]['abook_instance'];
@@ -250,7 +249,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
'abook_channel' => intval($uid),
'abook_closeness' => intval($closeness),
'abook_xchan' => $xchan_hash,
- 'abook_feed' => intval(($is_http) ? 1 : 0),
+ 'abook_feed' => intval(($xchan['xchan_network'] === 'rss') ? 1 : 0),
'abook_created' => datetime_convert(),
'abook_updated' => datetime_convert(),
'abook_instance' => (($singleton) ? z_root() : '')