Skip to content

Commit

Permalink
Merge pull request #87 from communityconnectlabs/feat/opt-back-in
Browse files Browse the repository at this point in the history
fix: avoid to consider a substr as the full keyword
  • Loading branch information
teehamaral authored Dec 11, 2024
2 parents 11ae8b3 + 0dbdaa0 commit d94bc17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/tasks/handler/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ func handleMsgEvent(ctx context.Context, rt *runtime.Runtime, event *MsgEvent, s
// stopped contact? they are unstopped if they send us an incoming message
newContact := event.NewContact
if modelContact.Status() == models.ContactStatusStopped {
if strings.Contains(rt.Config.OptBackInKeywords, strings.ToUpper(event.Text)) {
optBackInKeywords := strings.Split(rt.Config.OptBackInKeywords, " ")
if utils.StringSliceContains(optBackInKeywords, event.Text, false) {
err := modelContact.Unstop(ctx, rt.DB)
if err != nil {
return errors.Wrapf(err, "error unstopping contact")
Expand Down

0 comments on commit d94bc17

Please sign in to comment.