diff options
author | Mario <mario@mariovavti.com> | 2020-03-12 18:27:16 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-03-12 18:27:16 +0000 |
commit | c358aa2806717d1af6e47697f87e54b7c9967c9e (patch) | |
tree | 2bcf2fe7f7766f9d8d1453e67b8da20355b65338 /Zotlabs/Lib | |
parent | b23751128bafdc0e2d546517cab48f8095eed315 (diff) | |
download | volse-hubzilla-c358aa2806717d1af6e47697f87e54b7c9967c9e.tar.gz volse-hubzilla-c358aa2806717d1af6e47697f87e54b7c9967c9e.tar.bz2 volse-hubzilla-c358aa2806717d1af6e47697f87e54b7c9967c9e.zip |
first batch of zot6 transition patches. basic communication with transitioned channels *should* work now
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Libzot.php | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 42e706754..5e212ad70 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -105,7 +105,7 @@ class Libzot { $data = [ 'type' => $type, 'encoding' => $encoding, - 'sender' => $channel['channel_portable_id'], + 'sender' => $channel['channel_hash'], 'site_id' => self::make_xchan_hash(z_root(), get_config('system','pubkey')), 'version' => System::get_zot_revision(), ]; @@ -422,7 +422,7 @@ class Libzot { [ 'type' => NOTIFY_INTRO, 'from_xchan' => $x['hash'], - 'to_xchan' => $channel['channel_portable_id'], + 'to_xchan' => $channel['channel_hash'], 'link' => z_root() . '/connedit/' . $new_connection[0]['abook_id'] ] ); @@ -788,7 +788,7 @@ class Libzot { // see if this is a channel clone that's hosted locally - which we treat different from other xchans/connections - $local = q("select channel_account_id, channel_id from channel where channel_portable_id = '%s' limit 1", + $local = q("select channel_account_id, channel_id from channel where channel_hash = '%s' limit 1", dbesc($xchan_hash) ); if($local) { @@ -1151,7 +1151,7 @@ class Libzot { if($recip_arr) { stringify_array_elms($recip_arr,true); $recips = implode(',',$recip_arr); - $r = q("select channel_portable_id as hash from channel where channel_portable_id in ( " . $recips . " ) and channel_removed = 0 "); + $r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and channel_removed = 0 "); } if(! $r) { @@ -1368,12 +1368,12 @@ class Libzot { $r = []; - $c = q("select channel_id, channel_portable_id from channel where channel_removed = 0"); + $c = q("select channel_id, channel_hash from channel where channel_removed = 0"); if($c) { foreach($c as $cc) { if(perm_is_allowed($cc['channel_id'],$msg['sender'],$perm)) { - $r[] = $cc['channel_portable_id']; + $r[] = $cc['channel_hash']; } } } @@ -1381,7 +1381,7 @@ class Libzot { if($include_sys) { $sys = get_sys_channel(); if($sys) - $r[] = $sys['channel_portable_id']; + $r[] = $sys['channel_hash']; } @@ -1397,7 +1397,7 @@ class Libzot { if($tag['type'] === 'Mention' && (strpos($tag['href'],z_root()) !== false)) { $address = basename($tag['href']); if($address) { - $z = q("select channel_portable_id as hash from channel where channel_address = '%s' + $z = q("select channel_hash as hash from channel where channel_address = '%s' and channel_removed = 0 limit 1", dbesc($address) ); @@ -1418,7 +1418,7 @@ class Libzot { $thread_parent = self::find_parent($msg,$act); if($thread_parent) { - $z = q("select channel_portable_id as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = '%s' OR item.parent_mid = '%s' ) ", + $z = q("select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = '%s' OR item.parent_mid = '%s' ) ", dbesc($thread_parent), dbesc($thread_parent) ); @@ -1473,7 +1473,7 @@ class Libzot { $DR = new DReport(z_root(),$sender,$d,$arr['mid']); - $channel = channelx_by_portid($d); + $channel = channelx_by_hash($d); if (! $channel) { $DR->update('recipient not found'); @@ -1510,7 +1510,7 @@ class Libzot { * access checks. */ - if($sender === $channel['channel_portable_id'] && $arr['author_xchan'] === $channel['channel_portable_id'] && $arr['mid'] === $arr['parent_mid']) { + if($sender === $channel['channel_hash'] && $arr['author_xchan'] === $channel['channel_hash'] && $arr['mid'] === $arr['parent_mid']) { $DR->update('self delivery ignored'); $result[] = $DR->get(); continue; @@ -1827,7 +1827,7 @@ class Libzot { $stored = (($item_result && $item_result['item']) ? $item_result['item'] : false); if((is_array($stored)) && ($stored['id'] != $stored['parent']) - && ($stored['author_xchan'] === $channel['channel_hash'] || $stored['author_xchan'] === $channel['channel_portable_id'])) { + && ($stored['author_xchan'] === $channel['channel_hash'] || $stored['author_xchan'] === $channel['channel_hash'])) { retain_item($stored['item']['parent']); } @@ -1949,9 +1949,9 @@ class Libzot { } logger('FOF Activity received: ' . print_r($arr,true), LOGGER_DATA, LOG_DEBUG); - logger('FOF Activity recipient: ' . $channel['channel_portable_id'], LOGGER_DATA, LOG_DEBUG); + logger('FOF Activity recipient: ' . $channel['channel_hash'], LOGGER_DATA, LOG_DEBUG); - $result = self::process_delivery($arr['owner_xchan'],$AS, $arr, [ $channel['channel_portable_id'] ],false,false,true); + $result = self::process_delivery($arr['owner_xchan'],$AS, $arr, [ $channel['channel_hash'] ],false,false,true); if ($result) { $ret = array_merge($ret, $result); } @@ -2207,7 +2207,7 @@ class Libzot { $DR = new DReport(z_root(),$sender,$d,$arr['mid']); - $r = q("select * from channel where channel_portable_id = '%s' limit 1", + $r = q("select * from channel where channel_hash = '%s' limit 1", dbesc($d['hash']) ); @@ -2362,7 +2362,7 @@ class Libzot { $loc = $locations[0]; - $r = q("select * from channel where channel_portable_id = '%s' limit 1", + $r = q("select * from channel where channel_hash = '%s' limit 1", dbesc($sender_hash) ); @@ -2370,7 +2370,7 @@ class Libzot { return; if($loc['url'] !== z_root()) { - $x = q("update channel set channel_moved = '%s' where channel_portable_id = '%s' limit 1", + $x = q("update channel set channel_moved = '%s' where channel_hash = '%s' limit 1", dbesc($loc['url']), dbesc($sender_hash) ); @@ -2404,7 +2404,7 @@ class Libzot { static function encode_locations($channel) { $ret = []; - $x = self::get_hublocs($channel['channel_portable_id']); + $x = self::get_hublocs($channel['channel_hash']); if($x && count($x)) { foreach($x as $hub) { @@ -2752,13 +2752,13 @@ class Libzot { $r = null; if(strlen($zhash)) { - $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash - where channel_portable_id = '%s' limit 1", + $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash + where channel_hash = '%s' limit 1", dbesc($zhash) ); } elseif(strlen($zguid) && strlen($zguid_sig)) { - $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash + $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash where channel_guid = '%s' and channel_guid_sig = '%s' limit 1", dbesc($zguid), dbesc($zguid_sig) @@ -2766,7 +2766,7 @@ class Libzot { } elseif(strlen($zaddr)) { if(strpos($zaddr,'[system]') === false) { /* normal address lookup */ - $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash + $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash where ( channel_address = '%s' or xchan_addr = '%s' ) limit 1", dbesc($zaddr), dbesc($zaddr) @@ -2786,10 +2786,10 @@ class Libzot { * */ - $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash + $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash where channel_system = 1 order by channel_id limit 1"); if(! $r) { - $r = q("select channel.*, xchan.* from channel left join xchan on channel_portable_id = xchan_hash + $r = q("select channel.*, xchan.* from channel left join xchan on channel_hash = xchan_hash where channel_removed = 0 order by channel_id limit 1"); } } |