Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+63 -2
View File
@@ -106,6 +106,7 @@ class _comments extends \IPS\Content\Api\CommentController
* @apiparam datetime date The date/time that should be used for the comment date. If not provided, will use the current date/time. Ignored for requests using an OAuth Access Token for a particular member
* @apiparam string ip_address The IP address that should be stored for the comment. If not provided, will use the IP address from the API request. Ignored for requests using an OAuth Access Token for a particular member
* @apiparam int hidden 0 = unhidden; 1 = hidden, pending moderator approval; -1 = hidden (as if hidden by a moderator)
* @apiparam bool anonymous If 1, the item will be posted anonymously.
* @throws 2B301/2 INVALID_ID The comment ID does not exist
* @throws 1B301/3 NO_AUTHOR The author ID does not exist
* @throws 1B301/4 NO_CONTENT No content was supplied
@@ -145,8 +146,15 @@ class _comments extends \IPS\Content\Api\CommentController
}
else
{
$author = new \IPS\Member;
$author->name = \IPS\Request::i()->author_name;
if ( \IPS\Request::i()->author === 0 )
{
$author = new \IPS\Member;
$author->name = \IPS\Request::i()->author_name;
}
else
{
throw new \IPS\Api\Exception( 'NO_AUTHOR', '1B301/3', 400 );
}
}
}
@@ -234,4 +242,57 @@ class _comments extends \IPS\Content\Api\CommentController
throw new \IPS\Api\Exception( 'INVALID_ID', '2B301/7', 404 );
}
}
/**
* POST /blog/comments/{id}/react
* Add a reaction
*
* @param int $id ID Number
* @apiparam int id ID of the reaction to add
* @apiparam int author ID of the member reacting
* @return \IPS\blog\Entry\Comment
* @throws 1S425/2 NO_REACTION The reaction ID does not exist
* @throws 1S425/3 NO_AUTHOR The author ID does not exist
* @throws 1S425/4 REACT_ERROR Error adding the reaction
* @throws 1S425/5 INVALID_ID Object ID does not exist
* @note If the author has already reacted to this content, any existing reaction will be removed first
*/
public function POSTitem_react( $id )
{
return $this->_reactAdd( $id );
}
/**
* DELETE /blog/comments/{id}/react
* Delete a reaction
*
* @param int $id ID Number
* @apiparam int author ID of the member who reacted
* @return \IPS\blog\Entry\Comment
* @throws 1S425/6 NO_AUTHOR The author ID does not exist
* @throws 1S425/7 REACT_ERROR Error adding the reaction
* @throws 1S425/8 INVALID_ID Object ID does not exist
* @note If the author has already reacted to this content, any existing reaction will be removed first
*/
public function DELETEitem_react( $id )
{
return $this->_reactRemove( $id );
}
/**
* POST /blog/comments/{id}/report
* Reports a post
*
* @param int $id ID Number
* @apiparam int author ID of the member reporting
* @apiparam int report_type Report type (0 is default and is for letting CMGR team know, more options via core_automatic_moderation_types)
* @apiparam string message Optional message
* @return \IPS\blog\Entry\Comment
* @throws 1S425/B NO_AUTHOR The author ID does not exist
* @throws 1S425/C REPORTED_ALREADY The member has reported this item in the past 24 hours
*/
public function POSTitem_report( $id )
{
return $this->_report( $id );
}
}