aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinclude/diaspora.php53
-rw-r--r--mod/network.php4
-rw-r--r--view/theme/redbasic/css/style.css5
3 files changed, 41 insertions, 21 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index da55b8fb6..e3bfc2806 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -805,11 +805,6 @@ function diaspora_post($importer,$xml,$msg) {
}
- if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream'))) {
- logger('diaspora_post: Ignoring this author.');
- return 202;
- }
-
$search_guid = ((strlen($guid) == 64) ? $guid . '%' : $guid);
$r = q("SELECT id FROM item WHERE uid = %d AND mid like '%s' LIMIT 1",
@@ -889,6 +884,15 @@ function diaspora_post($importer,$xml,$msg) {
$datarray['item_flags'] = ITEM_THREAD_TOP;
$datarray['item_unseen'] = 1;
+
+ $tgroup = tgroup_check($importer['channel_id'],$datarray);
+
+ if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream')) && (! $tgroup)) {
+ logger('diaspora_post: Ignoring this author.');
+ return 202;
+ }
+
+
$result = item_store($datarray);
return;
@@ -955,11 +959,6 @@ function diaspora_reshare($importer,$xml,$msg) {
if(! $contact)
return;
- if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream'))) {
- logger('diaspora_reshare: Ignoring this author: ' . $diaspora_handle . ' ' . print_r($xml,true));
- return 202;
- }
-
$search_guid = ((strlen($guid) == 64) ? $guid . '%' : $guid);
$r = q("SELECT id FROM item WHERE uid = %d AND mid like '%s' LIMIT 1",
intval($importer['channel_id']),
@@ -1072,6 +1071,15 @@ function diaspora_reshare($importer,$xml,$msg) {
$datarray['app'] = 'Diaspora';
+
+ $tgroup = tgroup_check($importer['channel_id'],$datarray);
+
+ if((! $importer['system']) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream')) && (! $tgroup)) {
+ logger('diaspora_post: Ignoring this author.');
+ return 202;
+ }
+
+
$result = item_store($datarray);
return;
@@ -1229,15 +1237,6 @@ function diaspora_comment($importer,$xml,$msg) {
if(intval($parent_item['item_private']))
$pubcomment = 0;
- // So basically if something arrives at the sys channel it's by definition public and we allow it.
- // If $pubcomment and the parent was public, we allow it.
- // In all other cases, honour the permissions for this Diaspora connection
-
- if((! $importer['system']) && (! $pubcomment) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'post_comments'))) {
- logger('diaspora_comment: Ignoring this author.');
- return 202;
- }
-
$search_guid = $guid;
if(strlen($guid) == 64)
$search_guid = $guid . '%';
@@ -1382,6 +1381,22 @@ function diaspora_comment($importer,$xml,$msg) {
$datarray['diaspora_meta'] = json_encode(crypto_encapsulate(json_encode($x),$key));
}
+
+
+ // So basically if something arrives at the sys channel it's by definition public and we allow it.
+ // If $pubcomment and the parent was public, we allow it.
+ // In all other cases, honour the permissions for this Diaspora connection
+
+ $tgroup = tgroup_check($importer['channel_id'],$datarray);
+
+ if((! $importer['system']) && (! $pubcomment) && (! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'post_comments')) && (! $tgroup)) {
+ logger('diaspora_comment: Ignoring this author.');
+ return 202;
+ }
+
+
+
+
$result = item_store($datarray);
if($result && $result['success'])
diff --git a/mod/network.php b/mod/network.php
index b2888b223..691e860d7 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -337,16 +337,16 @@ function network_content(&$a, $update = 0, $load = false) {
}
+ $abook_uids = " and abook.abook_channel = " . local_channel() . " ";
+
if($firehose && (! get_config('system','disable_discover_tab'))) {
require_once('include/identity.php');
$sys = get_sys_channel();
$uids = " and item.uid = " . intval($sys['channel_id']) . " ";
$a->data['firehose'] = intval($sys['channel_id']);
- $abook_uids = "";
}
else {
$uids = " and item.uid = " . local_channel() . " ";
- $abook_uids = " and abook.abook_channel = " . local_channel() . " ";
}
if(get_pconfig(local_channel(),'system','network_list_mode'))
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index da75cf3f8..b01e03636 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -2001,6 +2001,11 @@ blockquote {
border-radius: $radiuspx;
}
+nav .badge {
+ padding: 5px 6px;
+ border-radius: 9px;
+}
+
nav .badge:hover {
background-color: #999;
}