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
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2018-11-28 18:01:49 +01:00
коммит произвёл GitHub
родитель 09eae76c00
Коммит 1bcf08aa4b
18 изменённых файлов: 241 добавлений и 402 удалений

Просмотреть файл

@@ -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.