Skip to content

Commit eb1c4d6

Browse files
committed
properly set channelId for UI.showInfo
1 parent 55dee6b commit eb1c4d6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

www/scripts/sepiaFW.ui.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,10 @@ function sepiaFW_build_ui(){
207207
//Note: for label button actions see ui.build module
208208

209209
//make an info message
210-
UI.showInfo = function(text, isErrorMessage, customTag, beSilent){
210+
UI.showInfo = function(text, isErrorMessage, customTag, beSilent, channelId){
211211
if (UI.build){
212-
var message = UI.build.makeMessageObject(text, 'UI', 'client', '', 'info'); //note: channelId=info will use the active channel or user-channel
212+
if (channelId == undefined) channelId = 'info'; //note: channelId=info will use the active channel or user-channel
213+
var message = UI.build.makeMessageObject(text, 'UI', 'client', '', channelId);
213214
var sEntry = UI.build.statusMessage(message, 'username', true); //we handle UI messages as errors for now - TODO: add non-error msg
214215
if (customTag){
215216
sEntry.dataset.msgCustomTag = customTag;

www/scripts/sepiaFW.webSocket.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,12 +1978,12 @@ function sepiaFW_build_webSocket_client(){
19781978
//... but only if we haven't already
19791979
if ($("#sepiaFW-chat-output").find('[data-channel-id=' + message.data.channelId + ']').filter('[data-msg-custom-tag=' + customTag + ']').length == 0){
19801980
var weekdayName = SepiaFW.local.getWeekdayName(day) + " " + d.toLocaleDateString();
1981-
SepiaFW.ui.showInfo(weekdayName, false, customTag, true); //SepiaFW.local.g('history')
1981+
SepiaFW.ui.showInfo(weekdayName, false, customTag, true, message.data.channelId); //SepiaFW.local.g('history')
19821982
}
19831983
}
19841984
//add unread note - TODO: place this at correct position
19851985
if (!showedNew && (!lastMsgTS || msg.timeUNIX > lastMsgTS)){
1986-
SepiaFW.ui.showInfo(SepiaFW.local.g('newMessages'), false, "unread-note", true);
1986+
SepiaFW.ui.showInfo(SepiaFW.local.g('newMessages'), false, "unread-note", true, message.data.channelId);
19871987
showedNew = true;
19881988
}
19891989
}

0 commit comments

Comments
 (0)