MCPcopy Create free account
hub / github.com/gotify/server / Notify

Method Notify

api/stream/stream.go:83–91  ·  view source on GitHub ↗

Notify notifies the clients with the given userID that a new messages was created.

(userID uint, msg *model.MessageExternal)

Source from the content-addressed store, hash-verified

81
82// Notify notifies the clients with the given userID that a new messages was created.
83func (a *API) Notify(userID uint, msg *model.MessageExternal) {
84 a.lock.RLock()
85 defer a.lock.RUnlock()
86 if clients, ok := a.clients[userID]; ok {
87 for _, c := range clients {
88 c.write <- msg
89 }
90 }
91}
92
93func (a *API) remove(remove *client) {
94 a.lock.Lock()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected