From bfebfab3afc26b53177dd9d5b3ebf6b8ac24eb7c Mon Sep 17 00:00:00 2001 From: "nedim.uka" Date: Wed, 15 Sep 2021 12:54:38 +0200 Subject: [PATCH] Added roling stock presence message to online presence stanza --- services/xmppsService.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/services/xmppsService.go b/services/xmppsService.go index 49732e6..1d992b0 100644 --- a/services/xmppsService.go +++ b/services/xmppsService.go @@ -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 {