Atrium brkmsg handler





Atrium["brkmsg handler"] is a user defined function that overrides Atrium's default break-message popup. When defined, this function is called whenever a break message is received by a session running in an Atrium tab.

Instead of letting Atrium show the message, custom code can handle it.

Parameters:

  • message - This is an array of objects passed by Atrium to your function containing the following fields in each object:

    • date - The date the message was sent.

    • time - The time the message was sent.

    • msg - The message content.

    • jobName - The jobName of the user who sent the message.

    • jobUserName - The user name of the user who sent the message.

    • jobNum - The job number of the user who sent the message.

    • jobCurProfName - The Current Profile Name of the user who sent the message.

  • userId - This is an the user-id to receive the message.



This method is available with Profound UI Fix Packs later than Version 6, Fix Pack 1.2.

Example Custom Format

Override the default break message handler by defining Atrium["brkmsg handler"] in a script in your userdata/extension/atrium/ folder. For example, if your installation is named "profoundui", then you can define the function in /profoundui/userdata/extension/atrium/custom.js in your htdocs folder.

A sample definition is:

Atrium["brkmsg handler"] = function(messages, userId){ if (messages != null && messages.length > 0 && userId != null && userId.length > 0){ console.log("break messages:", messages, userId); setTimeout(function(){ localStorage.removeItem("brkmsgMessages_" + userId ); //a delay is necessary. }, 1); } };