refactor(chat): use gateway identifier constructor
This commit is contained in:
parent
a8e9aa92f8
commit
6a930ac2ac
2 changed files with 8 additions and 14 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue