diff options
author | xengineering <me@xengineering.eu> | 2023-07-05 21:26:12 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-07-05 21:26:12 +0200 |
commit | 4dc3723f68c390ed05ddeff13f2378da7ebf2b8f (patch) | |
tree | 8730a5d66eee402e2c552b904060ed7b495b07c4 | |
parent | ce7814012009ba8f5b72d49e2ec96d5594be895e (diff) | |
download | limox-4dc3723f68c390ed05ddeff13f2378da7ebf2b8f.tar limox-4dc3723f68c390ed05ddeff13f2378da7ebf2b8f.tar.zst limox-4dc3723f68c390ed05ddeff13f2378da7ebf2b8f.zip |
Apply go fmt
-rw-r--r-- | xmpp/message.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/xmpp/message.go b/xmpp/message.go index ba60390..e1ff8b6 100644 --- a/xmpp/message.go +++ b/xmpp/message.go @@ -1,24 +1,24 @@ package xmpp import ( - "log" "encoding/xml" - "math/rand" "fmt" + "log" + "math/rand" ) type message struct { XMLName xml.Name `xml:"jabber:client message"` - Type string `xml:"type,attr,omitempty"` - Id string `xml:"id,attr,omitempty"` - From string `xml:"from,attr,omitempty"` - To string `xml:"to,attr,omitempty"` + Type string `xml:"type,attr,omitempty"` + Id string `xml:"id,attr,omitempty"` + From string `xml:"from,attr,omitempty"` + To string `xml:"to,attr,omitempty"` // FIXME The lang attribute should have the `xml` prefix for the standard // XML namespace. There was no option found so far which allows this with // the standard library XML implementation and the xml.Encoder.Encode(v // any) function. - Lang string `xml:"lang,attr,omitempty"` - Body string `xml:"body,omitempty"` + Lang string `xml:"lang,attr,omitempty"` + Body string `xml:"body,omitempty"` } func handleMessage(s *session, m message) { @@ -31,11 +31,11 @@ func handleMessage(s *session, m message) { } } -func (s *session) sendMessage(m,j string) error { +func (s *session) sendMessage(m, j string) error { msg := message{ From: s.jid, - Id: fmt.Sprintf("%016x", rand.Uint64()), - To: j, + Id: fmt.Sprintf("%016x", rand.Uint64()), + To: j, Type: "chat", Lang: "en", Body: m, |