mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 11:15:03 +03:00
fix(clients): store client group names trimmed
The groups page lists clients.group_name as stored, while every group action trims the name it is given. A name with surrounding white space, saved by a node snapshot or by a client edit, was listed as a separate group, and deleting, renaming or resetting that row acted on the real group of the trimmed name instead. Group names are trimmed wherever a client record is built or updated, and a one-time seeder folds stored names onto their trimmed form.
This commit is contained in:
@@ -1288,7 +1288,7 @@ func (c *Client) ToRecord() *ClientRecord {
|
||||
ExpiryTime: c.ExpiryTime,
|
||||
Enable: c.Enable,
|
||||
TgID: c.TgID,
|
||||
Group: c.Group,
|
||||
Group: strings.TrimSpace(c.Group),
|
||||
Comment: c.Comment,
|
||||
Reset: c.Reset,
|
||||
ResetDay: c.ResetDay,
|
||||
|
||||
Reference in New Issue
Block a user