Skip to content

Commit

Permalink
feat: Enable End-To-End Encryption (E2EE)
Browse files Browse the repository at this point in the history
  • Loading branch information
jibon57 committed Jul 17, 2023
1 parent cc27369 commit e2872c9
Show file tree
Hide file tree
Showing 27 changed files with 2,191 additions and 224 deletions.
7 changes: 5 additions & 2 deletions plugnmeet/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: mynaparrot
Donate link: https://www.plugnmeet.org/
Tags: mynaparrot, web conference, plugnmeet
Requires at least: 5.9
Tested up to: 6.2
Stable tag: 1.2.3
Tested up to: 6.2.2
Stable tag: 1.2.4
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -68,6 +68,9 @@ This plugin will require the [plugNmeet-server](https://github.com/mynaparrot/pl
2. Shared notepad

== Changelog ==
= 1.2.4 =
* feat: E2EE

= 1.2.3 =
* feat: Speech to text/translation

Expand Down
18 changes: 1 addition & 17 deletions plugnmeet/admin/class-plugnmeet-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,24 +256,8 @@ public function save_room_data() {
$published = isset( $_POST['published'] ) ? sanitize_text_field( $_POST['published'] ) : 1;
$roles = isset( $_POST['roles'] ) ? $_POST['roles'] : array();

$room_metadata_items = [
'room_features',
'recording_features',
'chat_features',
'shared_note_pad_features',
'whiteboard_features',
'external_media_player_features',
'waiting_room_features',
'breakout_room_features',
'display_external_link_features',
'ingress_features',
'speech_to_text_translation_features',
'default_lock_settings',
'custom_design'
];

$room_metadata = [];
foreach ( $room_metadata_items as $item ) {
foreach ( PlugnmeetHelper::$roomMetadataItems as $item ) {
if ( isset( $_POST[ $item ] ) ) {
$room_metadata[ $item ] = $_POST[ $item ];
} else {
Expand Down
20 changes: 2 additions & 18 deletions plugnmeet/admin/class-plugnmeet-room-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,33 +97,17 @@ private function getFormData() {
$fields_values['attendee_pass'] = PlugnmeetHelper::secureRandomKey( 10 );
}

$room_metadata_items = [
'room_features',
'recording_features',
'chat_features',
'shared_note_pad_features',
'whiteboard_features',
'external_media_player_features',
'waiting_room_features',
'breakout_room_features',
'display_external_link_features',
'ingress_features',
'speech_to_text_translation_features',
'default_lock_settings',
'custom_design'
];

if ( isset( $data->room_metadata ) ) {
$room_metadata = json_decode( $data->room_metadata, true );
foreach ( $room_metadata_items as $item ) {
foreach ( PlugnmeetHelper::$roomMetadataItems as $item ) {
if ( isset( $room_metadata[ $item ] ) ) {
$fields_values[ $item ] = $room_metadata[ $item ];
} else {
$fields_values[ $item ] = [];
}
}
} else {
foreach ( $room_metadata_items as $item ) {
foreach ( PlugnmeetHelper::$roomMetadataItems as $item ) {
$fields_values[ $item ] = [];
}
}
Expand Down
6 changes: 6 additions & 0 deletions plugnmeet/admin/partials/plugnmeet-admin-edit-room.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@
<?php echo PlugnmeetHelper::getSpeechToTextTranslationFeatures( $fields_values['speech_to_text_translation_features'] ); ?>
</tbody>
</table>
<hr/>
<table class="form-table" role="presentation">
<tbody>
<?php echo PlugnmeetHelper::getEndToEndEncryptionFeatures( $fields_values['end_to_end_encryption_features'] ); ?>
</tbody>
</table>
</div>

<div class="tab-pane fade" id="lock" role="tabpanel" aria-labelledby="lock-tab">
Expand Down
44 changes: 44 additions & 0 deletions plugnmeet/helpers/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@

class PlugnmeetHelper {

public static $roomMetadataItems = [
'room_features',
'recording_features',
'chat_features',
'shared_note_pad_features',
'whiteboard_features',
'external_media_player_features',
'waiting_room_features',
'breakout_room_features',
'display_external_link_features',
'ingress_features',
'speech_to_text_translation_features',
'end_to_end_encryption_features',
'default_lock_settings',
'custom_design'
];

private static $allowedHtml = array(
'select' => array(
'id' => array(),
Expand Down Expand Up @@ -614,6 +631,33 @@ public static function getSpeechToTextTranslationFeatures( $speech_features ) {
return self::formatHtml( $speechFeatures, "speech_to_text_translation_features", $data );
}

public static function getEndToEndEncryptionFeatures( $e2ee_features ) {
$e2eeFeatures = array(
"is_enabled" => array(
"label" => __( "Enable End-To-End Encryption (E2EE)", "plugnmeet" ),
"options" => array(
array(
"label" => __( "Yes", "plugnmeet" ),
"value" => 1
),
array(
"label" => __( "No", "plugnmeet" ),
"value" => 0
)
),
"selected" => 0,
"type" => "select"
)
);

$data = [];
if ( ! empty( $e2ee_features ) ) {
$data = $e2ee_features;
}

return self::formatHtml( $e2eeFeatures, "end_to_end_encryption_features", $data );
}

public static function getDefaultLockSettings( $default_lock_settings ) {
$defaultLockSettings = array(
"lock_microphone" => array(
Expand Down
2 changes: 1 addition & 1 deletion plugnmeet/helpers/libs/plugnmeet-sdk-php/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "plugNmeet PHP SDK",
"type": "library",
"license": "MIT",
"version": "1.2.5",
"version": "1.3.0",
"autoload": {
"psr-4": {
"Mynaparrot\\Plugnmeet\\": "src/"
Expand Down
Loading

0 comments on commit e2872c9

Please sign in to comment.