Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove chatbase support #388

Merged
merged 1 commit into from
Nov 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions backends/rapidpro/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/jmoiron/sqlx"
"github.com/nyaruka/courier"
"github.com/nyaruka/courier/batch"
"github.com/nyaruka/courier/chatbase"
"github.com/nyaruka/courier/queue"
"github.com/nyaruka/courier/utils"
"github.com/nyaruka/gocommon/storage"
Expand All @@ -33,11 +32,6 @@ const msgQueueName = "msgs"
// the name of our set for tracking sends
const sentSetName = "msgs_sent_%s"

// constants used in org configs for chatbase
const chatbaseAPIKey = "CHATBASE_API_KEY"
const chatbaseVersion = "CHATBASE_VERSION"
const chatbaseMessageType = "agent"

// our timeout for backend operations
const backendTimeout = time.Second * 20

Expand Down Expand Up @@ -292,16 +286,6 @@ func (b *backend) MarkOutgoingMsgComplete(ctx context.Context, msg courier.Msg,
}
}
}

// if this org has chatbase connected, notify chatbase
chatKey, _ := msg.Channel().OrgConfigForKey(chatbaseAPIKey, "").(string)
if chatKey != "" {
chatVersion, _ := msg.Channel().OrgConfigForKey(chatbaseVersion, "").(string)
err := chatbase.SendChatbaseMessage(chatKey, chatVersion, chatbaseMessageType, dbMsg.ContactID_.String(), msg.Channel().Name(), msg.Text(), time.Now().UTC())
if err != nil {
logrus.WithError(err).WithField("chatbase_api_key", chatKey).WithField("chatbase_version", chatVersion).WithField("msg_id", dbMsg.ID().String()).Error("unable to write chatbase message")
}
}
}

// WriteMsg writes the passed in message to our store
Expand Down
50 changes: 0 additions & 50 deletions chatbase/chatbase.go

This file was deleted.

64 changes: 0 additions & 64 deletions chatbase/chatbase_test.go

This file was deleted.