Prepend @ symbol to names shown in user list, so they highlight
(cherry picked from commit abfeb0c1cf270e90496f42e3545eafd2dc518782)
This commit is contained in:
parent
d759a3d7ab
commit
de117eb5a9
|
@ -213,7 +213,18 @@ var commands = &CommandControl{
|
|||
HelpText: "Show a list of users in chat",
|
||||
Function: func(cl *Client, args []string) (string, error) {
|
||||
names := cl.belongsTo.GetNames()
|
||||
return strings.Join(names, " "), nil
|
||||
formatNames := func(names []string) []string {
|
||||
result := make([]string, len(names))
|
||||
for _, name := range names {
|
||||
if strings.HasPrefix(name, "@") {
|
||||
result = append(result, name)
|
||||
} else {
|
||||
result = append(result, "@"+name)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
return strings.Join(formatNames(names), " "), nil
|
||||
},
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue