matrix: get the type from the correct variable.
run gofmt
This commit is contained in:
@@ -161,7 +161,8 @@ func (b *Bmatrix) handleEvent(ev *matrix.Event) {
|
|||||||
|
|
||||||
// Text must be a string
|
// Text must be a string
|
||||||
if rmsg.Text, ok = ev.Content["body"].(string); !ok {
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,15 +166,14 @@ func (b *Bslack) handleMessageEvent(ev *slack.MessageEvent) (*config.Message, er
|
|||||||
}
|
}
|
||||||
|
|
||||||
rmsg := config.Message{
|
rmsg := config.Message{
|
||||||
Text: ev.Text,
|
Text: ev.Text,
|
||||||
Channel: channelInfo.Name,
|
Channel: channelInfo.Name,
|
||||||
Account: b.Account,
|
Account: b.Account,
|
||||||
ID: "slack " + ev.Timestamp,
|
ID: "slack " + ev.Timestamp,
|
||||||
Extra: map[string][]interface{}{},
|
Extra: map[string][]interface{}{},
|
||||||
ParentID: ev.ThreadTimestamp,
|
ParentID: ev.ThreadTimestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if b.useChannelID {
|
if b.useChannelID {
|
||||||
rmsg.Channel = "ID:" + channelInfo.ID
|
rmsg.Channel = "ID:" + channelInfo.ID
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,9 +310,9 @@ func (gw *Gateway) handleMessage(msg config.Message, dest *bridge.Bridge) []*BrM
|
|||||||
msg.Channel = originchannel
|
msg.Channel = originchannel
|
||||||
}
|
}
|
||||||
|
|
||||||
msg.ParentID = gw.getDestMsgID(canonicalParentMsgID, dest, channel)
|
msg.ParentID = gw.getDestMsgID(canonicalParentMsgID, dest, channel)
|
||||||
if msg.ParentID == "" {
|
if msg.ParentID == "" {
|
||||||
msg.ParentID = canonicalParentMsgID
|
msg.ParentID = canonicalParentMsgID
|
||||||
}
|
}
|
||||||
|
|
||||||
mID, err := dest.Send(msg)
|
mID, err := dest.Send(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user