MM-56071: Thread presence indicator (#25694)

We also track the channelID of the thread opened.

Additionally on every connection create or re-connect
with an existing queue, we reset the active state to empty
to avoid any edge-cases.

https://mattermost.atlassian.net/browse/MM-56071

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2023-12-13 13:58:40 +05:30
коммит произвёл GitHub
родитель 45ba1dc196
Коммит c42ae47948
6 изменённых файлов: 56 добавлений и 9 удалений

Просмотреть файл

@@ -342,6 +342,14 @@ func (wsc *WebSocketClient) UpdateActiveTeam(teamID string) {
wsc.SendMessage(string(WebsocketPresenceIndicator), data)
}
// UpdateActiveThread sets the channel id of the current thread that the user is in.
func (wsc *WebSocketClient) UpdateActiveThread(channelID string) {
data := map[string]any{
"thread_channel_id": channelID,
}
wsc.SendMessage(string(WebsocketPresenceIndicator), data)
}
func (wsc *WebSocketClient) configurePingHandling() {
wsc.Conn.SetPingHandler(wsc.pingHandler)
wsc.pingTimeoutTimer = time.NewTimer(time.Second * (60 + PingTimeoutBufferSeconds))