Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push-to-Talk Support for Jitsi #7709

Closed
wants to merge 39 commits into from

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Nov 15, 2018

Implements the riot-web portion of Push-to-Talk support for Jitsi voice and video calls. The matrix-react-sdk portion is matrix-org/matrix-react-sdk#2280.

Adds a new native node addon, iohook, which is used for listening to shortcuts globally, meaning even when Riot is minimized. As such, iohook needs to be compiled, however like most native node addons, compiled versions for your platform are downloaded during npm install for you. The idea is you should never have to compile your own version unless you are using an unsupported platform. The currently supported platforms are Windows, Mac and Linux, however I am unsure what the support is for *BSD.

In terms of security, iohook is set to stop itself if it is no longer in charge of any shortcuts. It will only enable itself during a Jitsi call or while recording a new shortcut in settings. While recording a new shortcut, iohook will report every keyboard shortcut that is pressed on the keyboard. This is necessary for shortcut recording. However, if Riot is minimized or otherwise somehow removed from focus while recording a shortcut, the recording session will end.

All of the security functionality is controlled by the Main process, with all of the Renderer processes acting like unprivileged clients. Thus, assuming a security flaw like an XSS only gives you access to functions in the Renderer process, no malicious keylogging should be possible.

The code is set up to allow for any global shortcut to be registered, not just those regarding Push-To-Talk functionality. However, the amount of shortcuts that can be registered at one time is currently controlled by const keybindingRegistrationLimit, which is set to 1, so this limit will need to be raised if any future functionality need be added.

@dbkr
Copy link
Member

dbkr commented Nov 16, 2018

Ah - so the thing is that our build system for the electron builds doesn't support native dependencies (we do all our builds on OS X and it can't cross-compile). This might require us getting separate windows, mac and linux build boxes for the electron app. It was bound to happen sooner or later, but it might not be fast I'm afraid.

@anoadragon453
Copy link
Member Author

@dbkr even those that download builds of the native dependencies already like in this case?

@anoadragon453
Copy link
Member Author

Now that electron Riot builds have become possible on our build infrastructure, this will become active again.

* develop:
  Update issue templates
  Fix cleanup script not to remove extracted/bundles directories (element-hq#8764)
@anoadragon453
Copy link
Member Author

anoadragon453 commented Feb 28, 2019

Changes all done wooooooo.

CI needs to be updated, but if you want to test locally:

Go into riot-web and run npm install:electron. Then:

Linux:

  • download and extract the native node module.
  • place iohook.node in riot-web/electron_app/node_modules/iohook/builds/electron-v69-linux-x64/build/Release/iohook.node.

MacOS:

  • download and extract the native node module.
  • place iohook.node in riot-web/electron_app/node_modules/iohook/builds/electron-v69-darwin-x64/build/Release/iohook.node.

Make sure matrix-react-sdk is built (anoa/jitsi_ptt branch) (and that you've run npm run build at least once in riot-web.

Then subsequent changes just require running npm run build:bundle:dev && npm run electron.

Should all work. CI is passing right now as it doesn't build electron builds. We need to get our CI to build it for each platform basically which will happen with BuildKite.

* develop: (30 commits)
  [matrix] -> Matrix
  Nudge karma to 3.1.2
  set chrome path for travis CI explicitly
  Updated install spinner referenced in element-hq#8913
  Add support for localConfig at $appData/config.json. Move electron-config to $appData/electron-config.json
  Translated using Weblate (Hungarian)
  Update to electron 4.0.6
  Translated using Weblate (Spanish)
  Translated using Weblate (Norwegian Bokmål)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Hindi)
  Translated using Weblate (Greek)
  Translated using Weblate (German)
  Translated using Weblate (Finnish)
  Translated using Weblate (Arabic)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (Czech)
  Translated using Weblate (Swedish)
  Translated using Weblate (Swedish)
  Allow disabling update mechanism
  ...
* develop: (75 commits)
  Support CI for matching branches on forks
  Update yarn.lock
  v1.0.4
  Prepare changelog for v1.0.4
  v1.0.4
  Released js-sdk & react-sdk
  Translated using Weblate (Irish)
  Translated using Weblate (English (United States))
  Added translation using Weblate (Irish)
  Update README.md grammar
  Cross-promote mobile apps
  Fix downstream branch fetching
  Update issue templates
  Declare the officially supported browsers in the README
  Update version number in issue templates
  Use the right CI branch
  Set up BuildKite for Chrome
  Lint doesn't need develop deps
  Remove Travis (CI)
  Add a basic BuildKite :pipeline:
  ...
* develop: (47 commits)
  Translated using Weblate (Romanian)
  Translated using Weblate (Finnish)
  Translated using Weblate (Dutch)
  Added translation using Weblate (Slovenian)
  bump olm version
  Use a different cookie to expire any cookies people may already have
  Step cookie down to 4 hours
  Fix autolaunch setting appearing toggled off
  Expire mobile guide cookie after 24 hours
  Don't try to save files the user didn't want to save
  v1.0.6
  Prepare changelog for v1.0.6
  v1.0.6
  Released js-sdk & react-sdk, and bump electron version
  Deleted translation using Weblate (English (United Kingdom))
  Translated using Weblate (Italian)
  Translated using Weblate (Irish)
  Translated using Weblate (Finnish)
  Translated using Weblate (Esperanto)
  Translated using Weblate (English (United Kingdom))
  ...
@murat-aksoy
Copy link

PTT is just working on electron builds? Can I use it for web UI?

@anoadragon453
Copy link
Member Author

I'm afraid not, as websites aren't allowed to access keystrokes when the browser is minimized.

You can however use the space bar for push to talk if you have the jitsi window focused.

@ara4n
Copy link
Member

ara4n commented May 19, 2019

what remains here? just getting CI working for desktop? is that actually a hard blocker?

@BloodyIron
Copy link

@ara4n @anoadragon453 I too would like to know ;)

