Explorar el Código

misc: remove dead code 🔥🔥🔥 (#2844)

- old toolbox actions
- chat command processor
- room subject handling
j8
Saúl Ibarra Corretgé hace 7 años
padre
commit
2861d8d24e

+ 0
- 7
conference.js Ver fichero

@@ -2124,13 +2124,6 @@ export default {
2124 2124
             room.toggleRecording(options);
2125 2125
         });
2126 2126
 
2127
-        APP.UI.addListener(UIEvents.SUBJECT_CHANGED, topic => {
2128
-            room.setSubject(topic);
2129
-        });
2130
-        room.on(JitsiConferenceEvents.SUBJECT_CHANGED, subject => {
2131
-            APP.UI.setSubject(subject);
2132
-        });
2133
-
2134 2127
         APP.UI.addListener(UIEvents.AUTH_CLICKED, () => {
2135 2128
             AuthHandler.authenticate(room);
2136 2129
         });

+ 0
- 6
modules/UI/UI.js Ver fichero

@@ -444,12 +444,6 @@ UI.addRemoteStream = track => VideoLayout.onRemoteStreamAdded(track);
444 444
  */
445 445
 UI.removeRemoteStream = track => VideoLayout.onRemoteStreamRemoved(track);
446 446
 
447
-/**
448
- * Update chat subject.
449
- * @param {string} subject new chat subject
450
- */
451
-UI.setSubject = subject => Chat.setSubject(subject);
452
-
453 447
 /**
454 448
  * Setup and show Etherpad.
455 449
  * @param {string} name etherpad id

+ 4
- 26
modules/UI/side_pannels/chat/Chat.js Ver fichero

@@ -1,7 +1,6 @@
1 1
 /* global APP, $ */
2 2
 
3
-import { processReplacements, linkify } from './Replacement';
4
-import CommandsProcessor from './Commands';
3
+import { processReplacements } from './Replacement';
5 4
 import VideoLayout from '../../videolayout/VideoLayout';
6 5
 
7 6
 import UIUtil from '../../util/UIUtil';
@@ -12,8 +11,7 @@ import { smileys } from './smileys';
12 11
 import { addMessage, markAllRead } from '../../../../react/features/chat';
13 12
 import {
14 13
     dockToolbox,
15
-    getToolboxHeight,
16
-    setSubject
14
+    getToolboxHeight
17 15
 } from '../../../../react/features/toolbox';
18 16
 
19 17
 let unreadMessages = 0;
@@ -235,15 +233,10 @@ const Chat = {
235 233
 
236 234
                 usermsg.val('').trigger('autosize.resize');
237 235
                 this.focus();// eslint-disable-line no-invalid-this
238
-                const command = new CommandsProcessor(value, eventEmitter);
239 236
 
240
-                if (command.isCommand()) {
241
-                    command.processCommand();
242
-                } else {
243
-                    const message = UIUtil.escapeHtml(value);
237
+                const message = UIUtil.escapeHtml(value);
244 238
 
245
-                    eventEmitter.emit(UIEvents.MESSAGE_CREATED, message);
246
-                }
239
+                eventEmitter.emit(UIEvents.MESSAGE_CREATED, message);
247 240
             }
248 241
         });
249 242
 
@@ -351,21 +344,6 @@ const Chat = {
351 344
             { scrollTop: $('#chatconversation')[0].scrollHeight }, 1000);
352 345
     },
353 346
 
354
-    /**
355
-     * Sets the subject to the UI
356
-     * @param subject the subject
357
-     */
358
-    setSubject(subject) {
359
-        if (subject) {
360
-            // eslint-disable-next-line no-param-reassign
361
-            subject = subject.trim();
362
-        }
363
-
364
-        const html = linkify(UIUtil.escapeHtml(subject));
365
-
366
-        APP.store.dispatch(setSubject(html));
367
-    },
368
-
369 347
     /**
370 348
      * Sets the chat conversation mode.
371 349
      * Conversation mode is the normal chat mode, non conversation mode is

+ 0
- 94
modules/UI/side_pannels/chat/Commands.js Ver fichero

@@ -1,94 +0,0 @@
1
-import UIUtil from '../../util/UIUtil';
2
-import UIEvents from '../../../../service/UI/UIEvents';
3
-
4
-/**
5
- * List with supported commands. The keys are the names of the commands and
6
- * the value is the function that processes the message.
7
- * @type {{String: function}}
8
- */
9
-const commands = {
10
-    'topic': processTopic
11
-};
12
-
13
-/**
14
- * Extracts the command from the message.
15
- * @param message the received message
16
- * @returns {string} the command
17
- */
18
-function getCommand(message) {
19
-    if (message) {
20
-        for (const command in commands) {
21
-            if (message.indexOf(`/${command}`) === 0) {
22
-                return command;
23
-            }
24
-        }
25
-    }
26
-
27
-    return '';
28
-}
29
-
30
-/**
31
- * Processes the data for topic command.
32
- * @param commandArguments the arguments of the topic command.
33
- */
34
-function processTopic(commandArguments, emitter) {
35
-    const topic = UIUtil.escapeHtml(commandArguments);
36
-
37
-    emitter.emit(UIEvents.SUBJECT_CHANGED, topic);
38
-}
39
-
40
-/**
41
- * Constructs a new CommandProccessor instance from a message that
42
- * handles commands received via chat messages.
43
- * @param message the message
44
- * @constructor
45
- */
46
-function CommandsProcessor(message, emitter) {
47
-    const command = getCommand(message);
48
-
49
-    this.emitter = emitter;
50
-
51
-    /**
52
-     * Returns the name of the command.
53
-     * @returns {String} the command
54
-     */
55
-    this.getCommand = function() {
56
-        return command;
57
-    };
58
-
59
-
60
-    const messageArgument = message.substr(command.length + 2);
61
-
62
-    /**
63
-     * Returns the arguments of the command.
64
-     * @returns {string}
65
-     */
66
-    this.getArgument = function() {
67
-        return messageArgument;
68
-    };
69
-}
70
-
71
-/**
72
- * Checks whether this instance is valid command or not.
73
- * @returns {boolean}
74
- */
75
-CommandsProcessor.prototype.isCommand = function() {
76
-    if (this.getCommand()) {
77
-        return true;
78
-    }
79
-
80
-    return false;
81
-};
82
-
83
-/**
84
- * Processes the command.
85
- */
86
-CommandsProcessor.prototype.processCommand = function() {
87
-    if (!this.isCommand()) {
88
-        return;
89
-    }
90
-
91
-    commands[this.getCommand()](this.getArgument(), this.emitter);
92
-};
93
-
94
-export default CommandsProcessor;

