diff options
author | Jesse Hallam <jesse.hallam@gmail.com> | 2018-07-20 12:03:08 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-07-20 09:03:08 -0700 |
commit | 908a682fcf3bbc48db75099f636d627616757b24 (patch) | |
tree | 255879c6545cd16fd6d16adadb55d07b089bcbe4 /app | |
parent | 610ac5a53c0f6536ca65ed2fe6e0646b468bd275 (diff) | |
download | chat-908a682fcf3bbc48db75099f636d627616757b24.tar.gz chat-908a682fcf3bbc48db75099f636d627616757b24.tar.bz2 chat-908a682fcf3bbc48db75099f636d627616757b24.zip |
make GetChannelByName take teamId first (#9134)
* make GetChannelByName take teamId first
I think it is more natural to accept `teamId`, then `channelName`,
given the pattern followed by other Plugin API methods and even the SQL
Store itself. The App layer seems unusual in accepting `channelName`
first.
This also re-generates the mocks fixing the parameter order for the
recently added `UserStatus` APIs.
* add GetChannelByNameForTeamName
Diffstat (limited to 'app')
-rw-r--r-- | app/plugin_api.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/plugin_api.go b/app/plugin_api.go index d7b116c0f..5e603a44e 100644 --- a/app/plugin_api.go +++ b/app/plugin_api.go @@ -190,10 +190,14 @@ func (api *PluginAPI) GetChannel(channelId string) (*model.Channel, *model.AppEr return api.app.GetChannel(channelId) } -func (api *PluginAPI) GetChannelByName(name, teamId string) (*model.Channel, *model.AppError) { +func (api *PluginAPI) GetChannelByName(teamId, name string) (*model.Channel, *model.AppError) { return api.app.GetChannelByName(name, teamId) } +func (api *PluginAPI) GetChannelByNameForTeamName(teamName, channelName string) (*model.Channel, *model.AppError) { + return api.app.GetChannelByNameForTeamName(channelName, teamName) +} + func (api *PluginAPI) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError) { return api.app.GetDirectChannel(userId1, userId2) } |