Bläddra i källkod

feat(config): add browser_version field to identify field (#191)

ayntgl 3 år sedan
förälder
incheckning
57471984ac
2 ändrade filer med 12 tillägg och 8 borttagningar
  1. 8 6
      config/config.go
  2. 4 2
      ui/app.go

+ 8 - 6
config/config.go

@@ -11,9 +11,10 @@ import (
 )
 
 type IdentifyConfig struct {
-	UserAgent string `toml:"user_agent"`
-	Os        string `toml:"os"`
-	Browser   string `toml:"browser"`
+	UserAgent      string `toml:"user_agent"`
+	Browser        string `toml:"browser"`
+	BrowserVersion string `toml:"browser_version"`
+	Os             string `toml:"os"`
 }
 
 type KeysConfig struct {
@@ -58,9 +59,10 @@ func New() *Config {
 		TimeFormat:             time.Stamp,
 		AttachmentDownloadsDir: UserDownloadsDir(),
 		Identify: IdentifyConfig{
-			UserAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36",
-			Os:        "Linux",
-			Browser:   "Chrome",
+			UserAgent:      "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36",
+			Browser:        "Chrome",
+			BrowserVersion: "104.0.5112.102",
+			Os:             "Linux",
 		},
 		Theme: ThemeConfig{
 			Background: "black",

+ 4 - 2
ui/app.go

@@ -35,8 +35,10 @@ func NewApp(token string, c *config.Config) *App {
 			Token:   token,
 			Intents: nil,
 			Properties: gateway.IdentifyProperties{
-				OS:      c.Identify.Os,
-				Browser: c.Identify.Browser,
+				Browser:          c.Identify.Browser,
+				BrowserUserAgent: c.Identify.UserAgent,
+				BrowserVersion:   c.Identify.BrowserVersion,
+				OS:               c.Identify.Os,
 			},
 			// The official client sets the compress field as false.
 			Compress: false,