Refactor Get/Create Direct Channel into one function (#9867)

* refactor GetDirectChannel and CreateDirectChannel in one function

* remove CreateDirectChannel plugin api and update GetDirectChannel and GetGroupChannel plugin api

* update tests
This commit is contained in:
Carlos Tadeu Panato Junior
2018-11-28 18:01:49 +01:00
committed by GitHub
parent 09eae76c00
commit 1bcf08aa4b
18 changed files with 241 additions and 402 deletions

View File

@@ -52,11 +52,6 @@ type API interface {
// CreateUser creates a user.
CreateUser(user *model.User) (*model.User, *model.AppError)
// CreateDirectChannel creates a Direct channel.
//
// Minimum server version: 5.6
CreateDirectChannel(userId1 string, userId2 string) (*model.Channel, *model.AppError)
// DeleteUser deletes a user.
DeleteUser(userId string) *model.AppError
@@ -196,9 +191,11 @@ type API interface {
GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError)
// GetDirectChannel gets a direct message channel.
// If the channel does not exist it will create it.
GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)
// GetGroupChannel gets a group message channel.
// If the channel does not exist it will create it.
GetGroupChannel(userIds []string) (*model.Channel, *model.AppError)
// UpdateChannel updates a channel.