2019-12-13 18:08:26 +00:00
|
|
|
package model
|
|
|
|
|
|
|
|
type Session struct {
|
2022-11-11 22:20:49 +00:00
|
|
|
UserID string `json:"uid,omitempty"`
|
|
|
|
Instance string `json:"ins,omitempty"`
|
|
|
|
ClientID string `json:"cid,omitempty"`
|
|
|
|
ClientSecret string `json:"cs,omitempty"`
|
|
|
|
AccessToken string `json:"at,omitempty"`
|
|
|
|
CSRFToken string `json:"csrf,omitempty"`
|
|
|
|
Settings Settings `json:"sett,omitempty"`
|
2019-12-13 18:08:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (s Session) IsLoggedIn() bool {
|
|
|
|
return len(s.AccessToken) > 0
|
|
|
|
}
|
2022-11-11 22:20:49 +00:00
|
|
|
|
|
|
|
type Settings struct {
|
|
|
|
DefaultVisibility string `json:"dv,omitempty"`
|
|
|
|
DefaultFormat string `json:"df,omitempty"`
|
|
|
|
CopyScope bool `json:"cs,omitempty"`
|
|
|
|
ThreadInNewTab bool `json:"tnt,omitempty"`
|
|
|
|
HideAttachments bool `json:"ha,omitempty"`
|
|
|
|
MaskNSFW bool `json:"mn,omitempty"`
|
|
|
|
NotificationInterval int `json:"ni,omitempty"`
|
|
|
|
FluorideMode bool `json:"fm,omitempty"`
|
|
|
|
DarkMode bool `json:"dm,omitempty"`
|
|
|
|
AntiDopamineMode bool `json:"adm,omitempty"`
|
|
|
|
HideUnsupportedNotifs bool `json:"hun,omitempty"`
|
|
|
|
InstanceEmojiFilter string `json:"iemojfilter,omitempty"`
|
|
|
|
AddReactionsFilter string `json:"reactionfilter,omitempty"`
|
|
|
|
CSS string `json:"css,omitempty"`
|
2023-10-15 15:53:44 +00:00
|
|
|
CSSHash string `json:"cssh,omitempty"`
|
2022-11-11 22:20:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewSettings() *Settings {
|
|
|
|
return &Settings{
|
|
|
|
DefaultVisibility: "public",
|
|
|
|
DefaultFormat: "",
|
|
|
|
CopyScope: true,
|
|
|
|
ThreadInNewTab: false,
|
|
|
|
HideAttachments: false,
|
|
|
|
MaskNSFW: true,
|
|
|
|
NotificationInterval: 0,
|
|
|
|
FluorideMode: false,
|
|
|
|
DarkMode: false,
|
|
|
|
AntiDopamineMode: false,
|
|
|
|
HideUnsupportedNotifs: false,
|
|
|
|
InstanceEmojiFilter: "",
|
|
|
|
AddReactionsFilter: "",
|
|
|
|
CSS: "",
|
2023-10-15 15:53:44 +00:00
|
|
|
CSSHash: "",
|
2022-11-11 22:20:49 +00:00
|
|
|
}
|
|
|
|
}
|