RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.12k stars 10.36k forks source link

Add real away presence based on web extensions idle API #4712

Open xadhoom opened 7 years ago

xadhoom commented 7 years ago

One of the thing I miss from IM clients is a real away status, not the fake one of Rocket which is limited by what the browser allows to do.

So I've built a simple Chrome web extension that allows to push real away status to Rocket.Chat.

Code is here: https://github.com/VoiSmart/rocketchat-chrome-presence

On Rocket.Chat side the simple snippet cited into the README.md is everything is needed to make it work with the extension (by adding it into the startup sequence in client/startup/) (basically is a bridge between the extension sandbox and the webpage)

what do you think?

If the idea is welcome, I can add a PR for the above client code and make an extension for Firefox and maybe Edge.

marceloschmidt commented 7 years ago

I apologize for my ignorance on this subject, but what are the limitations of what's currently developed and what are the changes by using it within an extension? TIA

xadhoom commented 7 years ago

pretty simple, right now the rocket user presence plugin just records activity on the tab, and as soon as you switch the tab or go on another application, you're marked away (after a timeout), when in reality you're working at your desk.

basically the rocket away status is "away from browser tab" not away from computer.

The idle API reports the real status of the user checking the system activity, like any IM desktop client does, so you can be on another app/tab and the user status is still marked "online" since there's activity on the system.

As soon as you stop "working" the timer fires and you're effectively away, going back online as soon as you start using your keyboard/mouse, without having to go on the Rocket.Chat browser tab.

Unfortunately these APIs are exposed only to a web extension, so a bridge must be done.

Nemra1 commented 7 years ago

im new with rocket.chat ..so can u pls explain this? On Rocket.Chat this snippet must be added into the client wher ican finde this snippet ?

klatys commented 7 years ago

This is related to #736

Sing-Li commented 5 years ago

We need a cross-browser solution for web client. But perhaps Electron client can be improved.

Please go ahead and share you plugin with the community if you wish,

engelgabriel commented 5 years ago

@Sing-Li the source code has been shared already at https://github.com/VoiSmart/rocketchat-chrome-presence

I think we should incorporate it into our own extension.

engelgabriel commented 5 years ago

I forked the code on https://github.com/RocketChat/rocketchat-chrome-presence so we can add it to our own extension https://github.com/RocketChat/Rocket.Chat.ScreenShare.Extensions