Requires Moderation Flag logic via API
Hi Lithium Developers,
Say a moderator has the Show Moderation Required Column setting turned on and the Clear Moderation Required Flag When Message is Read setting turned on.
In a custom component, having only the unique id of a message (an original post or a reply), can we use the v1 API and/or LiQL to query whether or not to show a Requires Moderation "RM" icon for the message? The idea here is to mimic Lithium's out-of-the-box experience with regard to the RM icon showing and not showing.
When my moderator user views a topic page and sees an unmoderated message, the out-of-the-box Lithium message quilt shows the RM icon as expected. At this point that the /messages/id/${msgid}/moderation/status and LiQL's moderation_status is "unmoderated." When my moderator user or any other admin or moderator user reloads the same topic page, the out-of-the-box Lithium quilt no longer shows the RM icon. I notice at this point that the /messages/id/{msgid}/moderation/status and LiQL's moderation_status remain "unmoderated!"
What pieces of data and what logic does the Lithium quilt use to show and not show the RM icon? What gets triggered when a moderator or admin reads a message? How does it get triggered? Are these data points available via the APIs?
At first I thought I could use the /messages/id/${msgid}/read API or LiQL's user_context.read value in tandem with the moderation status to determine when to show the RM icon. If the "read" value is false and the message status is unmoderated, I could show the icon. However, when a moderator disables the Clear Moderation Required Flag When Message is Read setting, the custom behavior fails. In this case, one problem is once my moderator user has read the message he won't see the custom RM icon anymore.
Thank you,
Dave