diff options
author | zotlabs <mike@macgirvin.com> | 2019-08-14 17:55:56 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-08-14 17:55:56 -0700 |
commit | 9a2fbdde200eae4e9ff8163cfa0c47e1111966b6 (patch) | |
tree | 9fadfe8b8800372e64dab4f92f5d22397cd1f7e6 | |
parent | feda23587c7e24dec0cfc8be9f2f444e009f967f (diff) | |
download | volse-hubzilla-9a2fbdde200eae4e9ff8163cfa0c47e1111966b6.tar.gz volse-hubzilla-9a2fbdde200eae4e9ff8163cfa0c47e1111966b6.tar.bz2 volse-hubzilla-9a2fbdde200eae4e9ff8163cfa0c47e1111966b6.zip |
zot6 compatibility: when posting from a non-primary clone the actor->id is that of the primary, resulting in an author/owner identity mismatch. Solution is to always post with the actor->id set to the sender if it is a local channel.
-rw-r--r-- | Zotlabs/Lib/Activity.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index f86dc1604..5f5f74ca9 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -668,8 +668,24 @@ class Activity { } $ret = []; + $c = ((array_key_exists('channel_id',$p)) ? $p : channelx_by_hash($p['xchan_hash'])); + $ret['type'] = 'Person'; - $ret['id'] = $p['xchan_url']; + + if ($c) { + $role = get_pconfig($c['channel_id'],'system','permissions_role'); + if (strpos($role,'forum') !== false) { + $ret['type'] = 'Group'; + } + } + + if ($c) { + $ret['id'] = channel_url($c); + } + else { + $ret['id'] = ((strpos($p['xchan_hash'],'http') === 0) ? $p['xchan_hash'] : $p['xchan_url']); + } + if($p['xchan_addr'] && strpos($p['xchan_addr'],'@')) $ret['preferredUsername'] = substr($p['xchan_addr'],0,strpos($p['xchan_addr'],'@')); $ret['name'] = $p['xchan_name']; |