Skip to content

Commit f4a331d

Browse files
committed
prevent own messages to show up as 'new' in channel history
1 parent da8f8c2 commit f4a331d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

www/scripts/sepiaFW.webSocket.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,8 +1984,13 @@ function sepiaFW_build_webSocket_client(){
19841984
SepiaFW.ui.showInfo(weekdayName, false, customTag, true, message.data.channelId); //SepiaFW.local.g('history')
19851985
}
19861986
}
1987-
//add unread note - TODO: place this at correct position
1988-
isNew = (!lastMsgTS || msg.timeUNIX > lastMsgTS);
1987+
//add unread note
1988+
isNew = (!lastMsgTS || msg.timeUNIX > lastMsgTS); //TODO: I think due to some ms time difference in server and client this can fail sometimes
1989+
if (isNew && msg.sender && msg.sender == SepiaFW.account.getUserId()){
1990+
//we don't need to mark own messages
1991+
isNew = false;
1992+
//TODO: there is a curious bug somewhere that messes with 'lastChannelMessageTimestamps' sometimes so last read msg is shown, idk where :-/
1993+
}
19891994
if (isNew && !showedNew){
19901995
SepiaFW.ui.showInfo(SepiaFW.local.g('newMessages'), false, "unread-note", true, message.data.channelId);
19911996
showedNew = true;

0 commit comments

Comments
 (0)