GH-9612 Add plugin API for GetChannelStats method (#9627)
* Add GetChannelStats plugin api * Fix to return channel stats correctly * Add server version; Handle error idiomatically
Этот коммит содержится в:
коммит произвёл
Jesse Hallam
родитель
dd60ad0db7
Коммит
1074a1c7ab
@@ -261,6 +261,14 @@ func (api *PluginAPI) GetChannelsForTeamForUser(teamId, userId string, includeDe
|
||||
return api.app.GetChannelsForUser(teamId, userId, includeDeleted)
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetChannelStats(channelId string) (*model.ChannelStats, *model.AppError) {
|
||||
memberCount, err := api.app.GetChannelMemberCount(channelId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &model.ChannelStats{ChannelId: channelId, MemberCount: memberCount}, nil
|
||||
}
|
||||
|
||||
func (api *PluginAPI) GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError) {
|
||||
return api.app.GetDirectChannel(userId1, userId2)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user