PTT FTW PLS! :D

@anoadragon453
Copy link
Member Author

anoadragon453 commented May 20, 2019 via email

@Half-Shot
Copy link
Member

Btw, I notice that https://github.com/wilix-team/iohook/blob/master/CHANGELOG.md#v046 includes a windows build fix that was released 9 days ago. Does that improve things?

@anoadragon453
Copy link
Member Author

Maaaybe. I think I'm still having an issue with getting the build tools working though.

There's also still this issue: wilix-team/iohook#167 but apparently there's a workaround justadudewhohacks/opencv4nodejs#564

* develop: (249 commits)
  Clarify deployment scripts
  Add riot.im configuration files
  Enable reactions and edits for desktop
  Remove unused disable_identity_server config flag
  Improve wording in debug log sending in issue templates
  Require a rageshake description in mxSendRageshake
  Fetch deps
  Verify i18n in CI
  Upgrade dependencies
  v1.2.4
  Prepare changelog for v1.2.4
  v1.2.4
  Upgrade lodash
  Upgrade to JS SDK 2.1.1 and React SDK 1.3.1
  v1.2.3
  Prepare changelog for v1.2.3
  v1.2.3
  Upgrade to JS SDK 2.1.0 and React SDK 1.3.0
  Upgrade dependencies
  v1.2.3-rc.1
  ...
* develop: (22 commits)
  v1.3.0
  Prepare changelog for v1.3.0
  v1.3.0
  Upgrade to JS SDK 2.2.0 and React SDK 1.4.0
  Remove reactions feature flag from docs and config
  Remove edits feature flag from docs and config
  Remove reactions feature flag from docs and config
  Remove edits feature flag from docs and config
  cachebust config file requests
  v1.3.0-rc.3
  Prepare changelog for v1.3.0-rc.3
  v1.3.0-rc.3
  react-sdk rc.3
  v1.3.0-rc.2
  Prepare changelog for v1.3.0-rc.2
  v1.3.0-rc.2
  Upgrade to JS SDK 2.2.0-rc.2 and React SDK 1.4.0-rc.2
  Convert install-app-deps to subcommand
  v1.3.0-rc.1
  Prepare changelog for v1.3.0-rc.1
  ...
@anoadragon453
Copy link
Member Author

This PR has been switched to a local branch: #10369

