PLT-1527 Add a slash command to set yourself away (#3752)

* added handlers for slash commands

* added manual status persistance

* added tests

* removed extra debug output and comments

* rebase - fixing the PR

* making echo messages after slash commands ephemeral
Этот коммит содержится в:
Dmitri Aizenberg
2016-08-31 06:24:14 -07:00
коммит произвёл Joram Wilander
родитель db660bdf9c
Коммит dc09b7781a
15 изменённых файлов: 260 добавлений и 26 удалений

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

@@ -18,6 +18,7 @@ const (
type Status struct {
UserId string `json:"user_id"`
Status string `json:"status"`
Manual bool `json:"manual"`
LastActivityAt int64 `json:"last_activity_at"`
}

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

@@ -9,7 +9,7 @@ import (
)
func TestStatus(t *testing.T) {
status := Status{NewId(), STATUS_ONLINE, 0}
status := Status{NewId(), STATUS_ONLINE, true, 0}
json := status.ToJson()
status2 := StatusFromJson(strings.NewReader(json))
@@ -24,4 +24,8 @@ func TestStatus(t *testing.T) {
if status.LastActivityAt != status2.LastActivityAt {
t.Fatal("LastActivityAt should have matched")
}
if status.Manual != status2.Manual {
t.Fatal("Manual should have matched")
}
}