Skip to content

Commit

Permalink
Remove chatbase support
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed Nov 22, 2021
1 parent 0ae35b6 commit 7d49998
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 130 deletions.
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.

0 comments on commit 7d49998

Please sign in to comment.