Skip to content
Snippets Groups Projects
Commit 0079b493 authored by Atanamo's avatar Atanamo
Browse files

Fix: Show notices on own channel joins/leaves in history

parent 4b5a27e8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -217,12 +217,21 @@ class Channel
promise.then (logListData) =>
oldestTimestamp = logListData[0]?.timestamp or -1
newestTimestamp = logListData[logListData.length - 1]?.timestamp or -1
logListData.pop() if logListData.length is 1 and not @isPublic # Filter client's join
# Filter last entry, if it's the client's join (Cause in this case, the history is requested on joining)
if not @isPublic
lastEntry = logListData[logListData.length-1]
if lastEntry?.event_name is 'user_change'
eventData = JSON.parse(lastEntry.event_data) or {}
logListData.pop() if eventData.type is 'add' or eventData.action is 'join'
# Build marker data
markerData =
count: logListData.length
start: oldestTimestamp
end: newestTimestamp
 
# Send history
@_sendToSocket(clientSocket, 'history_start', markerData)
for logEntry in logListData
eventData = JSON.parse(logEntry.event_data)
Loading
Loading
Loading
Loading
@@ -187,6 +187,10 @@ class this.ChatController
# Socket client handling
#
 
isHistoryReceivingChannel: (channel) ->
tabPage = @_getChannelTabPage(channel)
return @_isHistoryReceivingTab(tabPage)
handleServerDisconnect: ->
# Inform all channel tabs and clear user lists
informText = Translation.get('msg.server_connection_lost')
Loading
Loading
Loading
Loading
@@ -128,7 +128,10 @@ class this.SocketClient
@chatController.handleChannelUserNumber(channel, clientsNumber)
 
_handleChannelUserChange: (channel, timestamp, data) =>
if not @_isOwnUser(data, 'user') or data.action in ['kick', 'kill'] # Ignore notices on own channel join/leave
isOwnHiddenChange = @_isOwnUser(data, 'user') and data.action in ['join', 'leave']
isHistoric = @chatController.isHistoryReceivingChannel(channel)
if not isOwnHiddenChange or isHistoric # Ignore live notices on own channel join/leave
@_simplifyUserIdentityData(data, 'user')
@_addContentMetaInfo(data, 'user')
@chatController.handleChannelUserChange(channel, timestamp, data)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment