mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-31 07:27:13 +00:00
Revert "fix(sub): keep the client identity on every subscription link (#6098)"
This reverts commitc004c18d90. Showing {{EMAIL}}/{{USERNAME}} on the first subscription-body link only is intentional, not an oversight in876d55f2. Restoring the behaviour and the tests that pin it. Making the identity tokens configurable is the sanctioned route for the operators asking for them on every link (#5935), rather than flipping the default for everyone.
This commit is contained in:
@@ -481,6 +481,15 @@ var connectionTokens = map[string]bool{
|
||||
|
||||
var displayRemoveTokens = mergeTokenSets(usageInfoTokens, connectionTokens)
|
||||
|
||||
// firstLinkOnlyBodyTokens are stripped from every subscription-body link after a
|
||||
// client's first one: the usage/info tokens plus the per-client EMAIL/USERNAME
|
||||
// identity. A client app needs the email once, so repeating it on every link of
|
||||
// the same subscription is noise — show it on the first link only, like traffic.
|
||||
var firstLinkOnlyBodyTokens = mergeTokenSets(usageInfoTokens, map[string]bool{
|
||||
"EMAIL": true,
|
||||
"USERNAME": true,
|
||||
})
|
||||
|
||||
func mergeTokenSets(sets ...map[string]bool) map[string]bool {
|
||||
out := make(map[string]bool)
|
||||
for _, set := range sets {
|
||||
@@ -551,7 +560,7 @@ func (s *SubService) effectiveTemplate(email string) string {
|
||||
s.usageShown = map[string]bool{}
|
||||
}
|
||||
if s.usageShown[email] {
|
||||
return filterRemarkTemplate(translated, usageInfoTokens)
|
||||
return filterRemarkTemplate(translated, firstLinkOnlyBodyTokens)
|
||||
}
|
||||
s.usageShown[email] = true
|
||||
return translated
|
||||
|
||||
Reference in New Issue
Block a user