Database structure
https://excalidraw.com/#token#json=XYLUkZaVmv0MpDtw2fQKk6583019510956032,3U8twxl8OgyBScD1yXFTXQ
...
New additions are colored green.
Table | Column | Definition |
---|---|---|
Channels | TotalMsgCountRoot | Total number of root messages |
ChannelMembers | MsgCountRoot | Number of seen root messages |
MentionCountRoot | Number of unread mentions in root messages | |
Threads | PostId | Id of the root post |
ChannelId | ||
ReplyCount | Number or reply posts in this thread | |
LastReplyAt | Timestamp of the last reply | |
Participants | json array of all thread member IDs | |
ThreadMemberships | PostId | Id of the root post |
UserId | Id of the user | |
Following | Is the thread followed | |
UnreadMentions | Number of unread mentions for this user in the thread | |
LastViewed | Timestamp of when the thread was last viewed | |
LastUpdated | Timestamp of the last change to the thread (follow state, mentions, etc) |
API
https://api.mattermost.com/#tag/threads
New APIs
Path | Method | Description |
---|---|---|
api/v4/users/{user_id}/teams/{team_id}/threads | GET | Return threads that the user is following |
api/v4/users/{user_id}/teams/{team_id}/threads/read | PUT | Mark all threads as read |
api/v4/users/{user_id}/teams/{team_id}/{thread_id} | GET | Get one thread by Id |
api/v4/users/{user_id}/teams/{team_id}/{thread_id}/following | PUT | Start following a thread |
api/v4/users/{user_id}/teams/{team_id}/{thread_id}/following | DELETE | Stop following a thread |
api/v4/users/{user_id}/teams/{team_id}/{thread_id}/read/{timestamp} | PUT | Change ‘read’ state of a thread based on the timestamp |
...
Additional ‘following’ boolean will be added
Related PRs
https://github.com/mattermost/mattermost-server/pull/15878
https://github.com/mattermost/mattermost-server/pull/17390
https://github.com/mattermost/mattermost-server/pull/17343
https://github.com/mattermost/mattermost-server/pull/17150
https://github.com/mattermost/mattermost-server/pull/17099
https://github.com/mattermost/mattermost-server/pull/17093
https://github.com/mattermost/mattermost-server/pull/17064
https://github.com/mattermost/mattermost-server/pull/16909
https://github.com/mattermost/mattermost-server/pull/16659
https://github.com/mattermost/mattermost-server/pull/16503
https://github.com/mattermost/mattermost-server/pull/16407
https://github.com/mattermost/mattermost-server/pull/16304
https://github.com/mattermost/mattermost-server/pull/16091