prefix websocket actions with chat_
This commit is contained in:
parent
8a075294c6
commit
5756fb0a05
3 changed files with 7 additions and 7 deletions
|
@ -88,11 +88,11 @@ do($ = window.jQuery, window) ->
|
|||
console.log 'debug', 'ws:onmessage', pipe
|
||||
|
||||
switch pipe.action
|
||||
when 'message'
|
||||
when 'chat_message'
|
||||
@receiveMessage pipe.data
|
||||
when 'typing_start'
|
||||
when 'chat_typing_start'
|
||||
@onAgentTypingStart()
|
||||
when 'typing_end'
|
||||
when 'chat_typing_end'
|
||||
@onAgentTypingEnd()
|
||||
when 'chat_init'
|
||||
switch pipe.data.state
|
||||
|
|
|
@ -198,11 +198,11 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
|
|||
pipe = JSON.parse(e.data);
|
||||
console.log('debug', 'ws:onmessage', pipe);
|
||||
switch (pipe.action) {
|
||||
case 'message':
|
||||
case 'chat_message':
|
||||
return this.receiveMessage(pipe.data);
|
||||
case 'typing_start':
|
||||
case 'chat_typing_start':
|
||||
return this.onAgentTypingStart();
|
||||
case 'typing_end':
|
||||
case 'chat_typing_end':
|
||||
return this.onAgentTypingEnd();
|
||||
case 'chat_init':
|
||||
switch (pipe.data.state) {
|
||||
|
|
2
public/assets/chat/chat.min.js
vendored
2
public/assets/chat/chat.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue