2021-09-14 19:25:37 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2021-09-16 10:18:44 +02:00
|
|
|
"log"
|
2021-09-27 10:23:31 +02:00
|
|
|
|
|
|
|
|
appConfig "bitbucket.org/outfrontmedia/rolling-stock-display-simulation-tool/config"
|
|
|
|
|
xmppService "bitbucket.org/outfrontmedia/rolling-stock-display-simulation-tool/services"
|
2021-09-14 19:25:37 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
|
|
|
|
|
// LOAD APPLICATION CONFIGURATION
|
|
|
|
|
appConfig.Load()
|
|
|
|
|
|
2021-09-15 17:20:11 +02:00
|
|
|
// Initialise XMPP service
|
2021-09-15 12:40:25 +02:00
|
|
|
xmppService.Init()
|
2021-09-15 17:20:11 +02:00
|
|
|
|
|
|
|
|
// Send online presence stanza
|
2021-09-15 12:40:25 +02:00
|
|
|
xmppServiceInstance := xmppService.Instance()
|
2021-09-16 10:18:44 +02:00
|
|
|
|
2021-09-27 19:23:30 +02:00
|
|
|
// Execute send online presence status message for every client and termintate program
|
|
|
|
|
if appConfig.AppConfig.GeneralOptions.ExecuteSingleStatusMessage {
|
|
|
|
|
xmppServiceInstance.ExecuteSingleStatusMessage()
|
|
|
|
|
log.Println("ExecuteSingleStatusMessage finished, online presente status message sent sucessfuly")
|
|
|
|
|
return
|
2021-09-16 10:18:44 +02:00
|
|
|
}
|
|
|
|
|
|
2021-09-27 19:23:30 +02:00
|
|
|
// Keep the servbie running
|
|
|
|
|
xmppServiceInstance.RunOnlinePresenceStatusIndefinetly()
|
2021-09-14 19:25:37 +02:00
|
|
|
}
|