Added roling stock presence message to online presence stanza

This commit is contained in:
2021-09-15 12:54:38 +02:00
parent 251859773e
commit bfebfab3af

View File

@@ -12,6 +12,33 @@ import (
"gosrc.io/xmpp/stanza"
)
const rolingStockPresenceMessage = `ROLLING STOCK PRESENCE MESSAGE\n +{
"serial": "79101X02Y0029450001CJ2000",
"model": "VEN032FSNWM00",
"displayOrientation": "left",
"macAddress": "1c:c0:e1:42:5a:c4",
"node": "v8.16.2",
"nodeJS": "v8.16.2",
"fbi": "2.10-2ubuntu1",
"libgif7": "5.1.4-2ubuntu0.1",
"bsEdgeServer": "13.3.9-1",
"initopciVersion": "0.4~24",
"bspInstallVersion": "1.0~36",
"awsConfigsVersion": "2021.21.26-e7c5738",
"outGuard": "2021.36.23-dev-028972a",
"val": "1.1.11~129",
"broadSignPlayer": "13.3.9-1",
"displayUnitExternalID": "L-0141-M7-7281-Right-3SM-G02-02-79101X02Y0020040003EJ2001",
"privateIPaddress": "10.1.1.94",
"linux": {
"os": "Ubuntu 18.04.2 LTS",
"kernel": "4.18.20+10+opci",
"architecture": "x86-64"
},
"digiID": "digi-00000000-00000000-0040FFFF-FF801D30"
}
`
// XMPPService - struct containing
type XMPPService struct {
Router *xmpp.Router
@@ -76,6 +103,7 @@ func Init() {
// SendOnlinePresenceStanza - send online presence stnza with data, to server
func SendOnlinePresenceStanza(client *xmpp.Client, jid string) error {
onlinePresencePacket := stanza.NewPresence(stanza.Attrs{From: jid, Type: stanza.StanzaType(stanza.PresenceShowChat)})
onlinePresencePacket.Status = rolingStockPresenceMessage
//TODO All clients should send messages at once
for {