File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1+ Significance: minor
2+ Type: changed
3+
4+ It’s now possible to reply to multiple posts using multiple reply blocks.
Original file line number Diff line number Diff line change @@ -615,16 +615,25 @@ protected function get_in_reply_to() {
615615 return null ;
616616 }
617617
618- $ blocks = \parse_blocks ( $ this ->item ->post_content );
618+ $ reply_urls = array ();
619+ $ blocks = \parse_blocks ( $ this ->item ->post_content );
619620
620621 foreach ( $ blocks as $ block ) {
621622 if ( 'activitypub/reply ' === $ block ['blockName ' ] && isset ( $ block ['attrs ' ]['url ' ] ) ) {
622623 // We only support one reply block per post for now.
623- return $ block ['attrs ' ]['url ' ];
624+ $ reply_urls [] = $ block ['attrs ' ]['url ' ];
624625 }
625626 }
626627
627- return null ;
628+ if ( empty ( $ reply_urls ) ) {
629+ return null ;
630+ }
631+
632+ if ( 1 === count ( $ reply_urls ) ) {
633+ return \current ( $ reply_urls );
634+ }
635+
636+ return \array_values ( \array_unique ( $ reply_urls ) );
628637 }
629638
630639 /**
You can’t perform that action at this time.
0 commit comments