summaryrefslogtreecommitdiffstats
path: root/model/channel_list.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2017-05-10 11:41:56 -0400
committerCorey Hulen <corey@hulen.com>2017-05-10 08:41:56 -0700
commit4f589e077c82da00dd505319ddcf3565c699d4e6 (patch)
treeeb1e5da4762d66e4a8e6e614ce6ffafa36c9424d /model/channel_list.go
parenta67898186175d9986b9e8cd8321afbc6fa84c8c6 (diff)
downloadchat-4f589e077c82da00dd505319ddcf3565c699d4e6.tar.gz
chat-4f589e077c82da00dd505319ddcf3565c699d4e6.tar.bz2
chat-4f589e077c82da00dd505319ddcf3565c699d4e6.zip
Removing channel list alias from apiv4 client (#6383)
Diffstat (limited to 'model/channel_list.go')
-rw-r--r--model/channel_list.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/model/channel_list.go b/model/channel_list.go
index 18c726908..d5a4ccb7c 100644
--- a/model/channel_list.go
+++ b/model/channel_list.go
@@ -50,3 +50,14 @@ func ChannelListFromJson(data io.Reader) *ChannelList {
return nil
}
}
+
+func ChannelSliceFromJson(data io.Reader) []*Channel {
+ decoder := json.NewDecoder(data)
+ var o []*Channel
+ err := decoder.Decode(&o)
+ if err == nil {
+ return o
+ } else {
+ return nil
+ }
+}