Skip to content

Commit

Permalink
twittermeow/client: disable fetching account settings
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 2, 2024
1 parent 46e0f94 commit 8e0dbf1
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions pkg/twittermeow/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,35 +121,36 @@ func (c *Client) LoadMessagesPage() (*response.XInboxData, *response.AccountSett
return nil, nil, fmt.Errorf("failed to load messages page: %w", err)
}

data, err := c.GetAccountSettings(payload.AccountSettingsQuery{
IncludeExtSharingAudiospacesListeningDataWithFollowers: true,
IncludeMentionFilter: true,
IncludeNSFWUserFlag: true,
IncludeNSFWAdminFlag: true,
IncludeRankedTimeline: true,
IncludeAltTextCompose: true,
Ext: "ssoConnections",
IncludeCountryCode: true,
IncludeExtDMNSFWMediaFilter: true,
})
if err != nil {
return nil, nil, fmt.Errorf("failed to get account settings: %w", err)
}
//data, err := c.GetAccountSettings(payload.AccountSettingsQuery{
// IncludeExtSharingAudiospacesListeningDataWithFollowers: true,
// IncludeMentionFilter: true,
// IncludeNSFWUserFlag: true,
// IncludeNSFWAdminFlag: true,
// IncludeRankedTimeline: true,
// IncludeAltTextCompose: true,
// Ext: "ssoConnections",
// IncludeCountryCode: true,
// IncludeExtDMNSFWMediaFilter: true,
//})
//if err != nil {
// return nil, nil, fmt.Errorf("failed to get account settings: %w", err)
//}

initialInboxState, err := c.GetInitialInboxState(ptr.Ptr(payload.DMRequestQuery{}.Default()))
if err != nil {
return nil, nil, fmt.Errorf("failed to get initial inbox state: %w", err)
}

c.session.SetCurrentUser(data)
//c.session.SetCurrentUser(data)
c.session.SetCurrentUser(&response.AccountSettingsResponse{})
c.polling.SetCurrentCursor(initialInboxState.InboxInitialState.Cursor)

c.Logger.Info().
Str("screen_name", data.ScreenName).
//Str("screen_name", data.ScreenName).
Str("initial_inbox_cursor", initialInboxState.InboxInitialState.Cursor).
Msg("Successfully loaded and authenticated as user")

return &initialInboxState.InboxInitialState, data, nil
return &initialInboxState.InboxInitialState, &response.AccountSettingsResponse{}, nil
}

func (c *Client) GetCurrentUser() *response.AccountSettingsResponse {
Expand Down

0 comments on commit 8e0dbf1

Please sign in to comment.