aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/channel.php6
-rw-r--r--include/connections.php6
-rw-r--r--include/features.php4
3 files changed, 11 insertions, 5 deletions
diff --git a/include/channel.php b/include/channel.php
index 4a87ef602..296f84c7b 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -2725,7 +2725,7 @@ function anon_identity_init($reqvars) {
$hash = hash('md5',$anon_email);
- $x = q("select * from xchan where xchan_guid = '%s' and xchan_hash = '%s' and xchan_network = 'unknown' limit 1",
+ $x = q("select * from xchan where xchan_guid = '%s' and xchan_hash = '%s' and xchan_network = 'anon' limit 1",
dbesc($anon_email),
dbesc($hash)
);
@@ -2736,12 +2736,12 @@ function anon_identity_init($reqvars) {
'xchan_hash' => $hash,
'xchan_name' => $anon_name,
'xchan_url' => $anon_url,
- 'xchan_network' => 'unknown',
+ 'xchan_network' => 'anon',
'xchan_name_date' => datetime_convert()
]);
- $x = q("select * from xchan where xchan_guid = '%s' and xchan_hash = '%s' and xchan_network = 'unknown' limit 1",
+ $x = q("select * from xchan where xchan_guid = '%s' and xchan_hash = '%s' and xchan_network = 'anon' limit 1",
dbesc($anon_email),
dbesc($hash)
);
diff --git a/include/connections.php b/include/connections.php
index 8d1b9e07f..e5bf07d96 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -110,6 +110,12 @@ function vcard_from_xchan($xchan, $observer = null, $mode = '') {
$connect = t('Connect');
}
+ // don't provide a connect button for transient or one-way identities
+
+ if(in_array($xchan['xchan_network'],['rss','anon','unknown']) || strpos($xchan['xchan_addr'],'guest:') === 0) {
+ $connect = false;
+ }
+
if(array_key_exists('channel_id',$xchan))
App::$profile_uid = $xchan['channel_id'];
diff --git a/include/features.php b/include/features.php
index 36f4f0433..c865f6754 100644
--- a/include/features.php
+++ b/include/features.php
@@ -44,7 +44,7 @@ function feature_level($feature,$def) {
return $def;
}
-function get_features($filtered = true) {
+function get_features($filtered = true, $level = (-1)) {
$account = \App::get_account();
@@ -508,7 +508,7 @@ function get_features($filtered = true) {
$arr = $x['features'];
- $techlevel = get_account_techlevel();
+ $techlevel = (($level >= 0) ? $level : get_account_techlevel());
// removed any locked features and remove the entire category if this makes it empty