Use intersection observer API for marking message as read (unread)
Use intersection observer API for marking message as read. This removes the need for our custom logic and is probably a lot more performant (probably more accurate as well).
- https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
- https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver
- https://developers.google.com/web/updates/2016/04/intersectionobserver
Currently, it is using manually tracking of scroll bounds and going through the collection summing the height until we are in the viewport.
automatically marking unread posts as read sometimes requires leaving the room and rejoining (sometimes you don’t want to mark all as read)
-- @Kontributer, https://gitter.im/gitterHQ/gitter?at=5cd06152e416b845193e91a4