getTopic APIレスポンスで、認証されたAPIユーザーがその投稿に「いいね」したかどうかを判定する

過去1週間、WordPress のコメントプラグインの開発に取り組んでおり、Discourse API および私がフォークした discourse-php-API プラグイン(https://github.com/communiteq/discourse-api-php/pull/14)を介して接続し、投稿を作成し、データを更新することに大成功を収めました。

/posts のレスポンスを見ると、各投稿のアクションサマリーが表示され、いいねの総数を取得できます。

actions_summary: Array(6)
0: {id: 2, count: 1, can_act: true}
1: {id: 3, can_act: true}
2: {id: 4, can_act: true}
3: {id: 8, can_act: true}
4: {id: 6, can_act: true}
5: {id: 7, can_act: true}
length: 6
__proto__: Array(0)

ただし、can_act はユーザーが投稿にいいねをしたかどうかに関わらず、常に true となっています。これを正しく表示するにはどうすればよいでしょうか?

If the user you’re using with the API (Api-Username) has liked a post, you should see acted: true

Hmm, let me take a look.

I’ve got it. The plugin wasn’t requesting based on the passed user. I’ll update the library to help anyone in future.

「いいね!」 2