mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 01:35:12 +00:00
xchan_url for local channels is not tracking nomadic state
This commit is contained in:
parent
f1db154fbe
commit
2301f2c5a1
4 changed files with 40 additions and 3 deletions
2
boot.php
2
boot.php
|
@ -27,7 +27,7 @@ use Code\Lib\Url;
|
|||
*/
|
||||
|
||||
const REPOSITORY_ID = 'streams';
|
||||
const DB_UPDATE_VERSION = 1282;
|
||||
const DB_UPDATE_VERSION = 1283;
|
||||
const PROJECT_BASE = __DIR__;
|
||||
const ACTIVITYPUB_ENABLED = true;
|
||||
const NOMAD_PROTOCOL_VERSION = '13.3';
|
||||
|
|
|
@ -479,7 +479,7 @@ class Channel
|
|||
'xchan_photo_m' => z_root() . "/photo/profile/m/{$newuid}",
|
||||
'xchan_photo_s' => z_root() . "/photo/profile/s/{$newuid}",
|
||||
'xchan_addr' => self::get_webfinger($ret['channel']),
|
||||
'xchan_url' => (($system) ? z_root() : Channel::url($ret['channel'])),
|
||||
'xchan_url' => (($system) ? z_root() : Channel::getDidResolver($ret['channel'],true)),
|
||||
'xchan_follow' => z_root() . '/follow?f=&url=%s',
|
||||
'xchan_connurl' => z_root() . '/poco/' . $ret['channel']['channel_address'],
|
||||
'xchan_name' => $ret['channel']['channel_name'],
|
||||
|
|
37
src/Update/_1283.php
Normal file
37
src/Update/_1283.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace Code\Update;
|
||||
|
||||
use Code\Lib\Channel;
|
||||
use Code\Lib\PConfig;
|
||||
|
||||
|
||||
class _1283
|
||||
{
|
||||
public function run()
|
||||
{
|
||||
$channels = q("select * from channel left join xchan on channel_hash = xchan_hash and xchan_network like ('%s')",
|
||||
dbesc('nomad%')
|
||||
);
|
||||
if ($channels) {
|
||||
foreach ($channels as $channel) {
|
||||
$nomadic = (PConfig::Get($channel['channel_id'], 'system', 'nomadicAP') || $channel['xchan_network'] === 'nomadic');
|
||||
if ($nomadic) {
|
||||
q("UPDATE xchan set xchan_url = '%s' where xchan_id = %d",
|
||||
dbesc(Channel::getDidResolver($channel, true)),
|
||||
intval($channel['xchan_id'])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return UPDATE_SUCCESS;
|
||||
}
|
||||
|
||||
public function verify()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in a new issue