aboutsummaryrefslogtreecommitdiffstats
path: root/include/connections.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-07-11 18:57:18 +0000
committerMario <mario@mariovavti.com>2023-07-11 18:57:18 +0000
commit63fb8d03929189bfc8cbf53d23cb79984fe2c3cd (patch)
treeb9f74bd8c7721dca7ece251fdbb9a7c4fe9b949a /include/connections.php
parent57796a2f962d045445cbf69237bb3d6786e4d0d4 (diff)
parent384de0925e502cfa8fe6ca287530ef5529fdff10 (diff)
downloadvolse-hubzilla-8.6.tar.gz
volse-hubzilla-8.6.tar.bz2
volse-hubzilla-8.6.zip
Merge branch '8.6RC'8.6
Diffstat (limited to 'include/connections.php')
-rw-r--r--include/connections.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/connections.php b/include/connections.php
index e8415bb25..9a6ee7d8d 100644
--- a/include/connections.php
+++ b/include/connections.php
@@ -67,6 +67,35 @@ function rconnect_url($channel_id,$xchan) {
}
+function deliverable_abook_xchans($channel_id, $filter = [], $flatten = true) {
+ $filter_sql = '';
+
+ if ($filter) {
+ $filter_sql = " AND abook_xchan IN (" . protect_sprintf(stringify_array($filter, true)) . ") ";
+ }
+
+ $r = q("SELECT abook_xchan, xchan_network FROM abook LEFT JOIN xchan ON abook_xchan = xchan_hash WHERE
+ abook_channel = %d $filter_sql
+ AND abook_self = 0
+ AND abook_pending = 0
+ AND abook_archived = 0
+ AND abook_not_here = 0
+ AND xchan_network NOT IN ('anon', 'token', 'rss')",
+ intval($channel_id)
+ );
+
+ if (!$r) {
+ return [];
+ }
+
+ if ($flatten) {
+ return ids_to_array($r, 'abook_xchan');
+ }
+
+ return $r;
+}
+
+
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 abook_self = 0 $sql_conditions",