Example #1
0
// UpdateTitle updates the title
func UpdateTitle() {
	var title string
	chanData := data.MustGetChannel(GetActiveNetwork(), GetActiveChannel())
	if len(chanData.Topic) != 0 {
		title = chanData.Topic
	} else {
		title = GetActiveChannel()
	}
	jq("#title").SetText(title)
}
Example #2
0
// AcceptInvite accepts an invite
func AcceptInvite(network, channel string) {
	GetChannel(network, channel).Empty()

	chanData := data.MustGetChannel(network, channel)
	if !chanData.HistoryFetched {
		GetHistory(network, channel, 512)
	}

	data.Messages <- messages.Container{
		Type: "message",
		Object: messages.Message{
			Network: network,
			Channel: channel,
			Command: "join",
			Message: "Joining",
		},
	}
}
Example #3
0
// OnChangeNotifications updates the notification level in the data store
func OnChangeNotifications() {
	data.MustGetChannel(GetActiveNetwork(), GetActiveChannel()).Notifications = data.ParseNotificationLevel(jq("#channel-notifications").Val())
}