aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-22 21:37:19 -0700
committerfriendica <info@friendica.com>2014-09-22 21:37:19 -0700
commitfb05919d90cac9bb360bbb62b7e89d5c0e59b484 (patch)
treea223ce505137d1ddbfa17132c46bf09e3ed511c1
parentb735961560d676f46bc43679f169ec2b0134de69 (diff)
downloadvolse-hubzilla-fb05919d90cac9bb360bbb62b7e89d5c0e59b484.tar.gz
volse-hubzilla-fb05919d90cac9bb360bbb62b7e89d5c0e59b484.tar.bz2
volse-hubzilla-fb05919d90cac9bb360bbb62b7e89d5c0e59b484.zip
make discover items interactive
-rw-r--r--include/ConversationObject.php12
-rw-r--r--include/ItemObject.php12
-rw-r--r--include/conversation.php10
-rw-r--r--mod/network.php2
-rw-r--r--mod/viewsrc.php5
5 files changed, 30 insertions, 11 deletions
diff --git a/include/ConversationObject.php b/include/ConversationObject.php
index 767ef7360..c0fc376ae 100644
--- a/include/ConversationObject.php
+++ b/include/ConversationObject.php
@@ -52,14 +52,14 @@ class Conversation extends BaseObject {
switch($mode) {
case 'network':
- if(array_key_exists('firehose',$a->data) && intval($a->data['firehose'])) {
- $this->profile_owner = intval($a->data['firehose']);
- $this->writable = false;
- }
- else {
+// if(array_key_exists('firehose',$a->data) && intval($a->data['firehose'])) {
+// $this->profile_owner = intval($a->data['firehose']);
+// $this->writable = false;
+// }
+// else {
$this->profile_owner = local_user();
$this->writable = true;
- }
+// }
break;
case 'channel':
$this->profile_owner = $a->profile['profile_uid'];
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 96abe4df6..7c75e35bd 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -101,11 +101,19 @@ class Item extends BaseObject {
else
$edpost = false;
+
if($observer['xchan_hash'] == $this->get_data_value('author_xchan')
|| $observer['xchan_hash'] == $this->get_data_value('owner_xchan')
|| $this->get_data_value('uid') == local_user())
$dropping = true;
+
+ if(array_key_exists('real_uid',$item)) {
+ $edpost = false;
+ $dropping = false;
+ }
+
+
if($dropping) {
$drop = array(
'dropping' => $dropping,
@@ -119,7 +127,7 @@ class Item extends BaseObject {
);
}
- $filer = (($conv->get_profile_owner() == local_user()) ? t("Save to Folder") : false);
+ $filer = ((($conv->get_profile_owner() == local_user()) && (! array_key_exists('real_uid',$item))) ? t("Save to Folder") : false);
$profile_avatar = $item['author']['xchan_photo_m'];
$profile_link = chanlink_url($item['author']['xchan_url']);
@@ -163,7 +171,7 @@ class Item extends BaseObject {
if($this->is_toplevel()) {
// FIXME check this permission
- if($conv->get_profile_owner() == local_user()) {
+ if(($conv->get_profile_owner() == local_user()) && (! array_key_exists('real_uid',$item))) {
// FIXME we don't need all this stuff, some can be done in the template
diff --git a/include/conversation.php b/include/conversation.php
index b0a388a68..17792e09a 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1230,11 +1230,19 @@ function add_children_to_list($children, &$arr) {
}
}
-function conv_sort($arr,$order) {
+function conv_sort($arr,$order,$uid = 0) {
if((!(is_array($arr) && count($arr))))
return array();
+ if($uid) {
+ for($x = 0; $x < count($arr); $x ++) {
+ $arr[$x]['real_uid'] = $arr[$x]['uid'];
+ $arr[$x]['uid'] = $uid;
+ }
+ }
+
+
$parents = array();
$children = array();
diff --git a/mod/network.php b/mod/network.php
index 97870a6a1..2b07bb139 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -405,7 +405,7 @@ function network_content(&$a, $update = 0, $load = false) {
xchan_query($items);
$items = fetch_post_tags($items,true);
- $items = conv_sort($items,$ordering);
+ $items = conv_sort($items,$ordering,(($firehose) ? local_user() : 0));
}
else {
$items = array();
diff --git a/mod/viewsrc.php b/mod/viewsrc.php
index ddf39535c..982d1c417 100644
--- a/mod/viewsrc.php
+++ b/mod/viewsrc.php
@@ -5,6 +5,8 @@ function viewsrc_content(&$a) {
$o = '';
+ $sys = get_sys_channel();
+
$item_id = ((argc() > 1) ? intval(argv(1)) : 0);
$json = ((argc() > 2 && argv(2) === 'json') ? true : false);
@@ -19,8 +21,9 @@ function viewsrc_content(&$a) {
}
if(local_user() && $item_id) {
- $r = q("select item_flags, body from item where item_restrict = 0 and uid = %d and id = %d limit 1",
+ $r = q("select item_flags, body from item where item_restrict = 0 and uid in (%d , %d) and id = %d limit 1",
intval(local_user()),
+ intval($sys['channel_id']),
intval($item_id)
);