mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Convert messages to whisper when in private channel
This commit is contained in:
parent
9bb171b4d9
commit
6c5911d42b
@ -36,6 +36,7 @@ exposed by a function if necessary.
|
|||||||
errorVisible = false
|
errorVisible = false
|
||||||
|
|
||||||
lastMessage = null
|
lastMessage = null
|
||||||
|
openChannel = 0
|
||||||
|
|
||||||
remainingFailures = 3
|
remainingFailures = 3
|
||||||
|
|
||||||
@ -121,6 +122,9 @@ and afterwards sent to the server by an AJAX request.
|
|||||||
|
|
||||||
return false if text.length is 0
|
return false if text.length is 0
|
||||||
|
|
||||||
|
unless openChannel is 0
|
||||||
|
text = "/whisper #{$("#timsChatMessageContainer#{openChannel}").data 'username'}, #{text}"
|
||||||
|
|
||||||
# Free the fish!
|
# Free the fish!
|
||||||
freeTheFish() if text.toLowerCase() is '/free the fish'
|
freeTheFish() if text.toLowerCase() is '/free the fish'
|
||||||
|
|
||||||
@ -671,18 +675,21 @@ Joins a room.
|
|||||||
Open private channel
|
Open private channel
|
||||||
|
|
||||||
openPrivateChannel = (userID) ->
|
openPrivateChannel = (userID) ->
|
||||||
$('.timsChatMessageContainer').removeClass 'active'
|
|
||||||
|
|
||||||
if !$.wcfIsset "timsChatMessageContainer#{userID}"
|
if !$.wcfIsset "timsChatMessageContainer#{userID}"
|
||||||
|
return unless $.wcfIsset "timsChatUser#{userID}"
|
||||||
|
|
||||||
div = $('<div>')
|
div = $('<div>')
|
||||||
div.attr 'id', "timsChatMessageContainer#{userID}"
|
div.attr 'id', "timsChatMessageContainer#{userID}"
|
||||||
div.addClass 'timsChatMessageContainer'
|
div.addClass 'timsChatMessageContainer'
|
||||||
div.addClass 'marginTop'
|
div.addClass 'marginTop'
|
||||||
div.addClass 'container'
|
div.addClass 'container'
|
||||||
|
div.data 'username', $("#timsChatUser#{userID}").data 'username'
|
||||||
div.wrapInner '<ul>'
|
div.wrapInner '<ul>'
|
||||||
$('#timsChatMessageContainer0').after div
|
$('#timsChatMessageContainer0').after div
|
||||||
|
|
||||||
$("#timsChatMessageContainer#{userID}").addClass('active')
|
$('.timsChatMessageContainer').removeClass 'active'
|
||||||
|
$("#timsChatMessageContainer#{userID}").addClass 'active'
|
||||||
|
openChannel = userID
|
||||||
|
|
||||||
Close private channel
|
Close private channel
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user