From c0ab2636d699c8544ce03a58f61b95cfd66ff7ce Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 18 Jul 2016 11:10:03 -0400 Subject: 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 --- model/websocket_client.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'model/websocket_client.go') 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) +} -- cgit v1.2.3-1-g7c22