Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
393 changed files
with
5,830 additions
and
5,720 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Connection < ActionCable::Connection::Base | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
class EventsChannel < ApplicationCable::Channel | ||
def subscribed | ||
@app = App.find_by(key: params[:app]) | ||
@app = App.find_by(key: params[:app]) | ||
stream_from "events:#{@app.key}" | ||
#@app_user = @app.agents.find_by(email: @user_data[:email]) | ||
# @app_user = @app.agents.find_by(email: @user_data[:email]) | ||
end | ||
|
||
def unsubscribed | ||
# Any cleanup needed when channel is unsubscribed | ||
end | ||
|
||
def receive_conversation_part(data) | ||
@app = App.find_by(key: params[:app]) | ||
@conversation = @app.conversations.find(data["conversation_id"]) | ||
message = @conversation.messages.find(data["message_id"]) | ||
if message.authorable_type == "AppUser" # read anyway #!= @app_user | ||
message.read! | ||
end | ||
@app = App.find_by(key: params[:app]) | ||
@conversation = @app.conversations.find(data['conversation_id']) | ||
message = @conversation.messages.find(data['message_id']) | ||
message.read! if message.authorable_type == 'AppUser' # read anyway #!= @app_user | ||
end | ||
|
||
end |
Oops, something went wrong.