Altering the UI dynamically across all platforms - best way?

Hi all,

Having writing my question below, I realised it can be summed up as ‘what’s the best cross-platform solution to adding a traffic-light style telephone symbol to Rocket.Chat?’

I want to link up our phone system (voip) with Rocket.Chat. A simple connection - just so we can see who is on the phone at any time with a quick glance.

I have the code working that gets the status of the phone lines for each user (and mapping them to the correct Rocket.Chat user) and I’ve got an incoming web hook set up.

But I’m not sure what the best way is to signal in the interface that the phone is on. Personally I use the web page for our Rocket.Chat but I also use the android app, and I think some of our users may use the desktop app (I need to check that).

I tested some javascript to manipulate the DOM to add a telephone icon to sidebar-item__message-bottom which works fine on a test page (using a copy of the html for the menu).

But if I try to manipulate the DOM from the webhook script, nothing happens. Is it possible?

And even if it did, would that still work across the other versions (desktop app, mobile app?).

Is there a better way to signify the user is on the phone?

I’d rather be able to do it with a normal build of Rocket.Chat instead of creating my own fork.

I’ve considered changing their avatar (but not tested to see if it changes in real-time) or their username (ie, John [Telephone Symbol in Red/Green/Orange]) etc but neither seem like a great idea.

Another option is to embedded the chat into my own web page and have the telephone part elsewhere on the page and manipulate that directly. That could be an option, but using the embed feature loses the channel/room menu - is there a way to embed that too?

I don’t want to just post in to a room that someone has answered the phone etc, it has to be a simple icon you can see at a glance.

Actually, that’s another question - although I may end up not using the web hooks… with an incoming web hook, even if I set text to “” it still posts an empty message into the room. Is there a way to stop it posting totally and just run the script?