Skip to content

Commit

Permalink
fix: Set caller to unknown_caller for notified functions
Browse files Browse the repository at this point in the history
Signed-off-by: Gerard Hickey <[email protected]>
  • Loading branch information
hickey committed Mar 3, 2024
1 parent b51bb16 commit 7856502
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions www/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ function monitor_last_update() {

function update_messages(reason=Messages.MSG_UPDATE) {
if (reason != Messages.MSG_UPDATE) return;
let caller = (new Error()).stack.split("\n")[3].split("/")[0];
try {
var caller = (new Error()).stack.split("\n")[3].split("/")[0];
}
catch (TypeError) {
var caller = "unknown_caller";
}
console.debug(caller + "->update_messages(reason=MSG_UPDATE)");

// update the message table
Expand All @@ -33,14 +38,24 @@ function update_messages(reason=Messages.MSG_UPDATE) {

function new_messages(reason) {
if (reason != Messages.NEW_MSG) return;
let caller = (new Error()).stack.split("\n")[3].split("/")[0];
try {
var caller = (new Error()).stack.split("\n")[3].split("/")[0];
}
catch (TypeError) {
var caller = "unknown_caller";
}
console.debug(caller + "->new_messages(reason=NEW_MSG)");
alert.play();
}

function update_channels(reason) {
if (reason != Messages.CHAN_UPDATE) return;
let caller = (new Error()).stack.split("\n")[3].split("/")[0];
try {
var caller = (new Error()).stack.split("\n")[3].split("/")[0];
}
catch (TypeError) {
var caller = "unknown_caller";
}
console.debug(caller + "->update_channels(reason=CHAN_UPDATE)");

let msg_refresh = false;
Expand Down

0 comments on commit 7856502

Please sign in to comment.