Skip to content

Commit

Permalink
threads: Fix replies
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdecook committed Aug 19, 2022
1 parent dbad498 commit caabc52
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/ircslack/irc_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,14 @@ func (ic *IrcContext) Start() {
opts = append(opts, slack.MsgOptionText(strings.TrimSpace(text), false))
if message.TargetTs != "" {
opts = append(opts, slack.MsgOptionTS(message.TargetTs))
if target[1] == ChannelPrefixThread[0] {
idx := strings.Index(target,message.TargetTs)
// strip the prefixes and the '-timestamp'
target = target[2:idx-1]
}
}
if _, _, err := ic.SlackClient.PostMessage(target, opts...); err != nil {
log.Warningf("Failed to post message to Slack to target %s: %v", target, err)
log.Warningf("Failed to post message to Slack to target %s: %v (targetTs: %v)", target, err, message.TargetTs)
}
}
textBuffer = make(map[string]string)
Expand Down

0 comments on commit caabc52

Please sign in to comment.