Initial commit #1

Merged
senaduka merged 16 commits from initial-commit into main 2021-09-20 12:53:21 +02:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit 4d7a973293 - Show all commits

View File

@@ -10,7 +10,10 @@ func main() {
// LOAD APPLICATION CONFIGURATION
appConfig.Load()
// Initialise XMPP service
xmppService.Init()
// Send online presence stanza
xmppServiceInstance := xmppService.Instance()
xmppService.SendOnlinePresenceStanza(xmppServiceInstance.XMPPClients[0].Client, xmppServiceInstance.XMPPClients[0].Config.Jid)
}

View File

@@ -124,8 +124,9 @@ func handleMessage(s xmpp.Sender, p stanza.Packet) {
return
}
log.Printf("Received The message %v", msg)
_, _ = fmt.Fprintf(os.Stdout, "Body = %s - from = %s\n", msg.Body, msg.From)
reply := stanza.Message{Attrs: stanza.Attrs{To: msg.From}, Body: msg.Body}
reply := stanza.Message{Attrs: stanza.Attrs{To: msg.From}, Body: `{"status": "OK"}`}
err := s.Send(reply)
log.Printf("Error sending message %v", err)
}