diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-07-18 11:10:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-18 11:10:03 -0400 |
commit | c0ab2636d699c8544ce03a58f61b95cfd66ff7ce (patch) | |
tree | c7d07934e0ff1a75aafb097a184ae150888199c0 /model/websocket_client.go | |
parent | 180adc79af3d14de6ce62f6e687a6735db3fe82f (diff) | |
download | chat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.tar.gz chat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.tar.bz2 chat-c0ab2636d699c8544ce03a58f61b95cfd66ff7ce.zip |
PLT-2241 Refactored statuses into a more real-time system (#3573)
* Refactored statuses into a more real-time system
* Updated package.json with correct commit and fixed minor bug
* Minor updates to statuses based on feedback
* When setting status online, update only LastActivityAt if status already exists
Diffstat (limited to 'model/websocket_client.go')
-rw-r--r-- | model/websocket_client.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/model/websocket_client.go b/model/websocket_client.go index 7b9dc0b50..a048bd855 100644 --- a/model/websocket_client.go +++ b/model/websocket_client.go @@ -92,6 +92,8 @@ func (wsc *WebSocketClient) SendMessage(action string, data map[string]interface wsc.Conn.WriteJSON(req) } +// UserTyping will push a user_typing event out to all connected users +// who are in the specified channel func (wsc *WebSocketClient) UserTyping(channelId, parentId string) { data := map[string]interface{}{ "channel_id": channelId, @@ -100,3 +102,8 @@ func (wsc *WebSocketClient) UserTyping(channelId, parentId string) { wsc.SendMessage("user_typing", data) } + +// GetStatuses will return a map of string statuses using user id as the key +func (wsc *WebSocketClient) GetStatuses() { + wsc.SendMessage("get_statuses", nil) +} |