aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-10-23 19:41:42 -0700
committerfriendica <info@friendica.com>2014-10-23 19:41:42 -0700
commitf524fb1f20ec3edb0cf2c486d41f6bb65a60db6a (patch)
treed1d4c4ef2e2e637ed25352cd99e0ecbd2a698fa6
parent241bb3b94059ac4edfcc3b66e907dbf493dd8b4a (diff)
downloadvolse-hubzilla-f524fb1f20ec3edb0cf2c486d41f6bb65a60db6a.tar.gz
volse-hubzilla-f524fb1f20ec3edb0cf2c486d41f6bb65a60db6a.tar.bz2
volse-hubzilla-f524fb1f20ec3edb0cf2c486d41f6bb65a60db6a.zip
generalise the output format of xchan_fetch so it matches the input format
-rw-r--r--include/hubloc.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/hubloc.php b/include/hubloc.php
index df817329f..0a1b51331 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -247,5 +247,15 @@ function xchan_fetch($arr) {
return false;
$r = q("select * from xchan where $key = '$v'");
- return $r;
+ if(! $r)
+ return false;
+
+ $ret = array();
+ foreach($r as $k => $v) {
+ if($k === 'xchan_addr')
+ $ret['address'] = $v;
+ else
+ $ret[str_replace('xchan_','',$k)] = $v;
+ }
+ return $ret;
} \ No newline at end of file