aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Activity.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-01-27 20:27:02 +0000
committerMario <mario@mariovavti.com>2022-01-27 20:27:02 +0000
commit38ecff1220a6b11261ba9f11edbefb5e5bfaa53b (patch)
treeaf2e83d68914e3ddfd699c6cb271081e6826edf8 /Zotlabs/Lib/Activity.php
parent67e64287afc6c41c80065614f7beebe8a552a76b (diff)
downloadvolse-hubzilla-38ecff1220a6b11261ba9f11edbefb5e5bfaa53b.tar.gz
volse-hubzilla-38ecff1220a6b11261ba9f11edbefb5e5bfaa53b.tar.bz2
volse-hubzilla-38ecff1220a6b11261ba9f11edbefb5e5bfaa53b.zip
some refinement on storing the raw ap message, some comments and make sure the AS->raw is always a json string
Diffstat (limited to 'Zotlabs/Lib/Activity.php')
-rw-r--r--Zotlabs/Lib/Activity.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 33183de76..4a5d42026 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2638,22 +2638,31 @@ class Activity {
}
}
- $rawmsg = '';
+ $zot_rawmsg = '';
+ $raw_arr = [];
- if (is_array($act->obj) && is_array($act->obj['attachment'])) {
+ $raw_arr = json_decode($act->raw, true);
+
+ // This is a zot6 packet and the raw activitypub message json
+ // is possible available in the attachement.
+ if (array_key_exists('signed', $raw_arr) && is_array($act->obj) && is_array($act->obj['attachment'])) {
foreach($act->obj['attachment'] as $a) {
- if (isset($a['type']) && $a['type'] === 'PropertyValue' &&
+ if (
+ isset($a['type']) && $a['type'] === 'PropertyValue' &&
isset($a['name']) && $a['name'] === 'zot.activitypub.rawmsg' &&
isset($a['value'])
) {
- $rawmsg = $a['value'];
+ $zot_rawmsg = $a['value'];
break;
}
}
}
- if ($rawmsg) {
- set_iconfig($s, 'activitypub', 'rawmsg', $rawmsg, 1);
+ if ($zot_rawmsg) {
+ set_iconfig($s, 'activitypub', 'rawmsg', $zot_rawmsg, 1);
+ }
+ else {
+ set_iconfig($s, 'activitypub', 'rawmsg', $act->raw, 1);
}
set_iconfig($s, 'activitypub', 'recips', $act->raw_recips);