discourse/plugins/chat/app/services/chat
Martin Brennan 9953a6edd9
DEV: Rearchitect chat tracking state (#21550)
This moves chat tracking state calculation for channels
and threads into a central Chat::TrackingStateManager service, that
serves a similar purpose to the TopicTrackingState model
in core.

This service calls down to these query classes:

* ThreadUnreadsQuery
* ChannelUnreadsQuery

To get the unread_count and mention_count for the appropriate
channels and threads.

As well as this, this commit refactors the client-side chat
tracking state.

Now, there is a central ChatTrackingStateManager Ember Service
so all tracking is accessible and can be counted from one place,
which can also initialize tracking from an initial payload.

The actual tracking counts are now maintained in a ChatTrackingState
class that is initialized on the `.tracking` property of both channel and
thread objects.

This removes the attributes on UserChatChannelMembership and decoration
of said membership from ChannelFetcher, preferring instead to have an additional
object for tracking in the JSON.
2023-05-16 14:51:13 +02:00
..
action FEATURE: Create and update thread memberships (#21501) 2023-05-11 14:35:26 +02:00
auto_remove
create_category_channel.rb DEV: Move channel creation for category into service (#21167) 2023-04-24 09:15:16 +10:00
lookup_channel_threads.rb FIX: Handle deleted original message for thread index (#21470) 2023-05-10 13:58:15 +02:00
lookup_thread.rb
mark_all_user_channels_read.rb FIX: Thread mention read state and notification links (#21385) 2023-05-04 17:28:51 +02:00
message_destroyer.rb FIX: Incorrect unread count shown in channel when message deleted (#21410) 2023-05-05 15:28:48 +02:00
publisher.rb DEV: Rearchitect chat tracking state (#21550) 2023-05-16 14:51:13 +02:00
restore_message.rb FEATURE: Reintroduce better thread reply counter cache (#21197) 2023-04-24 09:32:04 +10:00
tracking_state.rb DEV: Rearchitect chat tracking state (#21550) 2023-05-16 14:51:13 +02:00
trash_channel.rb
trash_message.rb DEV: When deleting a chat message, do not delete mention records (#21486) 2023-05-11 20:05:59 +04:00
update_channel_status.rb
update_channel.rb
update_thread.rb FEATURE: Thread list initial UI (#21412) 2023-05-10 11:42:32 +02:00
update_user_last_read.rb FIX: Thread mention read state and notification links (#21385) 2023-05-04 17:28:51 +02:00
update_user_thread_last_read.rb FEATURE: Create and update thread memberships (#21501) 2023-05-11 14:35:26 +02:00