aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-07-02 22:02:15 +0200
committerMario <mario@mariovavti.com>2019-07-02 22:02:15 +0200
commit001734a72540e87feb512705f31d282ff5014d93 (patch)
treef0ad9e956422867dd1e728e5876cf849b3cc9e58
parent019afe2a1abc72c092afda2023c0d83f9630bafb (diff)
parent276ab3eae32458b019af9261b49acf31739ed09e (diff)
downloadvolse-hubzilla-001734a72540e87feb512705f31d282ff5014d93.tar.gz
volse-hubzilla-001734a72540e87feb512705f31d282ff5014d93.tar.bz2
volse-hubzilla-001734a72540e87feb512705f31d282ff5014d93.zip
Merge branch 'dev' into 'dev'
begin directory migration to zot6, see the code comments See merge request hubzilla/core!1687
-rw-r--r--Zotlabs/Module/Apschema.php5
-rw-r--r--Zotlabs/Module/Channel.php11
-rwxr-xr-xboot.php2
-rw-r--r--include/dir_fns.php35
4 files changed, 45 insertions, 8 deletions
diff --git a/Zotlabs/Module/Apschema.php b/Zotlabs/Module/Apschema.php
index ef2264bc0..12cc0e00a 100644
--- a/Zotlabs/Module/Apschema.php
+++ b/Zotlabs/Module/Apschema.php
@@ -41,8 +41,11 @@ class Apschema extends \Zotlabs\Web\Controller {
],
'ostatus' => 'http://ostatus.org#',
- 'conversation' => 'ostatus:conversation'
+ 'conversation' => 'ostatus:conversation',
+ 'diaspora' => 'https://diasporafoundation.org/ns/',
+ 'guid' => 'diaspora:guid'
+
]
];
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index afd82ed2f..b1639b213 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -111,6 +111,17 @@ class Channel extends Controller {
// we start loading content
profile_load($which,$profile);
+
+ App::$page['htmlhead'] .= '<meta property="og:title" content="' . htmlspecialchars($channel['channel_name']) . '">' . "\r\n";
+ App::$page['htmlhead'] .= '<meta property="og:image" content="' . $channel['xchan_photo_l'] . '">' . "\r\n";
+
+ if(App::$profile['about'] && perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_profile')) {
+ App::$page['htmlhead'] .= '<meta property="og:description" content="' . htmlspecialchars(App::$profile['about']) . '">' . "\r\n";
+ }
+ else {
+ App::$page['htmlhead'] .= '<meta property="og:description" content="' . htmlspecialchars(sprintf( t('This is the home page of %s.'), $channel['channel_name'])) . '">' . "\r\n";
+ }
+
}
function get($update = 0, $load = false) {
diff --git a/boot.php b/boot.php
index 9cbbec763..4746380a3 100755
--- a/boot.php
+++ b/boot.php
@@ -468,7 +468,7 @@ define ( 'NAMESPACE_YMEDIA', 'http://search.yahoo.com/mrss/' );
define ( 'ACTIVITYSTREAMS_JSONLD_REV', 'https://www.w3.org/ns/activitystreams' );
-define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.6' );
+define ( 'ZOT_APSCHEMA_REV', '/apschema/v1.7' );
/**
* activity stream defines
*/
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 2bd1228ec..08a9fb653 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -329,13 +329,36 @@ function update_directory_entry($ud) {
if ($ud['ud_addr'] && (! ($ud['ud_flags'] & UPDATE_FLAGS_DELETED))) {
$success = false;
- $x = zot_finger($ud['ud_addr'], '');
- if ($x['success']) {
- $j = json_decode($x['body'], true);
- if ($j)
- $success = true;
- $y = import_xchan($j, 0, $ud);
+ // directory migration phase 1 (Macgirvin - 29-JUNE-2019)
+ // fetch zot6 info (if available) as well as historical zot info (if available)
+ // Once this has been running for > 1 month on the primary directory we can deprecate the historical info and
+ // modify the directory search to only return zot6 entries, and also modify this function
+ // to *only* fetch the zot6 entries.
+ // Otherwise we'll be showing duplicates or have a mostly empty directory for a good chunk of
+ // the transition period. Directory server load will likely increase "moderately" during this transition.
+ // The one month counter begins when the primary directory has upgraded to a release which uses this code.
+ // Hubzilla channels running traditional zot which have not upgraded can or will be dropped from the directory or
+ // "not found" at the end of the transition period as the directory will only serve zot6 entries at that time.
+
+ $uri = \Zotlabs\Lib\Webfinger::zot_url($ud['ud_addr']);
+ if($uri) {
+ $record = \Zotlabs\Lib\Zotfinger::exec($uri);
+
+ // Check the HTTP signature
+
+ $hsig = $record['signature'];
+ if($hsig && $hsig['signer'] === $url && $hsig['header_valid'] === true && $hsig['content_valid'] === true) {
+ $x = \Zotlabs\Zot\Libzot::import_xchan($record['data'], 0, $ud);
+ if($x['success']) {
+ $success = true;
+ }
+ }
+ }
+ $x = \Zotlabs\Zot\Finger::run($ud['ud_addr'], '');
+ if ($x['success']) {
+ import_xchan($x, 0, $ud);
+ $success = true;
}
if (! $success) {
q("update updates set ud_last = '%s' where ud_addr = '%s'",