matrix: get the type from the correct variable.

run gofmt
This commit is contained in:
David Hill
2018-11-07 11:48:57 -05:00
parent 45c44aee50
commit 1a26475fbb
3 changed files with 9 additions and 9 deletions

View File

@@ -161,7 +161,8 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) {
// Text must be a string
if rmsg.Text, ok = ev.Content["body"].(string); !ok {
b.Log.Errorf("Content[body] wasn't a %T ?", rmsg.Text)
b.Log.Errorf("Content[body] is not a string: %T\n%#v",
ev.Content["body"], ev.Content)
return
}

View File

@@ -166,15 +166,14 @@ func (b *Bslack) handleMessageEvent(ev *slack.MessageEvent) (*config.Message, er
}
rmsg := config.Message{
Text: ev.Text,
Channel: channelInfo.Name,
Account: b.Account,
ID: "slack " + ev.Timestamp,
Extra: map[string][]interface{}{},
Text: ev.Text,
Channel: channelInfo.Name,
Account: b.Account,
ID: "slack " + ev.Timestamp,
Extra: map[string][]interface{}{},
ParentID: ev.ThreadTimestamp,
}
if b.useChannelID {
rmsg.Channel = "ID:" + channelInfo.ID
}

View File

@@ -310,9 +310,9 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM
msg.Channel = originchannel
}
msg.ParentID = gw.getDestMsgID(canonicalParentMsgID, dest, channel)
msg.ParentID = gw.getDestMsgID(canonicalParentMsgID, dest, channel)
if msg.ParentID == "" {
msg.ParentID = canonicalParentMsgID
msg.ParentID = canonicalParentMsgID
}
mID, err := dest.Send(msg)