aboutsummaryrefslogtreecommitdiffstats
path: root/include/Contact.php
diff options
context:
space:
mode:
authorThomas Willingham <founder@kakste.com>2013-08-14 20:44:17 +0100
committerThomas Willingham <founder@kakste.com>2013-08-14 20:44:17 +0100
commita0dfd44f9178796eaf55e4a2ab0194c12e7dfd21 (patch)
tree31a43380cbe93e28f27c69a7d676fe6bfafbb0f4 /include/Contact.php
parent94335f237fdadd93b86b271526c25c2a77de9c40 (diff)
parentde4e4c5ebd1ab746432b21d122b5f0cfb70a9bdd (diff)
downloadvolse-hubzilla-a0dfd44f9178796eaf55e4a2ab0194c12e7dfd21.tar.gz
volse-hubzilla-a0dfd44f9178796eaf55e4a2ab0194c12e7dfd21.tar.bz2
volse-hubzilla-a0dfd44f9178796eaf55e4a2ab0194c12e7dfd21.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/Contact.php')
-rw-r--r--include/Contact.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/include/Contact.php b/include/Contact.php
index b9ad1e4cb..992ed27e2 100644
--- a/include/Contact.php
+++ b/include/Contact.php
@@ -1,6 +1,31 @@
<?php /** @file */
+
+function rconnect_url($channel_id,$xchan) {
+
+ if(! $xchan)
+ return '';
+
+ $r = q("select abook_id from abook where abook_channel = %d and abook_xchan = '%s' limit 1",
+ intval($channel_id),
+ dbesc($xchan)
+ );
+
+ if($r)
+ return '';
+
+ $r = q("select hubloc_url from hubloc where hubloc_hash = '%s' and ( hubloc_flags & %d ) limit 1",
+ dbesc($xchan),
+ intval(HUBLOC_FLAGS_PRIMARY)
+ );
+
+ if($r)
+ return $r[0]['hubloc_url'];
+ return '';
+
+}
+
function abook_connections($channel_id, $sql_conditions = '') {
$r = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d
and not ( abook_flags & %d ) $sql_conditions",