Add plugin websocket hooks (#18151)
* Add plugin websocket hooks * Improve sending message mechanism and filter out of the router plugin specific messages * Return and manage error if the request clone fails * Wording change to avoid repetition Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b66fd1f89e
Коммит
0ae681464e
@@ -168,3 +168,21 @@ func (hooks *hooksTimerLayer) OnPluginClusterEvent(c *Context, ev model.PluginCl
|
||||
hooks.hooksImpl.OnPluginClusterEvent(c, ev)
|
||||
hooks.recordTime(startTime, "OnPluginClusterEvent", true)
|
||||
}
|
||||
|
||||
func (hooks *hooksTimerLayer) OnWebSocketConnect(webConnID, userID string) {
|
||||
startTime := timePkg.Now()
|
||||
hooks.hooksImpl.OnWebSocketConnect(webConnID, userID)
|
||||
hooks.recordTime(startTime, "OnWebSocketConnect", true)
|
||||
}
|
||||
|
||||
func (hooks *hooksTimerLayer) OnWebSocketDisconnect(webConnID, userID string) {
|
||||
startTime := timePkg.Now()
|
||||
hooks.hooksImpl.OnWebSocketDisconnect(webConnID, userID)
|
||||
hooks.recordTime(startTime, "OnWebSocketDisconnect", true)
|
||||
}
|
||||
|
||||
func (hooks *hooksTimerLayer) WebSocketMessageHasBeenPosted(webConnID, userID string, req *model.WebSocketRequest) {
|
||||
startTime := timePkg.Now()
|
||||
hooks.hooksImpl.WebSocketMessageHasBeenPosted(webConnID, userID, req)
|
||||
hooks.recordTime(startTime, "WebSocketMessageHasBeenPosted", true)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user