aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2019-06-28 00:05:25 +0000
committerMario <mario@mariovavti.com>2019-06-28 09:43:06 +0200
commit4a77b6673ba7618157560557a9af64e19b69612a (patch)
tree512e0fe565ebe6d03089c24912adf7b67636ff75 /include
parent62b31b1e4adfe660e130d70b01eaa9cf2177590a (diff)
downloadvolse-hubzilla-4a77b6673ba7618157560557a9af64e19b69612a.tar.gz
volse-hubzilla-4a77b6673ba7618157560557a9af64e19b69612a.tar.bz2
volse-hubzilla-4a77b6673ba7618157560557a9af64e19b69612a.zip
support zot and zot6 in social graph operations (suggestions, common friends)
(cherry picked from commit 9def9a5cb7ab7799911013580c714605e9698122)
Diffstat (limited to 'include')
-rw-r--r--include/socgraph.php21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/socgraph.php b/include/socgraph.php
index 6cddbbaac..3d26f5cfd 100644
--- a/include/socgraph.php
+++ b/include/socgraph.php
@@ -1,5 +1,10 @@
<?php /** @file */
+
+use Zotlabs\Lib\Libzot;
+use Zotlabs\Lib\Libzotdir;
+use Zotlabs\Lib\Zotfinger;
+
require_once('include/dir_fns.php');
require_once('include/zot.php');
@@ -122,7 +127,7 @@ function poco_load($xchan = '', $url = null) {
$profile_url = $url['value'];
continue;
}
- if($url['type'] == 'zot') {
+ if(in_array($url['type'], ['zot','zot6'] )) {
$network = $url['type'];
$address = str_replace('acct:' , '', $url['value']);
continue;
@@ -151,6 +156,18 @@ function poco_load($xchan = '', $url = null) {
if(($x !== false) && (! count($x))) {
if($address) {
+ if($network === 'zot6') {
+ $j = Zotfinger::exec($profile_url);
+ if(is_array($j) && array_path_exists('signature/signer',$j) && $j['signature']['signer'] === $profile_url && intval($j['signature']['header_valid'])) {
+ Libzot::import_xchan($j['data']);
+ }
+ $x = q("select xchan_hash from xchan where xchan_hash = '%s' limit 1",
+ dbesc($hash)
+ );
+ if(! $x) {
+ continue;
+ }
+ }
if($network === 'zot') {
$j = Zotlabs\Zot\Finger::run($address,null);
if($j['success']) {
@@ -402,7 +419,7 @@ function poco($a,$extended = false) {
$sql_extra ",
intval($channel_id)
);
- $rooms = q("select * from menu_item where ( mitem_flags & " . intval(MENU_ITEM_CHATROOM) . " )>0 and allow_cid = '' and allow_gid = '' and deny_cid = '' and deny_gid = '' and mitem_channel_id = %d",
+ $rooms = q("select * from menu_item where ( mitem_flags & " . intval(MENU_ITEM_CHATROOM) . " ) > 0 and allow_cid = '' and allow_gid = '' and deny_cid = '' and deny_gid = '' and mitem_channel_id = %d",
intval($channel_id)
);
}