XMPP debug output
This commit is contained in:
parent
aceced844a
commit
5f09a187ce
|
@ -9,7 +9,7 @@ type Config struct {
|
|||
Host string
|
||||
Connection string
|
||||
Secret string
|
||||
XMPPLog bool `toml:"xmpp_log"`
|
||||
XMPPDebug bool `toml:"xmpp_debug"`
|
||||
Special map[string]interface{}
|
||||
|
||||
xmpp *xmpp.Component
|
||||
|
|
|
@ -91,7 +91,7 @@ func (c *Config) receiving(packet xmpp.Packet) (xmpp.Packet, bool) {
|
|||
}
|
||||
|
||||
case xmpp.Message:
|
||||
if c.XMPPLog {
|
||||
if c.XMPPDebug {
|
||||
logger.WithFields(map[string]interface{}{
|
||||
"from": p.PacketAttrs.From,
|
||||
"to": p.PacketAttrs.To,
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
func TestReceive(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
c := Config{Host: "example.org", Type: "monkeyservice"}
|
||||
c := Config{Host: "example.org", Type: "monkeyservice", XMPPDebug: true}
|
||||
|
||||
// ignoring packet
|
||||
p, _ := c.receiving(xmpp.Handshake{})
|
||||
|
|
|
@ -22,7 +22,7 @@ func (c *Config) sending(packet xmpp.Packet) xmpp.Packet {
|
|||
} else {
|
||||
p.PacketAttrs.From += "@" + c.Host
|
||||
}
|
||||
if c.XMPPLog {
|
||||
if c.XMPPDebug {
|
||||
logger.WithFields(map[string]interface{}{
|
||||
"from": p.PacketAttrs.From,
|
||||
"to": p.PacketAttrs.To,
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
func TestSend(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
c := Config{Host: "example.org"}
|
||||
c := Config{Host: "example.org", XMPPDebug: true}
|
||||
|
||||
// ignoring packet
|
||||
p := c.sending(xmpp.IQ{})
|
||||
|
|
|
@ -5,7 +5,7 @@ type = "threema"
|
|||
host = "threema.chat.sum7.eu"
|
||||
connection = "localhost:5347"
|
||||
secret = "change_me"
|
||||
xmpp_log = false
|
||||
xmpp_debug = false
|
||||
|
||||
[component.special]
|
||||
http_upload_url = "https://example.org/upload/threema"
|
||||
|
|
Reference in New Issue