diff options
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r-- | bridge/slack/slack.go | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index c4689cbc..0951fb10 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -324,10 +324,8 @@ func (b *Bslack) deleteMessage(msg *config.Message, channelInfo *slack.Channel) return true, nil } - // If we get a "slack <ID>", split it. - ts := strings.Fields(msg.ID) for { - _, _, err := b.rtm.DeleteMessage(channelInfo.ID, ts[1]) + _, _, err := b.rtm.DeleteMessage(channelInfo.ID, msg.ID) if err == nil { return true, nil } @@ -344,9 +342,8 @@ func (b *Bslack) editMessage(msg *config.Message, channelInfo *slack.Channel) (b return false, nil } - ts := strings.Fields(msg.ID) for { - _, _, _, err := b.rtm.UpdateMessage(channelInfo.ID, ts[1], msg.Text) + _, _, _, err := b.rtm.UpdateMessage(channelInfo.ID, msg.ID, msg.Text) if err == nil { return true, nil } @@ -362,7 +359,7 @@ func (b *Bslack) postMessage(msg *config.Message, messageParameters *slack.PostM for { _, id, err := b.rtm.PostMessage(channelInfo.ID, msg.Text, *messageParameters) if err == nil { - return "slack " + id, nil + return id, nil } if err = b.handleRateLimit(err); err != nil { @@ -413,10 +410,7 @@ func (b *Bslack) prepareMessageParameters(msg *config.Message) *slack.PostMessag params.Username = msg.Username params.LinkNames = 1 // replace mentions params.IconURL = config.GetIconURL(msg, b.GetString(iconURLConfig)) - msgFields := strings.Fields(msg.ParentID) - if len(msgFields) >= 2 { - params.ThreadTimestamp = msgFields[1] - } + params.ThreadTimestamp = msg.ParentID if msg.Avatar != "" { params.IconURL = msg.Avatar } |