Skip to content
quarry Artifact [541f2dca90]
Login

Artifact [541f2dca90]

Artifact 541f2dca904e36fd4467a4a18be4078e624066b2d26220465e1353f4820c2a8f:


package web

// chatNotifyChoice is one thing a reader can hear from a chat channel,
// as the channel header's bell offers it (api/chatnotify.go).
type chatNotifyChoice struct {
	Mode  string // the op's word: mentions, all, off
	Label string // the menu's line
	Says  string // what it means, under the line
	Word  string // the bell's own word for it when chosen
}

// chatNotifyChoices are the bell's menu, in order.
var chatNotifyChoices = []chatNotifyChoice{
	{"mentions", "Mentions", "Only messages that name you", "Mentions"},
	{"all", "Every message", "Everything here, as an email digest at most every 30 minutes", "All"},
	{"off", "Off", "Nothing from this channel, not even mentions", "Off"},
}

// chatNotifyWord is the bell's word for mode.
func chatNotifyWord(mode string) string {
	for _, c := range chatNotifyChoices {
		if c.Mode == mode {
			return c.Word
		}
	}
	return "Mentions"
}