Skip to content

Commit

Permalink
client: bugfix - include connector in new client
Browse files Browse the repository at this point in the history
  • Loading branch information
PurpShell committed Oct 10, 2024
1 parent 9c6b340 commit 45136b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/connector/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var (
_ bridgev2.ReadReceiptHandlingNetworkAPI = (*TwitterClient)(nil)
)

func NewTwitterClient(ctx context.Context, login *bridgev2.UserLogin) *TwitterClient {
func NewTwitterClient(ctx context.Context, tc *TwitterConnector, login *bridgev2.UserLogin) *TwitterClient {
log := zerolog.Ctx(ctx).With().
Str("component", "twitter_client").
Str("user_login_id", string(login.ID)).
Expand All @@ -68,7 +68,7 @@ func NewTwitterClient(ctx context.Context, login *bridgev2.UserLogin) *TwitterCl
}

twitClient.client.SetEventHandler(twitClient.HandleTwitterEvent)

twitClient.connector = tc
return twitClient
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type UserLoginMetadata struct {
}

func (tc *TwitterConnector) LoadUserLogin(ctx context.Context, login *bridgev2.UserLogin) error {
twitClient := NewTwitterClient(ctx, login)
twitClient := NewTwitterClient(ctx, tc, login)

_, currentUser, err := twitClient.client.LoadMessagesPage()
if err != nil {
Expand Down

0 comments on commit 45136b4

Please sign in to comment.