+ 0
- 32
react/features/toolbox/actionTypes.js Ver fichero

@@ -18,18 +18,6 @@ export const CLEAR_TOOLBOX_TIMEOUT = Symbol('CLEAR_TOOLBOX_TIMEOUT');
18 18
  */
19 19
 export const FULL_SCREEN_CHANGED = Symbol('FULL_SCREEN_CHANGED');
20 20
 
21
-/**
22
- * The type of the action which sets the default toolbar buttons of the Toolbox.
23
- *
24
- * {
25
- *     type: SET_DEFAULT_TOOLBOX_BUTTONS,
26
- *     primaryToolbarButtons: Map,
27
- *     secondaryToolbarButtons: Map
28
- * }
29
- */
30
-export const SET_DEFAULT_TOOLBOX_BUTTONS
31
-    = Symbol('SET_DEFAULT_TOOLBOX_BUTTONS');
32
-
33 21
 /**
34 22
  * The type of (redux) action which requests full screen mode be entered or
35 23
  * exited.
@@ -41,26 +29,6 @@ export const SET_DEFAULT_TOOLBOX_BUTTONS
41 29
  */
42 30
 export const SET_FULL_SCREEN = Symbol('SET_FULL_SCREEN');
43 31
 
44
-/**
45
- * The type of the action which sets the conference subject.
46
- *
47
- * {
48
- *     type: SET_SUBJECT,
49
- *     subject: string
50
- * }
51
- */
52
-export const SET_SUBJECT = Symbol('SET_SUBJECT');
53
-
54
-/**
55
- * The type of the action which sets the subject slide in.
56
- *
57
- * {
58
- *     type: SET_SUBJECT_SLIDE_IN,
59
- *     subjectSlideIn: boolean
60
- * }
61
- */
62
-export const SET_SUBJECT_SLIDE_IN = Symbol('SET_SUBJECT_SLIDE_IN');
63
-
64 32
 /**
65 33
  * The type of the action which sets the indicator which determiens whether a
66 34
  * fToolbar in the Toolbox is hovered.

+ 0
- 32
react/features/toolbox/actions.native.js Ver fichero

@@ -2,8 +2,6 @@
2 2
 
3 3
 import {
4 4
     CLEAR_TOOLBOX_TIMEOUT,
5
-    SET_SUBJECT,
6
-    SET_SUBJECT_SLIDE_IN,
7 5
     SET_TOOLBAR_HOVERED,
8 6
     SET_TOOLBOX_ALWAYS_VISIBLE,
9 7
     SET_TOOLBOX_ENABLED,
@@ -26,36 +24,6 @@ export function clearToolboxTimeout(): Object {
26 24
     };
27 25
 }
28 26
 
29
-/**
30
- * Signals that value of conference subject should be changed.
31
- *
32
- * @param {string} subject - Conference subject string.
33
- * @returns {Object}
34
- */
35
-export function setSubject(subject: string): Object {
36
-    return {
37
-        type: SET_SUBJECT,
38
-        subject
39
-    };
40
-}
41
-
42
-/**
43
- * Signals that toolbox subject slide in value should be changed.
44
- *
45
- * @param {boolean} subjectSlideIn - True if the subject is shown; otherwise,
46
- * false.
47
- * @returns {{
48
- *     type: SET_SUBJECT_SLIDE_IN,
49
- *     subjectSlideIn: boolean
50
- * }}
51
- */
52
-export function setSubjectSlideIn(subjectSlideIn: boolean): Object {
53
-    return {
54
-        type: SET_SUBJECT_SLIDE_IN,
55
-        subjectSlideIn
56
-    };
57
-}
58
-
59 27
 /**
60 28
  * Signals that toolbar is hovered value should be changed.
61 29
  *

+ 0
- 3
react/features/toolbox/actions.web.js Ver fichero

@@ -5,7 +5,6 @@ import SideContainerToggler
5 5
 
6 6
 import {
7 7
     clearToolboxTimeout,
8
-    setSubjectSlideIn,
9 8
     setToolboxTimeout,
10 9
     setToolboxTimeoutMS,
11 10
     setToolboxVisible
@@ -98,7 +97,6 @@ export function hideToolbox(force: boolean = false): Function {
98 97
                     timeoutMS));
99 98
         } else {
100 99
             dispatch(setToolboxVisible(false));
101
-            dispatch(setSubjectSlideIn(false));
102 100
         }
103 101
     };
104 102
 }
@@ -137,7 +135,6 @@ export function showToolbox(timeout: number = 0): Object {
137 135
 
138 136
         if (enabled && !visible) {
139 137
             dispatch(setToolboxVisible(true));
140
-            dispatch(setSubjectSlideIn(true));
141 138
 
142 139
             // If the Toolbox is always visible, there's no need for a timeout
143 140
             // to toggle its visibility.

+ 1
- 57
react/features/toolbox/reducer.js Ver fichero

@@ -5,9 +5,6 @@ import { ReducerRegistry } from '../base/redux';
5 5
 import {
6 6
     CLEAR_TOOLBOX_TIMEOUT,
7 7
     FULL_SCREEN_CHANGED,
8
-    SET_DEFAULT_TOOLBOX_BUTTONS,
9
-    SET_SUBJECT,
10
-    SET_SUBJECT_SLIDE_IN,
11 8
     SET_TOOLBAR_HOVERED,
12 9
     SET_TOOLBOX_ALWAYS_VISIBLE,
13 10
     SET_TOOLBOX_ENABLED,
@@ -24,11 +21,8 @@ declare var interfaceConfig: Object;
24 21
  * @private
25 22
  * @returns {{
26 23
  *     alwaysVisible: boolean,
24
+ *     enabled: boolean,
27 25
  *     hovered: boolean,
28
- *     primaryToolbarButtons: Map,
29
- *     secondaryToolbarButtons: Map,
30
- *     subject: string,
31
- *     subjectSlideIn: boolean,
32 26
  *     timeoutID: number,
33 27
  *     timeoutMS: number,
34 28
  *     visible: boolean
@@ -68,34 +62,6 @@ function _getInitialState() {
68 62
          */
