Beispiel #1
0
func (ms *Messages) add(m Message) {
	infoLn("add", m)
	ms.list = append(ms.list, m)
	infoLn(ms.Len)
	ms.Len = len(ms.list)
	infoLn(ms.Len)

	qml.Changed(ms, &ms.Len)
}
Beispiel #2
0
func (ms *Messages) MarkSent(ID int) {
	for i := ms.Len - 1; i > 0; i-- {
		if ms.list[i].ID != ID {
			continue
		}

		ms.list[i].Processing = false

		tmp := ms.Len
		ms.Len = -1
		qml.Changed(ms, &ms.Len)
		ms.Len = tmp
		return
	}
}
Beispiel #3
0
func (cs *Channels) GetChannels(excludeArchived bool) {
	channels, err := API.GetChannels(excludeArchived)
	if err != nil {
		errorLn(err.Error())
		return
	}

	for _, channel := range channels {
		infoLn(channel)
		c := Channel{}
		c.transformFromBackend(channel)

		cs.list = append(cs.list, c)
	}
	cs.Len = len(cs.list)

	qml.Changed(cs, &cs.Len)
}