aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authornobody <nobody@zotlabs.com>2021-02-17 19:42:58 -0800
committernobody <nobody@zotlabs.com>2021-02-17 19:42:58 -0800
commit62b738da953e8b59f03660eeab592dc58e83ccb0 (patch)
tree7d99b00b468264cb5d275a6e7b19bdf6b1e4d387 /Zotlabs/Lib/Activity.php
parente7c7f91a3fec224ca32459b950caaa25f73c3b1f (diff)
downloadvolse-hubzilla-62b738da953e8b59f03660eeab592dc58e83ccb0.tar.gz
volse-hubzilla-62b738da953e8b59f03660eeab592dc58e83ccb0.tar.bz2
volse-hubzilla-62b738da953e8b59f03660eeab592dc58e83ccb0.zip
migration testing
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php32
1 files changed, 30 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index d4d1cd28c..d286f35c2 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -423,7 +423,7 @@ class Activity {
$ret['published'] = datetime_convert('UTC', 'UTC', $i['created'], ATOM_TIME);
if ($i['created'] !== $i['edited'])
$ret['updated'] = datetime_convert('UTC', 'UTC', $i['edited'], ATOM_TIME);
- if ($i['expires'] <= NULL_DATE) {
+ if ($i['expires'] > NULL_DATE) {
$ret['expires'] = datetime_convert('UTC', 'UTC', $i['expires'], ATOM_TIME);
}
@@ -450,7 +450,7 @@ class Activity {
$ret['directMessage'] = true;
}
- if (array_key_exists('comments_closed', $i) && $i['comments_closed'] !== EMPTY_STR && $i['comments_closed'] !== NULL_DATE) {
+ if (array_key_exists('comments_closed', $i) && $i['comments_closed'] !== EMPTY_STR && $i['comments_closed'] > NULL_DATE) {
if ($ret['commentPolicy']) {
$ret['commentPolicy'] .= ' ';
}
@@ -1109,6 +1109,34 @@ class Activity {
return $ret;
}
+ static function encode_item_object($item, $elm = 'obj') {
+ $ret = [];
+
+ if ($item[$elm]) {
+ if (! is_array($item[$elm])) {
+ $item[$elm] = json_decode($item[$elm],true);
+ }
+ if ($item[$elm]['type'] === ACTIVITY_OBJ_PHOTO) {
+ $item[$elm]['id'] = $item['mid'];
+ }
+
+ $obj = self::encode_object($item[$elm]);
+ if ($obj)
+ return $obj;
+ else
+ return [];
+ }
+ else {
+ $obj = self::encode_item($item);
+ if ($obj)
+ return $obj;
+ else
+ return [];
+ }
+
+ }
+
+
static function activity_mapper($verb) {
if (strpos($verb, '/') === false) {