aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-22 22:03:19 -0700
committerfriendica <info@friendica.com>2014-09-22 22:03:19 -0700
commite8854bb19dae01b18d2eb13af76d277847bdbb5a (patch)
tree1011266737b735fbd978aed7a60ff4f9c47256c9 /include
parentfb05919d90cac9bb360bbb62b7e89d5c0e59b484 (diff)
downloadvolse-hubzilla-e8854bb19dae01b18d2eb13af76d277847bdbb5a.tar.gz
volse-hubzilla-e8854bb19dae01b18d2eb13af76d277847bdbb5a.tar.bz2
volse-hubzilla-e8854bb19dae01b18d2eb13af76d277847bdbb5a.zip
better way to deal with effective_uid
Diffstat (limited to 'include')
-rw-r--r--include/conversation.php10
-rw-r--r--include/text.php10
2 files changed, 10 insertions, 10 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 17792e09a..b0a388a68 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1230,19 +1230,11 @@ function add_children_to_list($children, &$arr) {
}
}
-function conv_sort($arr,$order,$uid = 0) {
+function conv_sort($arr,$order) {
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/include/text.php b/include/text.php
index 599c5d445..573af4d32 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1851,9 +1851,17 @@ function ids_to_querystr($arr,$idx = 'id') {
// author_xchan and owner_xchan. If $abook is true also include the abook info.
// This is needed in the API to save extra per item lookups there.
-function xchan_query(&$items,$abook = true) {
+function xchan_query(&$items,$abook = true,$effective_uid = 0) {
$arr = array();
if($items && count($items)) {
+
+ if($effective_uid) {
+ for($x = 0; $x < count($items); $x ++) {
+ $items[$x]['real_uid'] = $items[$x]['uid'];
+ $items[$x]['uid'] = $effective_uid;
+ }
+ }
+
foreach($items as $item) {
if($item['owner_xchan'] && (! in_array($item['owner_xchan'],$arr)))
$arr[] = "'" . dbesc($item['owner_xchan']) . "'";