summaryrefslogtreecommitdiff
path: root/xmpp/message.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-07-04 22:30:44 +0200
committerxengineering <me@xengineering.eu>2023-07-04 22:30:44 +0200
commit107f97f2cd3ff8dbbdb39269e622462c48b0d41c (patch)
treecbd5120bf4f27fdcacd95313f7c1e0b6dd37e773 /xmpp/message.go
parent48811e7d2487ebc3db49b8af7e20f57db4ac28f4 (diff)
downloadlimox-107f97f2cd3ff8dbbdb39269e622462c48b0d41c.tar
limox-107f97f2cd3ff8dbbdb39269e622462c48b0d41c.tar.zst
limox-107f97f2cd3ff8dbbdb39269e622462c48b0d41c.zip
Implement (chat) message receiving backend
This sets a handler and the routing up to be able to log chat messages with body and sender reference. This can later be used for the GUI.
Diffstat (limited to 'xmpp/message.go')
-rw-r--r--xmpp/message.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/xmpp/message.go b/xmpp/message.go
new file mode 100644
index 0000000..58dc657
--- /dev/null
+++ b/xmpp/message.go
@@ -0,0 +1,17 @@
+package xmpp
+
+import (
+ "log"
+)
+
+type message struct {
+ Type string `xml:"type,attr"`
+ From string `xml:"from,attr"`
+ Body string `xml:"body"`
+}
+
+func handleMessage(s *session, m message) {
+ if m.Type == "chat" {
+ log.Printf("Got message '%s' from '%s'.\n", m.Body, m.From)
+ }
+}