Skip to content
quarry Artifact [22235bbb6c]
Login

Artifact [22235bbb6c]

Artifact 22235bbb6cb7888b7257f93c469b7fb497d86b8afd0783252a6235b0fd39f598:


package api

// NotifyChatBridgeStopped tells one of a repository's admins that its
// Fossil chat bridge stopped itself because the other server kept
// refusing its login, and that it waits for them: a new credential or
// Resume on the settings page. It is sent once per stop (the caller
// speaks only on the transition into stopped), to each admin once; the
// key names the repository and the stop, so a later stop is its own
// news.
//
// It rides the landing family, as an import's ending does: work the
// person is answerable for that now wants their attention, with the
// push and inbox row that family already carries.
func (d Deps) NotifyChatBridgeStopped(repo, to, stopped, why string) {
	if !personTo(to) {
		return
	}
	d.fireNotify(NotifyEvent{
		Workflow: "quarry-landing", To: to,
		Payload: map[string]any{
			"repo": repo, "from": "chat bridge", "surface": "chat bridge",
			"summary": "The chat bridge on " + repo + " stopped: " + clipNote(why, 160),
			"link":    d.link("/r/" + repo + "/settings#chat-bridge"),
		},
		TxnID: "chatbridge-stopped:" + repo + ":" + stopped + ":" + to,
	})
}