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 удалений

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

@@ -32,7 +32,7 @@ type WebConn struct {
}
func NewWebConn(c *Context, ws *websocket.Conn) *WebConn {
go SetStatusOnline(c.Session.UserId, c.Session.Id)
go SetStatusOnline(c.Session.UserId, c.Session.Id, false)
return &WebConn{
Send: make(chan model.WebSocketMessage, 64),
@@ -55,7 +55,7 @@ func (c *WebConn) readPump() {
c.WebSocket.SetReadDeadline(time.Now().Add(PONG_WAIT))
c.WebSocket.SetPongHandler(func(string) error {
c.WebSocket.SetReadDeadline(time.Now().Add(PONG_WAIT))
go SetStatusAwayIfNeeded(c.UserId)
go SetStatusAwayIfNeeded(c.UserId, false)
return nil
})