configured for redistogo and uncommented realtime messages
This commit is contained in:
parent
4b64e4bc06
commit
285c87ade7
6 changed files with 25 additions and 20 deletions
|
@ -1,6 +1,6 @@
|
|||
window.app.realtime =
|
||||
connect : () ->
|
||||
#window.app.socket = io.connect('http://localhost:5001');
|
||||
#window.app.socket.on 'connect', () ->
|
||||
#subscribeToRooms()
|
||||
#console.log('socket connected')
|
||||
window.app.socket = io.connect('http://gentle-savannah-1303.herokuapp.com:5001');
|
||||
window.app.socket.on 'connect', () ->
|
||||
subscribeToRooms()
|
||||
console.log('socket connected')
|
|
@ -44,7 +44,7 @@ class MappingsController < ApplicationController
|
|||
@mapping.save()
|
||||
|
||||
#push add to map to realtime viewers of the map
|
||||
#@mapping.message 'create',@user.id
|
||||
@mapping.message 'create',@user.id
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ class MapsController < ApplicationController
|
|||
@mapping.save
|
||||
|
||||
#push realtime update for location on map
|
||||
#@mapping.message 'update',@user.id
|
||||
@mapping.message 'update',@user.id
|
||||
end
|
||||
end
|
||||
@map.arranged = true
|
||||
|
|
|
@ -101,7 +101,7 @@ class SynapsesController < ApplicationController
|
|||
@mapping.save
|
||||
|
||||
#push add to map to realtime viewers of the map
|
||||
#@mapping.message 'create',@user.id
|
||||
@mapping.message 'create',@user.id
|
||||
|
||||
# set the permission of the synapse to whatever the permission of the
|
||||
#map is
|
||||
|
@ -156,11 +156,11 @@ class SynapsesController < ApplicationController
|
|||
#push notify to anyone viewing this synapse on a map in realtime (see mapping.rb to understand the 'message' action)
|
||||
# if the topic was private and is being switched to PU or CO it is the same as being created for other viewers
|
||||
if @permissionBefore == "private" and @permissionAfter != "private"
|
||||
#@synapse.message 'create',@current.id
|
||||
@synapse.message 'create',@current.id
|
||||
elsif @permissionBefore != "private" and @permissionAfter == "private"
|
||||
#@synapse.message 'destroy',@current.id
|
||||
@synapse.message 'destroy',@current.id
|
||||
else
|
||||
#@synapse.message 'update',@current.id
|
||||
@synapse.message 'update',@current.id
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -177,7 +177,7 @@ class SynapsesController < ApplicationController
|
|||
@mapping = Mapping.find_by_synapse_id_and_map_id(params[:synapse_id],params[:map_id])
|
||||
|
||||
#push notify to anyone viewing same map in realtime (see mapping.rb to understand the 'message' action)
|
||||
#@mapping.message 'destroy',@user.id
|
||||
@mapping.message 'destroy',@user.id
|
||||
|
||||
@mapping.delete
|
||||
|
||||
|
@ -193,7 +193,7 @@ class SynapsesController < ApplicationController
|
|||
|
||||
@synapse.mappings.each do |m|
|
||||
#push notify to anyone viewing same map in realtime (see mapping.rb to understand the 'message' action)
|
||||
#m.message 'destroy',@current.id
|
||||
m.message 'destroy',@current.id
|
||||
|
||||
m.delete
|
||||
end
|
||||
|
|
|
@ -127,7 +127,7 @@ class TopicsController < ApplicationController
|
|||
@mapping.save
|
||||
|
||||
#push add to map to realtime viewers of the map
|
||||
#@mapping.message 'create',@user.id
|
||||
@mapping.message 'create',@user.id
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
|
@ -170,11 +170,11 @@ class TopicsController < ApplicationController
|
|||
#push notify to anyone viewing this topic on a map in realtime (see mapping.rb to understand the 'message' action)
|
||||
# if the topic was private and is being switched to PU or CO it is the same as being created for other viewers
|
||||
if @permissionBefore == "private" and @permissionAfter != "private"
|
||||
#@topic.message 'create',@current.id
|
||||
@topic.message 'create',@current.id
|
||||
elsif @permissionBefore != "private" and @permissionAfter == "private"
|
||||
#@topic.message 'destroy',@current.id
|
||||
@topic.message 'destroy',@current.id
|
||||
else
|
||||
#@topic.message 'update',@current.id
|
||||
@topic.message 'update',@current.id
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -198,7 +198,7 @@ class TopicsController < ApplicationController
|
|||
@mappings.each do |m|
|
||||
|
||||
#push notify to anyone viewing same map in realtime (see mapping.rb to understand the 'message' action)
|
||||
#m.message 'destroy',@current.id
|
||||
m.message 'destroy',@current.id
|
||||
|
||||
m.delete
|
||||
end
|
||||
|
@ -226,7 +226,7 @@ class TopicsController < ApplicationController
|
|||
@synapses.each do |synapse|
|
||||
synapse.mappings.each do |m|
|
||||
#push notify to anyone viewing same map in realtime (see mapping.rb to understand the 'message' action)
|
||||
#m.message 'destroy',@current.id
|
||||
m.message 'destroy',@current.id
|
||||
|
||||
m.delete
|
||||
end
|
||||
|
@ -236,7 +236,7 @@ class TopicsController < ApplicationController
|
|||
|
||||
@mappings.each do |mapping|
|
||||
#push notify to anyone viewing a map with this topic in realtime (see mapping.rb to understand the 'message' action)
|
||||
#mapping.message 'destroy',@current.id
|
||||
mapping.message 'destroy',@current.id
|
||||
|
||||
mapping.delete
|
||||
end
|
||||
|
|
|
@ -1 +1,6 @@
|
|||
$redis = Redis.new(:host => 'localhost', :port=> 6379)
|
||||
if Rails.env.development?
|
||||
$redis = Redis.new(:host => 'localhost', :port=> 6379)
|
||||
elsif Rails.env.production?
|
||||
uri = URI.parse(ENV["REDISTOGO_URL"])
|
||||
$redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
|
||||
end
|
Loading…
Reference in a new issue