I have implemented a new feature module called "moment". Its core function is to subscribe to and broadcast user "psp topics".
My current approach is to add a new message body type to the existing client-side messages. For example:
Next, I handle the business logic in session.go (which calls store.go's adapter for data persistence). I then use sub.meta <- msg for message broadcasting. The broadcast logic itself is written in topic.go within the handleMoment function. For instance, when someone publishes a "moment", it gets broadcast to the relevant "psp" users.
Additionally, I've added a new access control permission "V" in types.go's AccessMode to verify if a subscribing user is authorized to view my moments.
Is this a reasonable approach?
Thank you for your reply. So, my current approach is also acceptable, right?
I'm asking because I noticed the original project already has mutually subscribed p2p topics, so I was planning to use that as a base to extend a feature similar to Stories.