[fix] logic

This commit is contained in:
adlyq
2022-04-21 18:56:33 +08:00
parent 4b79f8de93
commit e98dcc4267
2 changed files with 8 additions and 9 deletions

View File

@ -85,7 +85,6 @@ type Metadata struct {
DNSMode DNSMode `json:"dnsMode"`
Process string `json:"process"`
ProcessPath string `json:"processPath"`
UserAgent string `json:"userAgent"`
}
func (m *Metadata) RemoteAddress() string {
@ -101,13 +100,13 @@ func (m *Metadata) SourceAddress() string {
}
func (m *Metadata) SourceDetail() string {
if m.Type == INNER {
return fmt.Sprintf("[%s]", ClashName)
}
if m.Process != "" {
return fmt.Sprintf("%s(%s)", m.SourceAddress(), m.Process)
} else {
if m.Type == INNER {
return fmt.Sprintf("[Clash]")
}
return fmt.Sprintf("%s", m.SourceAddress())
}
}