mirror of
https://github.com/shazow/ssh-chat.git
synced 2026-11-22 03:07:01 +03:00
Merge pull request #354 from lucash-diskkun/master2
chat: Sort /names output
This commit is contained in:
1 file changed
+2
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
"sort"
|
||||
|
||||
"github.com/shazow/ssh-chat/chat/message"
|
||||
"github.com/shazow/ssh-chat/internal/sanitize"
|
||||
@@ -189,6 +190,7 @@ func InitCommands(c *Commands) {
|
||||
}
|
||||
|
||||
names := room.Members.ListPrefix("")
|
||||
sort.Slice(names, func(i, j int) bool { return names[i].Key() < names[j].Key() })
|
||||
colNames := make([]string, len(names))
|
||||
for i, uname := range names {
|
||||
colNames[i] = colorize(uname.Value().(*Member).User)
|
||||
|
||||
Reference in new issue
Block a user