mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Rename variable and fix closing of private channels
This commit is contained in:
parent
fa03296908
commit
9bb171b4d9
@ -418,11 +418,11 @@ Insert the given messages into the chat stream.
|
|||||||
for message in messages
|
for message in messages
|
||||||
events.newMessage.fire message
|
events.newMessage.fire message
|
||||||
|
|
||||||
message.private = (message.type is parseInt v.config.messageTypes.WHISPER) and ($.wcfIsset("timsChatMessageContainer#{message.receiver}") || $.wcfIsset("timsChatMessageContainer#{message.sender}"))
|
message.isInPrivateChannel = (String(message.type) is v.config.messageTypes.WHISPER) and ($.wcfIsset("timsChatMessageContainer#{message.receiver}") or $.wcfIsset("timsChatMessageContainer#{message.sender}"))
|
||||||
|
|
||||||
createNewMessage = yes
|
createNewMessage = yes
|
||||||
if $('.timsChatMessage:last-child .text').is('ul') and lastMessage isnt null and lastMessage.type in [ 0, 7 ]
|
if $('.timsChatMessage:last-child .text').is('ul') and lastMessage isnt null and lastMessage.type in [ 0, 7 ]
|
||||||
if lastMessage.type is message.type and lastMessage.sender is message.sender and lastMessage.receiver is message.receiver and lastMessage.private is message.private
|
if lastMessage.type is message.type and lastMessage.sender is message.sender and lastMessage.receiver is message.receiver and lastMessage.isInPrivateChannel is message.isInPrivateChannel
|
||||||
createNewMessage = no
|
createNewMessage = no
|
||||||
|
|
||||||
if createNewMessage
|
if createNewMessage
|
||||||
@ -438,9 +438,9 @@ Insert the given messages into the chat stream.
|
|||||||
li.addClass 'ownMessage' if message.sender is WCF.User.userID
|
li.addClass 'ownMessage' if message.sender is WCF.User.userID
|
||||||
li.append output
|
li.append output
|
||||||
|
|
||||||
if message.private and message.sender is WCF.User.userID
|
if message.isInPrivateChannel and message.sender is WCF.User.userID
|
||||||
li.appendTo $ "#timsChatMessageContainer#{message.receiver} > ul"
|
li.appendTo $ "#timsChatMessageContainer#{message.receiver} > ul"
|
||||||
else if message.private
|
else if message.isInPrivateChannel
|
||||||
li.appendTo $ "#timsChatMessageContainer#{message.sender} > ul"
|
li.appendTo $ "#timsChatMessageContainer#{message.sender} > ul"
|
||||||
else
|
else
|
||||||
li.appendTo $ '#timsChatMessageContainer0 > ul'
|
li.appendTo $ '#timsChatMessageContainer0 > ul'
|
||||||
@ -450,9 +450,9 @@ Insert the given messages into the chat stream.
|
|||||||
message: message
|
message: message
|
||||||
messageTypes: v.config.messageTypes
|
messageTypes: v.config.messageTypes
|
||||||
|
|
||||||
if message.private and message.sender is WCF.User.userID
|
if message.isInPrivateChannel and message.sender is WCF.User.userID
|
||||||
messageContainerID = message.receiver
|
messageContainerID = message.receiver
|
||||||
else if message.private
|
else if message.isInPrivateChannel
|
||||||
messageContainerID = message.sender
|
messageContainerID = message.sender
|
||||||
else
|
else
|
||||||
messageContainerID = 0
|
messageContainerID = 0
|
||||||
@ -687,8 +687,8 @@ Open private channel
|
|||||||
Close private channel
|
Close private channel
|
||||||
|
|
||||||
closePrivateChannel = (userID) ->
|
closePrivateChannel = (userID) ->
|
||||||
$("#timsChatMessageContainer#{userID}").remove() unless userID isnt 0
|
$("#timsChatMessageContainer#{userID}").remove() unless userID is 0
|
||||||
$("#timsChatMessageContainer0").addClass('active')
|
openPrivateChannel 0
|
||||||
|
|
||||||
Bind the given callback to the given event.
|
Bind the given callback to the given event.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user