What is the best approach to achieve “like”/”subscribe” function in an add-on

What could be the best way to achieve “like”/”subscribe” function in an add-on

The add-on I am working on is a Peer-to-Peer file sharing add-on. There is channels that users may wish to subscribe. My former idea with to add a item to the menu, which subscribe or unsubscribe after clicking, and toggle the button by refreshing the page. But with addDirectoryItem, it can only open a url. This will make the user stay on the same page after clicking “subscribe” and then “..”.

Is there any better approach to achieve this kind of function?

Thx a lot for your help.