mirror of
https://github.com/beatriceo/polyglot.git
synced 2025-10-25 18:52:11 +00:00
Revert "Revert "Chat css""
This commit is contained in:
@@ -50,7 +50,9 @@ class PagesController < ApplicationController
|
||||
chat_message: {
|
||||
message: 'test',
|
||||
user_info: user_info,
|
||||
time_stamp: Time.now }
|
||||
time_stamp: Time.now,
|
||||
photo_url: photo_url
|
||||
}
|
||||
})
|
||||
head :ok
|
||||
end
|
||||
@@ -80,7 +82,8 @@ class PagesController < ApplicationController
|
||||
|
||||
ActionCable.server.broadcast "chat_room_#{params[:chat_room_id]}", {
|
||||
translated_message: translated_message,
|
||||
userId: userId
|
||||
userId: userId,
|
||||
photo_url: params[:photo_url]
|
||||
}
|
||||
end
|
||||
|
||||
@@ -90,6 +93,7 @@ class PagesController < ApplicationController
|
||||
chatroom = 'chat_room_' + params[:chat_room_id]
|
||||
puts params
|
||||
user_info = {}
|
||||
photo_url = current_user.photo.url || "https://upload.wikimedia.org/wikipedia/commons/8/89/Portrait_Placeholder.png"
|
||||
|
||||
if current_user.first_name.nil? || current_user.last_name.nil?
|
||||
user_info[:name] = current_user.email
|
||||
@@ -102,7 +106,8 @@ class PagesController < ApplicationController
|
||||
message: params[:message],
|
||||
user_info: user_info,
|
||||
time_stamp: Time.now.strftime("%H:%M"),
|
||||
userId: current_user.id
|
||||
userId: current_user.id,
|
||||
photo_url: photo_url
|
||||
}
|
||||
})
|
||||
head :ok
|
||||
|
||||
Reference in New Issue
Block a user