forked from cwtch.im/ui
22 lines
453 B
Go
22 lines
453 B
Go
|
package characters
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
"bounce/go/the"
|
||
|
"bounce/go/gobjects"
|
||
|
)
|
||
|
|
||
|
func GroupPoller(getContact func(string) *gobjects.Contact, updateContact func(string)) {
|
||
|
for {
|
||
|
time.Sleep(time.Second * 4)
|
||
|
|
||
|
servers := the.Peer.GetServers()
|
||
|
groups := the.Peer.GetGroups()
|
||
|
for i := range groups {
|
||
|
group := the.Peer.GetGroup(groups[i])
|
||
|
getContact(group.GroupID).Status = int(servers[group.GroupServer])
|
||
|
updateContact(group.GroupID)
|
||
|
}
|
||
|
}
|
||
|
}
|