refactor(chat): use gateway identifier constructor

This commit is contained in:
ayn2op 2026-06-16 03:53:20 -04:00
parent a8e9aa92f8
commit 6a930ac2ac
2 changed files with 8 additions and 14 deletions

View file

@ -96,11 +96,10 @@ type (
}
SidebarConfig struct {
// WidthPercent is the percentage (%) of the total
// window width that the guilds tree sidebar occupies
WidthPercent int `toml:"width_percent"`
Markers SidebarMarkersConfig `toml:"markers"`
Indents SidebarIndentsConfig `toml:"indents"`
// WidthPercent is the percentage of the total window width that the guilds tree (sidebar) occupies.
WidthPercent int `toml:"width_percent"`
Markers SidebarMarkersConfig `toml:"markers"`
Indents SidebarIndentsConfig `toml:"indents"`
}
Config struct {

View file

@ -84,15 +84,10 @@ func NewModel(app *tview.Application, cfg *config.Config, token string) *Model {
m.composer = newComposer(cfg, m)
m.channelsPicker = newChannelsPicker(cfg, m)
identifyProps := http.IdentifyProperties()
gateway.DefaultIdentity = identifyProps
gateway.DefaultPresence = &gateway.UpdatePresenceCommand{
Status: m.cfg.Status,
}
id := gateway.DefaultIdentifier(token)
id.Compress = false
id.LargeThreshold = 0
id := gateway.NewIdentifier(gateway.IdentifyCommand{
Token: token,
Properties: http.IdentifyProperties(),
})
session := session.NewCustom(id, http.NewClient(token), handler.New())
state := state.NewFromSession(session, defaultstore.New())