Skip to content

Commit dbe42aa

Browse files
committed
fix comment type detection
Currently the `get_response_type` logic is using the `get_content` function. This function adds some fallbacks for mentions or for the case when the content is empty. For `mentions` the `get_content` function always returns the summary that is smaller than `MAX_INLINE_MENTION_LENGTH`, so mentions will always be handled as comments.
1 parent 191ef6b commit dbe42aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

includes/Entity/class-item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public function get_response_type() {
321321
$response_type = $this->response_type ? $this->response_type : 'mention';
322322
// Reclassify short mentions as comments
323323
if ( 'mention' === $response_type ) {
324-
$text = $this->get_content();
324+
$text = $this->content;
325325
$text_len = $this->str_length( $text );
326326
if ( ( 0 < $text_len ) && ( $text_len <= MAX_INLINE_MENTION_LENGTH ) ) {
327327
return 'comment';

0 commit comments

Comments
 (0)