Files
mostlymatter/server/channels/app/web_hub.go
Agniva De Sarker b200a07881 v8.0 module release (#22975)
https://mattermost.atlassian.net/browse/MM-52079

```release-note
We upgrade the module version to 8.0. The new module path is github.com/mattermost-server/server/v8.
```


Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
2023-04-18 11:05:28 +05:30

70 строки
2.2 KiB
Go

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package app
import (
"github.com/mattermost/mattermost-server/server/v8/channels/app/platform"
"github.com/mattermost/mattermost-server/server/v8/model"
)
func (a *App) TotalWebsocketConnections() int {
return a.Srv().Platform().TotalWebsocketConnections()
}
func (a *App) GetHubForUserId(userID string) *platform.Hub {
return a.Srv().Platform().GetHubForUserId(userID)
}
// HubRegister registers a connection to a hub.
func (a *App) HubRegister(webConn *platform.WebConn) {
a.Srv().Platform().HubRegister(webConn)
}
// HubUnregister unregisters a connection from a hub.
func (a *App) HubUnregister(webConn *platform.WebConn) {
a.Srv().Platform().HubUnregister(webConn)
}
func (a *App) Publish(message *model.WebSocketEvent) {
a.Srv().Platform().Publish(message)
}
func (ch *Channels) Publish(message *model.WebSocketEvent) {
ch.srv.Platform().Publish(message)
}
func (a *App) invalidateCacheForChannelMembers(channelID string) {
a.Srv().Platform().InvalidateCacheForChannelMembers(channelID)
}
func (a *App) invalidateCacheForChannelMembersNotifyProps(channelID string) {
a.Srv().Platform().InvalidateCacheForChannelMembersNotifyProps(channelID)
}
func (a *App) invalidateCacheForChannelPosts(channelID string) {
a.Srv().Platform().InvalidateCacheForChannelPosts(channelID)
}
func (a *App) InvalidateCacheForUser(userID string) {
a.Srv().Platform().InvalidateCacheForUser(userID)
}
func (a *App) invalidateCacheForUserTeams(userID string) {
a.Srv().Platform().InvalidateCacheForUserTeams(userID)
}
// UpdateWebConnUserActivity sets the LastUserActivityAt of the hub for the given session.
func (a *App) UpdateWebConnUserActivity(session model.Session, activityAt int64) {
a.Srv().Platform().UpdateWebConnUserActivity(session, activityAt)
}
// SessionIsRegistered determines if a specific session has been registered
func (a *App) SessionIsRegistered(session model.Session) bool {
return a.Srv().Platform().SessionIsRegistered(session)
}
func (a *App) CheckWebConn(userID, connectionID string) *platform.CheckConnResult {
return a.Srv().Platform().CheckWebConn(userID, connectionID)
}