diff --git a/includes/class-activity-dispatcher.php b/includes/class-activity-dispatcher.php index 8d5e4dd..6c80dcd 100644 --- a/includes/class-activity-dispatcher.php +++ b/includes/class-activity-dispatcher.php @@ -249,7 +249,7 @@ class Activity_Dispatcher { */ public static function send_update_comment_activity( $activitypub_comment_id ) { $activitypub_comment = \get_comment( $activitypub_comment_id ); - $updated = \wp_date( 'Y-m-d\TH:i:s\Z' ); + $updated = \get_comment_meta( $comment->comment_ID, 'ap_last_modified', true ); $user_id = $activitypub_comment->user_id; if ( ! $user_id ) { // Prevent sending received/anonymous comments. diff --git a/includes/class-comments.php b/includes/class-comments.php index 29a0ce2..afc1e54 100644 --- a/includes/class-comments.php +++ b/includes/class-comments.php @@ -16,10 +16,9 @@ class Comments { \add_filter( 'comment_excerpt', array( '\Activitypub\Comments', 'comment_excerpt' ), 10, 3 ); \add_filter( 'comment_text', array( '\Activitypub\Comments', 'comment_content_filter' ), 10, 3 ); \add_filter( 'comment_post', array( '\Activitypub\Comments', 'postprocess_comment' ), 10, 3 ); + \add_action( 'edit_comment', array( '\Activitypub\Comments', 'edit_comment' ), 20, 2 ); //schedule_admin_comment_activity \add_filter( 'wp_update_comment_data', array( '\Activitypub\Comments', 'comment_updated_published' ), 20, 3 ); - \add_action( 'edit_comment', array( '\Activitypub\Comments', 'edit_comment' ), 20, 2 );//schedule_admin_comment_activity \add_action( 'transition_comment_status', array( '\Activitypub\Comments', 'schedule_comment_activity' ), 20, 3 ); - } /** @@ -70,9 +69,15 @@ class Comments { $protocol = \get_comment_meta( $comment->comment_ID, 'protocol', true ); // TODO Test if this is returned by Model/Comment if ( 'activitypub' === $protocol ) { - $updated = \wp_date( 'Y-m-d H:i:s', \strtotime( \get_comment_meta( $comment->comment_ID, 'ap_last_modified', true ) ) ); + $updated = \strtotime( \get_comment_meta( $comment->comment_ID, 'ap_last_modified', true ) ); if ( $updated ) { - $comment_text .= "