mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 06:15:32 -05:00
added name and email to connected user data and example get request for chat
This commit is contained in:
parent
4a71b38721
commit
0aa6a206e7
2 changed files with 6 additions and 0 deletions
|
@ -52,6 +52,8 @@ module.exports =
|
|||
result.user_id = user_id
|
||||
if result.cursorData?
|
||||
result.cursorData = JSON.parse(result.cursorData)
|
||||
result.email = result.cursorData.email
|
||||
result.name = result.cursorData.name
|
||||
callback err, result
|
||||
|
||||
setUserCursorPosition: (project_id, user_id, cursorData, callback)->
|
||||
|
|
|
@ -3,6 +3,7 @@ define [
|
|||
], (App) ->
|
||||
App.controller "ChatController", ["$scope", "$http", "ide", "$location", ($scope, $http, @ide, $location) ->
|
||||
MESSAGES_URL = "/project/#{$scope.project_id}/messages"
|
||||
CONNECTED_USER_URL = "/project/#{$scope.project_id}/connected_users"
|
||||
|
||||
$scope.$on "project:joined", =>
|
||||
@ide.socket.on "new-chat-message", (message) =>
|
||||
|
@ -11,6 +12,9 @@ define [
|
|||
$http.get(MESSAGES_URL).success (data, status, headers, config)->
|
||||
$scope.chat.messages = data
|
||||
|
||||
$http.get(CONNECTED_USER_URL).success (data)->
|
||||
console.log data
|
||||
|
||||
$scope.$watchCollection "chat.messages", (messages) ->
|
||||
if messages?
|
||||
console.log "grouping messages"
|
||||
|
|
Loading…
Reference in a new issue