summaryrefslogtreecommitdiff
path: root/client/channel_list.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/channel_list.go')
-rw-r--r--client/channel_list.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/client/channel_list.go b/client/channel_list.go
index 25d093f..bc89dba 100644
--- a/client/channel_list.go
+++ b/client/channel_list.go
@@ -2,6 +2,7 @@ package main
import (
"citrons.xyz/talk/proto"
+ "citrons.xyz/talk/proto/validate"
"citrons.xyz/talk/tui"
"sort"
)
@@ -38,6 +39,24 @@ func (cl *channelList) setChannels(cs []proto.Object) {
sort.Sort(cl)
}
+func (cl *channelList) contains(location channelLocation) bool {
+ for i := 0; i < len(*cl); i++ {
+ if (*cl)[i].location == location {
+ return true
+ }
+ }
+ return false
+}
+
+func (cl *channelList) findName(name string) channelLocation {
+ for i := 0; i < len(*cl); i++ {
+ if validate.Fold((*cl)[i].name) == validate.Fold(name) {
+ return (*cl)[i].location
+ }
+ }
+ return channelLocation {}
+}
+
func (cl *channelList) remove(location channelLocation) {
for i := len(*cl) - 1; i >= 0; i-- {
if (*cl)[i].location != location {