@anoadragon453 anoadragon453 deleted the anoa/jitsi_ptt branch July 19, 2019 09:22
su-ex added a commit to SchildiChat/element-web that referenced this pull request Feb 15, 2022
* Support a config option to change the default device name ([\element-hq#20790](element-hq#20790)).
* Capitalize "Privacy" in UserMenu ([\element-hq#7738](matrix-org/matrix-react-sdk#7738)). Contributed by @aaronraimist.
* Move new search experience to a Beta ([\#7718](matrix-org/matrix-react-sdk#7718)). Fixes element-hq/element-meta#139 element-hq#20618 and element-hq#20339.
* Auto select "Other homeserver" when user press "Edit" in homeserver field ([\element-hq#7337](matrix-org/matrix-react-sdk#7337)). Fixes element-hq#20125. Contributed by @SimonBrandner.
* Add unread badges and avatar decorations to spotlight search ([\element-hq#7696](matrix-org/matrix-react-sdk#7696)). Fixes element-hq#20821.
* Enable location sharing ([\element-hq#7703](matrix-org/matrix-react-sdk#7703)).
* Simplify Composer buttons ([\element-hq#7678](matrix-org/matrix-react-sdk#7678)).
* Add a warning to the console to discourage attacks and encourage contributing ([\element-hq#7673](matrix-org/matrix-react-sdk#7673)). Fixes element-hq#2803. Contributed by @SimonBrandner.
* Don't show replaced calls in the timeline ([\element-hq#7452](matrix-org/matrix-react-sdk#7452)). Contributed by @SimonBrandner.
* Tweak `/addwidget` widget names ([\element-hq#7681](matrix-org/matrix-react-sdk#7681)).
* Chat export parameter customisation ([\element-hq#7647](matrix-org/matrix-react-sdk#7647)).
* Put call on hold when transfer dialog is opened ([\element-hq#7669](matrix-org/matrix-react-sdk#7669)).
* Share e2ee keys when using /invite SlashCommand ([\element-hq#7655](matrix-org/matrix-react-sdk#7655)). Fixes element-hq#20778 and element-hq#16982.
* Tweak spotlight roving behaviour to reset when changing query ([\#7656](matrix-org/matrix-react-sdk#7656)). Fixes element-hq#20537 element-hq#20612 and element-hq#20184.
* Look up tile server info in homeserver's .well-known area ([\element-hq#7623](matrix-org/matrix-react-sdk#7623)).
* Add grouper for hidden events ([\element-hq#7649](matrix-org/matrix-react-sdk#7649)).
* The keyboard shortcut is control (or cmd) shift h. ([\element-hq#7584](matrix-org/matrix-react-sdk#7584)). Contributed by @UwUnyaa.
* [Release] Fix cutout misalignment on some decorated room avatars ([\element-hq#7785](matrix-org/matrix-react-sdk#7785)).
* [Release] Fix add existing space not showing any spaces ([\element-hq#7756](matrix-org/matrix-react-sdk#7756)).
* [Release] Inhibit Room List keyboard pass-thru when the search beta is enabled ([\element-hq#7754](matrix-org/matrix-react-sdk#7754)).
* [Release] Fix space member list not opening ([\element-hq#7755](matrix-org/matrix-react-sdk#7755)).
* Null-guard ELS from null summaryMembers ([\element-hq#7744](matrix-org/matrix-react-sdk#7744)). Fixes element-hq#20807.
* Improve responsiveness of the layout switcher ([\element-hq#7736](matrix-org/matrix-react-sdk#7736)).
* Tweak timeline card layout ([\element-hq#7743](matrix-org/matrix-react-sdk#7743)). Fixes element-hq#20846.
* Ensure location bodies have a width in bubbles ([\element-hq#7742](matrix-org/matrix-react-sdk#7742)). Fixes element-hq#20916.
* Tune aria-live regions around clocks/timers ([\element-hq#7735](matrix-org/matrix-react-sdk#7735)). Fixes element-hq#20967.
* Fix instances of decorated room avatar wrongly having their own tabIndex ([\element-hq#7730](matrix-org/matrix-react-sdk#7730)).
* Remove weird padding on stickers ([\element-hq#6271](matrix-org/matrix-react-sdk#6271)). Fixes element-hq#17787. Contributed by @SimonBrandner.
* Fix width issue of the composer overflow menu items ([\element-hq#7731](matrix-org/matrix-react-sdk#7731)). Fixes element-hq#20898.
* Properly handle persistent widgets when room is left ([\element-hq#7724](matrix-org/matrix-react-sdk#7724)). Fixes element-hq#20901.
* Null guard space hierarchy ([\element-hq#7729](matrix-org/matrix-react-sdk#7729)). Fixes matrix-org/element-web-rageshakes#10433.
* Fix add existing rooms button ([\element-hq#7728](matrix-org/matrix-react-sdk#7728)). Fixes element-hq#20924. Contributed by @SimonBrandner.
* Truncate long server names on login/register screen ([\element-hq#7702](matrix-org/matrix-react-sdk#7702)). Fixes element-hq#18452.
* Update PollCreateDialog-test to snapshot the html and not react tree ([\element-hq#7712](matrix-org/matrix-react-sdk#7712)).
* Fix creating polls outside of threads ([\element-hq#7711](matrix-org/matrix-react-sdk#7711)). Fixes element-hq#20882.
* Open native room when clicking notification from a virtual room ([\element-hq#7709](matrix-org/matrix-react-sdk#7709)).
* Fix relative link handling in Element Desktop ([\element-hq#7708](matrix-org/matrix-react-sdk#7708)). Fixes element-hq#20783.
* Reuse CopyableText component in all places it can be ([\element-hq#7701](matrix-org/matrix-react-sdk#7701)). Fixes element-hq#20855.
* Fit location into the width of the container ([\element-hq#7705](matrix-org/matrix-react-sdk#7705)). Fixes element-hq#20861.
* Make Spotlight Dialog roving reset more stable ([\element-hq#7698](matrix-org/matrix-react-sdk#7698)). Fixes element-hq#20826.
* Fix incorrect sizing of DecoratedRoomAvatar in RoomHeader ([\element-hq#7697](matrix-org/matrix-react-sdk#7697)). Fixes element-hq#20090.
* Use a more correct test for emoji ([\element-hq#7685](matrix-org/matrix-react-sdk#7685)). Fixes element-hq#20824. Contributed by @robintown.
* Fix vertical spacing in `compact` `<ContextMenu>` ([\element-hq#7684](matrix-org/matrix-react-sdk#7684)). Fixes element-hq#20801.
* Fix the sticker picker ([\element-hq#7692](matrix-org/matrix-react-sdk#7692)). Fixes element-hq#20797.
* Fix publishing address wrongly demanding the alias be available ([\element-hq#7690](matrix-org/matrix-react-sdk#7690)). Fixes element-hq#12013 and element-hq#20833.
* Prevent MemberAvatar soft-crashing when rendered with null member prop ([\element-hq#7691](matrix-org/matrix-react-sdk#7691)). Fixes element-hq#20714.
* Ensure UserInfo can be rendered without a room ([\element-hq#7687](matrix-org/matrix-react-sdk#7687)). Fixes element-hq#20830.
* Make polls fill column width in bubbles layout ([\#7661](matrix-org/matrix-react-sdk#7661)). Fixes element-hq#20712.
* Add a background to expanded nick name in IRC layout to make it readable. ([\element-hq#7652](matrix-org/matrix-react-sdk#7652)). Fixes element-hq#20757. Contributed by @UwUnyaa.
* Fix accessibility and consistency of MessageComposerButtons ([\element-hq#7679](matrix-org/matrix-react-sdk#7679)). Fixes element-hq#20814.
* Don't show shield next to deleted messages ([\element-hq#7671](matrix-org/matrix-react-sdk#7671)). Fixes element-hq#20475. Contributed by @SimonBrandner.
* Fix font size of spaces between big emoji ([\element-hq#7675](matrix-org/matrix-react-sdk#7675)). Contributed by @robintown.
* Fix shift-enter repeating last character ([\element-hq#7665](matrix-org/matrix-react-sdk#7665)). Fixes element-hq#17215. Contributed by @SimonBrandner.
* Remove Unpin option from maximised widget context menu ([\element-hq#7657](matrix-org/matrix-react-sdk#7657)).
* Fix new call event grouper implementation for encrypted rooms ([\element-hq#7654](matrix-org/matrix-react-sdk#7654)).
* Fix issue with tile error boundaries collapsing in bubbles layout ([\element-hq#7653](matrix-org/matrix-react-sdk#7653)).
* Fix emojis getting cropped in irc & bubble layouts by anti-zalgo ([\element-hq#7637](matrix-org/matrix-react-sdk#7637)). Fixes element-hq#20744.
* Fix space panel edge gradient not applying on load ([\element-hq#7644](matrix-org/matrix-react-sdk#7644)). Fixes element-hq#20756.
* Fix search results view for layouts other than Group/Modern ([\element-hq#7648](matrix-org/matrix-react-sdk#7648)). Fixes element-hq#20745.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants