Commit ff8ee6fb authored by Zot's avatar Zot
Browse files

for federated forums we need to keep track of what protocols are available to...

for federated forums we need to keep track of what protocols are available to red/hubzilla channels to determine which posts need to be mangled for transport to individual networks - based on what networks the author can communicate with. We probably need this for all xchans and hublocs but at some point it becomes increasingly difficult to scrape this information and map out a compatibility matrix. It's also doubtful anybody will use this system because we basically have to forge comments between network sites involving different protocols and this is going to look like crap to anybody that isn't on red/Hubzilla. Eventually they have to fix their protocols for this to work correctly, but nobody seems to believe me that their networks are basically anti-federation, so we need something like this to highlight their walled garden specifications and the resulting federation problems in a form they can't really argue with.
parent 1a7ccc46
......@@ -718,6 +718,16 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) {
if(intval($r[0]['xchan_pubforum']) != intval($arr['public_forum']))
$pubforum_changed = 1;
if($arr['protocols']) {
$protocols = implode(',',$arr['protocols']);
if($protocols !== 'zot') {
set_xconfig($xchan_hash,'system','protocols',$protocols);
}
else {
del_xconfig($xchan_hash,'system','protocols');
}
}
if(($r[0]['xchan_name_date'] != $arr['name_updated'])
|| ($r[0]['xchan_connurl'] != $arr['connections_url'])
|| ($r[0]['xchan_addr'] != $arr['address'])
......@@ -4035,6 +4045,11 @@ function zotinfo($arr) {
$id = $e['channel_id'];
$x = [ 'channel_id' => $id, 'protocols' => 'zot' ];
call_hooks('channel_protocols',$x);
$protocols = $x['protocols'];
$sys_channel = (intval($e['channel_system']) ? true : false);
$special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false);
$adult_channel = (($e['channel_pageflags'] & PAGE_ADULT) ? true : false);
......@@ -4135,6 +4150,7 @@ function zotinfo($arr) {
$ret['target'] = $ztarget;
$ret['target_sig'] = $zsig;
$ret['searchable'] = $searchable;
$ret['protocols'] = $protocols;
$ret['adult_content'] = $adult_channel;
$ret['public_forum'] = $public_forum;
if($deleted)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment