4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-05 18:24:03 +00:00

Bump github.com/mattermost/mattermost-server/v6 from 6.1.0 to 6.3.0 (#1686)

Bumps [github.com/mattermost/mattermost-server/v6](https://github.com/mattermost/mattermost-server) from 6.1.0 to 6.3.0.
- [Release notes](https://github.com/mattermost/mattermost-server/releases)
- [Changelog](https://github.com/mattermost/mattermost-server/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mattermost/mattermost-server/compare/v6.1.0...v6.3.0)

---
updated-dependencies:
- dependency-name: github.com/mattermost/mattermost-server/v6
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot]
2022-01-18 20:24:14 +01:00
committed by GitHub
parent fecca57507
commit aad60c882e
250 changed files with 43143 additions and 11479 deletions

View File

@ -3100,6 +3100,24 @@ func (c *Client4) GetChannelsForTeamAndUserWithLastDeleteAt(teamId, userId strin
return ch, BuildResponse(r), nil
}
// GetChannelsForUserWithLastDeleteAt returns a list channels for a user, additionally filtered with lastDeleteAt.
func (c *Client4) GetChannelsForUserWithLastDeleteAt(userID string, lastDeleteAt int) ([]*Channel, *Response, error) {
route := fmt.Sprintf(c.userRoute(userID) + "/channels")
route += fmt.Sprintf("?last_delete_at=%d", lastDeleteAt)
r, err := c.DoAPIGet(route, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var ch []*Channel
err = json.NewDecoder(r.Body).Decode(&ch)
if err != nil {
return nil, BuildResponse(r), NewAppError("GetChannelsForUserWithLastDeleteAt", "api.marshal_error", nil, err.Error(), http.StatusInternalServerError)
}
return ch, BuildResponse(r), nil
}
// SearchChannels returns the channels on a team matching the provided search term.
func (c *Client4) SearchChannels(teamId string, search *ChannelSearch) ([]*Channel, *Response, error) {
searchJSON, jsonErr := json.Marshal(search)
@ -3160,6 +3178,29 @@ func (c *Client4) SearchAllChannels(search *ChannelSearch) (ChannelListWithTeamD
return ch, BuildResponse(r), nil
}
// SearchAllChannelsForUser search in all the channels for a regular user.
func (c *Client4) SearchAllChannelsForUser(term string) (ChannelListWithTeamData, *Response, error) {
search := &ChannelSearch{
Term: term,
}
searchJSON, jsonErr := json.Marshal(search)
if jsonErr != nil {
return nil, nil, NewAppError("SearchAllChannelsForUser", "api.marshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
r, err := c.DoAPIPost(c.channelsRoute()+"/search?system_console=false", string(searchJSON))
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var ch ChannelListWithTeamData
err = json.NewDecoder(r.Body).Decode(&ch)
if err != nil {
return nil, BuildResponse(r), NewAppError("SearchAllChannelsForUser", "api.marshal_error", nil, err.Error(), http.StatusInternalServerError)
}
return ch, BuildResponse(r), nil
}
// SearchAllChannelsPaged searches all the channels and returns the results paged with the total count.
func (c *Client4) SearchAllChannelsPaged(search *ChannelSearch) (*ChannelsWithCount, *Response, error) {
searchJSON, jsonErr := json.Marshal(search)
@ -3304,7 +3345,7 @@ func (c *Client4) GetChannelByNameForTeamNameIncludeDeleted(channelName, teamNam
return ch, BuildResponse(r), nil
}
// GetChannelMembers gets a page of channel members.
// GetChannelMembers gets a page of channel members specific to a channel.
func (c *Client4) GetChannelMembers(channelId string, page, perPage int, etag string) (ChannelMembers, *Response, error) {
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)
r, err := c.DoAPIGet(c.channelMembersRoute(channelId)+query, etag)
@ -3321,6 +3362,23 @@ func (c *Client4) GetChannelMembers(channelId string, page, perPage int, etag st
return ch, BuildResponse(r), nil
}
// GetChannelMembersWithTeamData gets a page of all channel members for a user.
func (c *Client4) GetChannelMembersWithTeamData(userID string, page, perPage int) (ChannelMembersWithTeamData, *Response, error) {
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)
r, err := c.DoAPIGet(c.userRoute(userID)+"/channel_members"+query, "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var ch ChannelMembersWithTeamData
err = json.NewDecoder(r.Body).Decode(&ch)
if err != nil {
return nil, BuildResponse(r), NewAppError("GetChannelMembersWithTeamData", "api.marshal_error", nil, err.Error(), http.StatusInternalServerError)
}
return ch, BuildResponse(r), nil
}
// GetChannelMembersByIds gets the channel members in a channel for a list of user ids.
func (c *Client4) GetChannelMembersByIds(channelId string, userIds []string) (ChannelMembers, *Response, error) {
r, err := c.DoAPIPost(c.channelMembersRoute(channelId)+"/ids", ArrayToJSON(userIds))
@ -3710,6 +3768,27 @@ func (c *Client4) GetPostsForChannel(channelId string, page, perPage int, etag s
return &list, BuildResponse(r), nil
}
// GetPostsByIds gets a list of posts by taking an array of post ids
func (c *Client4) GetPostsByIds(postIds []string) ([]*Post, *Response, error) {
js, jsonErr := json.Marshal(postIds)
if jsonErr != nil {
return nil, nil, NewAppError("SearchFilesWithParams", "api.marshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
r, err := c.DoAPIPost(c.postsRoute()+"/ids", string(js))
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var list []*Post
if r.StatusCode == http.StatusNotModified {
return list, BuildResponse(r), nil
}
if jsonErr := json.NewDecoder(r.Body).Decode(&list); jsonErr != nil {
return nil, nil, NewAppError("GetPostsByIds", "api.unmarshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
return list, BuildResponse(r), nil
}
// GetFlaggedPostsForUser returns flagged posts of a user based on user id string.
func (c *Client4) GetFlaggedPostsForUser(userId string, page int, perPage int) (*PostList, *Response, error) {
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)
@ -6096,6 +6175,44 @@ func (c *Client4) UpdateUserStatus(userId string, userStatus *Status) (*Status,
return &s, BuildResponse(r), nil
}
// UpdateUserCustomStatus sets a user's custom status based on the provided user id string.
func (c *Client4) UpdateUserCustomStatus(userId string, userCustomStatus *CustomStatus) (*CustomStatus, *Response, error) {
buf, err := json.Marshal(userCustomStatus)
if err != nil {
return nil, nil, NewAppError("UpdateUserCustomStatus", "api.marshal_error", nil, err.Error(), http.StatusInternalServerError)
}
r, err := c.DoAPIPutBytes(c.userStatusRoute(userId)+"/custom", buf)
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var s CustomStatus
if jsonErr := json.NewDecoder(r.Body).Decode(&s); jsonErr != nil {
return nil, nil, NewAppError("UpdateUserCustomStatus", "api.unmarshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
return &s, BuildResponse(r), nil
}
// RemoveUserCustomStatus remove a user's custom status based on the provided user id string.
func (c *Client4) RemoveUserCustomStatus(userId string) (*Response, error) {
r, err := c.DoAPIDelete(c.userStatusRoute(userId) + "/custom")
if err != nil {
return BuildResponse(r), err
}
defer closeBody(r)
return BuildResponse(r), nil
}
// RemoveRecentUserCustomStatus remove a recent user's custom status based on the provided user id string.
func (c *Client4) RemoveRecentUserCustomStatus(userId string) (*Response, error) {
r, err := c.DoAPIDelete(c.userStatusRoute(userId) + "/custom/recent")
if err != nil {
return BuildResponse(r), err
}
defer closeBody(r)
return BuildResponse(r), nil
}
// Emoji Section
// CreateEmoji will save an emoji to the server if the current user has permission
@ -6425,6 +6542,20 @@ func (c *Client4) DownloadJob(jobId string) ([]byte, *Response, error) {
// Roles Section
// GetAllRoles returns a list of all the roles.
func (c *Client4) GetAllRoles() ([]*Role, *Response, error) {
r, err := c.DoAPIGet(c.rolesRoute(), "")
if err != nil {
return nil, BuildResponse(r), err
}
defer closeBody(r)
var list []*Role
if jsonErr := json.NewDecoder(r.Body).Decode(&list); jsonErr != nil {
return nil, nil, NewAppError("GetAllRoles", "api.unmarshal_error", nil, jsonErr.Error(), http.StatusInternalServerError)
}
return list, BuildResponse(r), nil
}
// GetRole gets a single role by ID.
func (c *Client4) GetRole(id string) (*Role, *Response, error) {
r, err := c.DoAPIGet(c.rolesRoute()+fmt.Sprintf("/%v", id), "")