mirror of
https://github.com/shazow/ssh-chat.git
synced 2026-11-26 03:27:00 +03:00
AutoCompleteFunction is back.
This commit is contained in:
1 parent
d3b0a56d78
commit
3bb4bbf991
2 files changed
+31
-15
No files matched your search
@@ -83,3 +83,14 @@ func (ch *Channel) Topic() string {
|
||||
func (ch *Channel) SetTopic(s string) {
|
||||
ch.topic = s
|
||||
}
|
||||
|
||||
// NamesPrefix lists all members' names with a given prefix, used to query
|
||||
// for autocompletion purposes.
|
||||
func (ch *Channel) NamesPrefix(prefix string) []string {
|
||||
users := ch.users.ListPrefix(prefix)
|
||||
names := make([]string, len(users))
|
||||
for i, u := range users {
|
||||
names[i] = u.(*User).Name()
|
||||
}
|
||||
return names
|
||||
}
|
||||
Reference in new issue
Block a user