Merge branch 'release-4.0'
Этот коммит содержится в:
@@ -352,7 +352,7 @@ func (c *Client4) DoEmojiUploadFile(url string, data []byte, contentType string)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Client4) DoUploadImportTeam(url string, data []byte, contentType string) ([]byte, *Response) {
|
||||
func (c *Client4) DoUploadImportTeam(url string, data []byte, contentType string) (map[string]string, *Response) {
|
||||
rq, _ := http.NewRequest("POST", c.ApiUrl+url, bytes.NewReader(data))
|
||||
rq.Header.Set("Content-Type", contentType)
|
||||
rq.Close = true
|
||||
@@ -365,11 +365,9 @@ func (c *Client4) DoUploadImportTeam(url string, data []byte, contentType string
|
||||
return nil, &Response{Error: NewAppError(url, "model.client.connecting.app_error", nil, err.Error(), 0)}
|
||||
} else if rp.StatusCode >= 300 {
|
||||
return nil, &Response{StatusCode: rp.StatusCode, Error: AppErrorFromJson(rp.Body)}
|
||||
} else if data, err := ioutil.ReadAll(rp.Body); err != nil {
|
||||
return nil, &Response{StatusCode: rp.StatusCode, Error: NewAppError("UploadImportTeam", "model.client.read_file.app_error", nil, err.Error(), rp.StatusCode)}
|
||||
} else {
|
||||
defer closeBody(rp)
|
||||
return data, BuildResponse(rp)
|
||||
return MapFromJson(rp.Body), BuildResponse(rp)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1210,7 +1208,7 @@ func (c *Client4) GetTeamUnread(teamId, userId string) (*TeamUnread, *Response)
|
||||
}
|
||||
|
||||
// ImportTeam will import an exported team from other app into a existing team.
|
||||
func (c *Client4) ImportTeam(data []byte, filesize int, importFrom, filename, teamId string) ([]byte, *Response) {
|
||||
func (c *Client4) ImportTeam(data []byte, filesize int, importFrom, filename, teamId string) (map[string]string, *Response) {
|
||||
body := &bytes.Buffer{}
|
||||
writer := multipart.NewWriter(body)
|
||||
|
||||
@@ -1651,7 +1649,7 @@ func (c *Client4) GetFlaggedPostsForUserInTeam(userId string, teamId string, pag
|
||||
return nil, &Response{StatusCode: http.StatusBadRequest, Error: NewAppError("GetFlaggedPostsForUserInTeam", "model.client.get_flagged_posts_in_team.missing_parameter.app_error", nil, "", http.StatusBadRequest)}
|
||||
}
|
||||
|
||||
query := fmt.Sprintf("?in_team=%v&page=%v&per_page=%v", teamId, page, perPage)
|
||||
query := fmt.Sprintf("?team_id=%v&page=%v&per_page=%v", teamId, page, perPage)
|
||||
if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/posts/flagged"+query, ""); err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
@@ -1666,7 +1664,7 @@ func (c *Client4) GetFlaggedPostsForUserInChannel(userId string, channelId strin
|
||||
return nil, &Response{StatusCode: http.StatusBadRequest, Error: NewAppError("GetFlaggedPostsForUserInChannel", "model.client.get_flagged_posts_in_channel.missing_parameter.app_error", nil, "", http.StatusBadRequest)}
|
||||
}
|
||||
|
||||
query := fmt.Sprintf("?in_channel=%v&page=%v&per_page=%v", channelId, page, perPage)
|
||||
query := fmt.Sprintf("?channel_id=%v&page=%v&per_page=%v", channelId, page, perPage)
|
||||
if r, err := c.DoApiGet(c.GetUserRoute(userId)+"/posts/flagged"+query, ""); err != nil {
|
||||
return nil, BuildErrorResponse(r, err)
|
||||
} else {
|
||||
|
||||
@@ -1039,7 +1039,7 @@ func (o *Config) SetDefaults() {
|
||||
|
||||
if o.ServiceSettings.EnableEmojiPicker == nil {
|
||||
o.ServiceSettings.EnableEmojiPicker = new(bool)
|
||||
*o.ServiceSettings.EnableEmojiPicker = false
|
||||
*o.ServiceSettings.EnableEmojiPicker = true
|
||||
}
|
||||
|
||||
if o.ServiceSettings.RestrictCustomEmojiCreation == nil {
|
||||
|
||||
@@ -8,6 +8,7 @@ import "net/http"
|
||||
const (
|
||||
TOKEN_SIZE = 64
|
||||
MAX_TOKEN_EXIPRY_TIME = 1000 * 60 * 60 * 24 // 24 hour
|
||||
TOKEN_TYPE_OAUTH = "oauth"
|
||||
)
|
||||
|
||||
type Token struct {
|
||||
|
||||
Ссылка в новой задаче
Block a user