69 63
         hovered: false,
70 64
 
71
-        /**
72
-         * A Map of the default buttons of the PrimaryToolbar.
73
-         *
74
-         * @type {Map}
75
-         */
76
-        primaryToolbarButtons: new Map(),
77
-
78
-        /**
79
-         * A Map of the default buttons of the SecondaryToolbar.
80
-         *
81
-         * @type {Map}
82
-         */
83
-        secondaryToolbarButtons: new Map(),
84
-
85
-        /**
86
-         * The text of the conference subject.
87
-         *
88
-         * @type {string}
89
-         */
90
-        subject: '',
91
-
92
-        /**
93
-         * The indicator which determines whether the subject is sliding in.
94
-         *
95
-         * @type {boolean}
96
-         */
97
-        subjectSlideIn: false,
98
-
99 65
         /**
100 66
          * A number, non-zero value which identifies the timer created by a call
101 67
          * to setTimeout() with timeoutMS.
@@ -137,28 +103,6 @@ ReducerRegistry.register(
137 103
                 fullScreen: action.fullScreen
138 104
             };
139 105
 
140
-        case SET_DEFAULT_TOOLBOX_BUTTONS: {
141
-            const { primaryToolbarButtons, secondaryToolbarButtons } = action;
142
-
143
-            return {
144
-                ...state,
145
-                primaryToolbarButtons,
146
-                secondaryToolbarButtons
147
-            };
148
-        }
149
-
150
-        case SET_SUBJECT:
151
-            return {
152
-                ...state,
153
-                subject: action.subject
154
-            };
155
-
156
-        case SET_SUBJECT_SLIDE_IN:
157
-            return {
158
-                ...state,
159
-                subjectSlideIn: action.subjectSlideIn
160
-            };
161
-
162 106
         case SET_TOOLBAR_HOVERED:
163 107
             return {
164 108
                 ...state,

+ 0
- 1
service/UI/UIEvents.js Ver fichero

@@ -70,7 +70,6 @@ export default {
70 70
     HANGUP: 'UI.hangup',
71 71
     LOGOUT: 'UI.logout',
72 72
     RECORDING_TOGGLED: 'UI.recording_toggled',
73
-    SUBJECT_CHANGED: 'UI.subject_changed',
74 73
     VIDEO_DEVICE_CHANGED: 'UI.video_device_changed',
75 74
     AUDIO_DEVICE_CHANGED: 'UI.audio_device_changed',
76 75
     AUDIO_OUTPUT_DEVICE_CHANGED: 'UI.audio_output_device_changed',

Loading…
Cancelar
Guardar