summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2016-02-04 08:03:42 -0800
committer=Corey Hulen <corey@hulen.com>2016-02-04 08:03:42 -0800
commitdffc5323ecd9c7bc1af0ea06ef4827078f9bcd52 (patch)
treeba89623c1d1061135127431556466512662a0328
parent950e25df5af624a0b06d48f28e9979a0c47a081c (diff)
downloadchat-dffc5323ecd9c7bc1af0ea06ef4827078f9bcd52.tar.gz
chat-dffc5323ecd9c7bc1af0ea06ef4827078f9bcd52.tar.bz2
chat-dffc5323ecd9c7bc1af0ea06ef4827078f9bcd52.zip
PLT-1429 Fixing code review comments
-rw-r--r--api/command.go4
-rw-r--r--api/command_loadtest.go2
-rw-r--r--api/command_loadtest_test.go6
-rw-r--r--model/version.go1
-rw-r--r--web/react/utils/async_client.jsx1
5 files changed, 6 insertions, 8 deletions
diff --git a/api/command.go b/api/command.go
index 390cc3770..a8573cdcc 100644
--- a/api/command.go
+++ b/api/command.go
@@ -318,7 +318,7 @@ func regenCommandToken(c *Context, w http.ResponseWriter, r *http.Request) {
} else {
cmd = result.Data.(*model.Command)
- if c.Session.TeamId != cmd.TeamId && c.Session.UserId != cmd.CreatorId && !c.IsTeamAdmin() {
+ if c.Session.TeamId != cmd.TeamId || (c.Session.UserId != cmd.CreatorId && !c.IsTeamAdmin()) {
c.LogAudit("fail - inappropriate permissions")
c.Err = model.NewLocAppError("regenToken", "api.command.regen.app_error", nil, "user_id="+c.Session.UserId)
return
@@ -364,7 +364,7 @@ func deleteCommand(c *Context, w http.ResponseWriter, r *http.Request) {
c.Err = result.Err
return
} else {
- if c.Session.TeamId != result.Data.(*model.Command).TeamId && c.Session.UserId != result.Data.(*model.Command).CreatorId && !c.IsTeamAdmin() {
+ if c.Session.TeamId != result.Data.(*model.Command).TeamId || (c.Session.UserId != result.Data.(*model.Command).CreatorId && !c.IsTeamAdmin()) {
c.LogAudit("fail - inappropriate permissions")
c.Err = model.NewLocAppError("deleteCommand", "api.command.delete.app_error", nil, "user_id="+c.Session.UserId)
return
diff --git a/api/command_loadtest.go b/api/command_loadtest.go
index e320176f4..c7c4f98f5 100644
--- a/api/command_loadtest.go
+++ b/api/command_loadtest.go
@@ -327,7 +327,7 @@ func (me *LoadTestProvider) UrlCommand(c *Context, channelId string, message str
}
}
- return &model.CommandResponse{Text: "Loading url...", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
+ return &model.CommandResponse{Text: "Loading data...", ResponseType: model.COMMAND_RESPONSE_TYPE_EPHEMERAL}
}
func parseRange(command string, cmd string) (utils.Range, bool) {
diff --git a/api/command_loadtest_test.go b/api/command_loadtest_test.go
index 2ae426dc0..7cb77cf18 100644
--- a/api/command_loadtest_test.go
+++ b/api/command_loadtest_test.go
@@ -197,17 +197,17 @@ func TestLoadTestUrlCommands(t *testing.T) {
}
command = "/loadtest url https://raw.githubusercontent.com/mattermost/platform/master/README.md"
- if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loading url..." {
+ if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loading data..." {
t.Fatal("/loadtest url for README.md should've executed")
}
command = "/loadtest url test-emoticons.md"
- if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loading url..." {
+ if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loading data..." {
t.Fatal("/loadtest url for test-emoticons.md should've executed")
}
command = "/loadtest url test-emoticons"
- if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loading url..." {
+ if r := Client.Must(Client.Command(channel.Id, command, false)).Data.(*model.CommandResponse); r.Text != "Loading data..." {
t.Fatal("/loadtest url for test-emoticons should've executed")
}
diff --git a/model/version.go b/model/version.go
index c1e4615da..69529e7a1 100644
--- a/model/version.go
+++ b/model/version.go
@@ -26,7 +26,6 @@ var versions = []string{
}
var CurrentVersion string = versions[0]
-
var BuildNumber = "_BUILD_NUMBER_"
var BuildDate = "_BUILD_DATE_"
var BuildHash = "_BUILD_HASH_"
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 970b1a4c0..328a7a7f2 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -787,7 +787,6 @@ export function getSuggestedCommands(command, suggestionId, component) {
});
// pull out the suggested commands from the returned data
- //const terms = matches.map((suggestion) => suggestion.trigger);
const terms = matches.map((suggestion) => suggestion.suggestion);
AppDispatcher.handleServerAction({