Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update/webmention handling #9

Merged
merged 4 commits into from Jan 14, 2020
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Skip a handful of Webmention types that aren't handled

  • Loading branch information
jeremyfelt committed Jan 14, 2020
commit ea69ca56ef6f2c5090499c8e6a459dd29eb149f5
@@ -61,6 +61,20 @@
'other' => array(),
);

$skip_actions = array(
'repost',
'tag',
'rsvp:yes',
'rsvp:no',
'rsvp:maybe',
'rsvp:interested',
'invited',
'listen',
'read',
'watch',
'follow',
);

foreach ( $comments as $comment_id ) {
$type = get_comment_meta( $comment_id, 'semantic_linkbacks_type', true );

@@ -73,17 +87,12 @@
$type = 'like';
}

// Leave "read" actions as private for now.
if ( 'read' === $type ) {
// Skip the actions that aren't handled.
if ( in_array( $type, $skip_actions, true ) ) {
continue;
}

if ( isset( $typed_comments[ $type ] ) ) {
$typed_comments[ $type ][] = $comment_id;
} else {
$typed_comments['other'][] = $comment_id;
}

$typed_comments[ $type ][] = $comment_id;
}

if ( 0 < count( $typed_comments['like'] ) ) :
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.