OdyseeTeam / commentron

MIT License
11 stars 11 forks source link

Mark streamer + mods with a flag on comment list #44

Open tzarebczan opened 3 years ago

tzarebczan commented 3 years ago

Add an additional field that identifies someone as the streamer(Channel owner) and delegated mods.

tzarebczan commented 3 years ago

This should also apply to comment list, not only the web socket ones

tzarebczan commented 3 years ago

We have the UI Side done, but it's a bit wonky that existing comments don't show it, and they disappear on refresh.

tiger5226 commented 2 years ago

This is a potentially really expensive task for comment.List. We need to lookup each channel who made each comment, and check the status as global mod or delegated mod. The alternative is to save this information to the comment itself so it's easily retrievable. However, being a mod is dynamic, and certainly not set in stone. So we risk showing incorrect information by saving to the comment table. This is also just bad practice, and it's something that is just shotty.

Maybe as an alternative we list mods with an API call for a particular claim. Then we can cache the call by channel, even caching the global mods to make it easier. It would also be a more performant check. Then the client can just check the map during presentation to see if the user is a mod to present it differently. Also the result works much better for pagination as well.

The reason this is easy for the live chat is because we are doing the check on creation, then piping that result via the websocket service. We do not have many create calls in comparison to list calls. So it's not as taxing.

tzarebczan commented 2 years ago

Would be nice if it was all in the same API, but if you think it's a performance concern, we can create a separate on based on claim id.