-
-
Notifications
You must be signed in to change notification settings - Fork 116
/
device.go
38 lines (35 loc) · 866 Bytes
/
device.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package manager
// DeviceConfig is config which send when Telegram connection session created.
type DeviceConfig struct {
// Device model
DeviceModel string
// Operation system version
SystemVersion string
// Application version
AppVersion string
// Code for the language used on the device's OS, ISO 639-1 standard
SystemLangCode string
// Language pack to use
LangPack string
// Code for the language used on the client, ISO 639-1 standard
LangCode string
}
// SetDefaults sets default values.
func (c *DeviceConfig) SetDefaults() {
const notAvailable = "n/a"
if c.DeviceModel == "" {
c.DeviceModel = notAvailable
}
if c.SystemVersion == "" {
c.SystemVersion = notAvailable
}
if c.AppVersion == "" {
c.AppVersion = notAvailable
}
if c.SystemLangCode == "" {
c.SystemLangCode = "en"
}
if c.LangCode == "" {
c.LangCode = "en"
}
}