aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-09-23 20:43:37 +0000
committerMario <mario@mariovavti.com>2021-09-23 20:43:37 +0000
commit9cb5274d30522bc181310b884504c11c7aae8508 (patch)
treea707e898fa1ffeb783aaa3984f12f5104b5fabde
parent0588975e372f863aa2d74bbff0ac2b9778852431 (diff)
downloadvolse-hubzilla-9cb5274d30522bc181310b884504c11c7aae8508.tar.gz
volse-hubzilla-9cb5274d30522bc181310b884504c11c7aae8508.tar.bz2
volse-hubzilla-9cb5274d30522bc181310b884504c11c7aae8508.zip
add zot6 specific handling to onepoll
-rw-r--r--Zotlabs/Daemon/Onepoll.php17
1 files changed, 16 insertions, 1 deletions
diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php
index 5374f49d5..d3294affb 100644
--- a/Zotlabs/Daemon/Onepoll.php
+++ b/Zotlabs/Daemon/Onepoll.php
@@ -140,14 +140,29 @@ class Onepoll {
if ($url) {
logger('fetching outbox');
- $url = $url . '?date_begin=' . urlencode($last_update);
+ $url = $url . '?date_begin=' . urlencode($last_update);
+
+ if($contact['xchan_network'] === 'zot6') {
+ $url = $url . '&top=1';
+ }
+
$obj = new ASCollection($url, $importer, 0, $max);
$messages = $obj->get();
+
if ($messages) {
foreach ($messages as $message) {
if (is_string($message)) {
$message = Activity::fetch($message, $importer);
}
+
+ if ($contact['xchan_network'] === 'zot6') {
+ // make sure we only fetch top level items
+ if ($message['type'] === 'Create' && !isset($message['object']['inReplyTo'])) {
+ Libzot::fetch_conversation($importer, $message['object']['id']);
+ }
+ continue;
+ }
+
$AS = new ActivityStreams($message);
if ($AS->is_valid() && is_array($AS->obj)) {
$item = Activity::decode_note($AS);