소스 검색

rn: drop {AddPeople,Invite}Controller

We are going to implement the invite dialog *inside* the SDK, so there is no
need to have all this machinery anymore.
master
Saúl Ibarra Corretgé 6 년 전
부모
커밋
5f7a515610
30개의 변경된 파일9개의 추가작업 그리고 1996개의 파일을 삭제
  1. 0
    117
      android/app/src/main/java/org/jitsi/meet/MainActivity.java
  2. 0
    37
      android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java
  3. 0
    1
      android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java
  4. 0
    211
      android/sdk/src/main/java/org/jitsi/meet/sdk/invite/AddPeopleController.java
  5. 0
    56
      android/sdk/src/main/java/org/jitsi/meet/sdk/invite/AddPeopleControllerListener.java
  6. 0
    265
      android/sdk/src/main/java/org/jitsi/meet/sdk/invite/InviteController.java
  7. 0
    29
      android/sdk/src/main/java/org/jitsi/meet/sdk/invite/InviteControllerListener.java
  8. 0
    171
      android/sdk/src/main/java/org/jitsi/meet/sdk/invite/InviteModule.java
  9. 1
    5
      ios/app/src/ViewController.h
  10. 0
    103
      ios/app/src/ViewController.m
  11. 0
    42
      ios/sdk/sdk.xcodeproj/project.pbxproj
  12. 0
    6
      ios/sdk/src/JitsiMeet.h
  13. 0
    3
      ios/sdk/src/JitsiMeetView.h
  14. 0
    9
      ios/sdk/src/JitsiMeetView.m
  15. 0
    33
      ios/sdk/src/invite/AddPeopleController+Private.h
  16. 0
    31
      ios/sdk/src/invite/AddPeopleController.h
  17. 0
    82
      ios/sdk/src/invite/AddPeopleController.m
  18. 0
    41
      ios/sdk/src/invite/AddPeopleControllerDelegate.h
  19. 0
    30
      ios/sdk/src/invite/Invite+Private.h
  20. 0
    127
      ios/sdk/src/invite/Invite.m
  21. 0
    53
      ios/sdk/src/invite/InviteController+Private.h
  22. 0
    32
      ios/sdk/src/invite/InviteController.h
  23. 0
    160
      ios/sdk/src/invite/InviteController.m
  24. 0
    29
      ios/sdk/src/invite/InviteControllerDelegate.h
  25. 0
    10
      react/features/app/components/App.native.js
  26. 0
    13
      react/features/invite/actionTypes.js
  27. 3
    36
      react/features/invite/components/InviteButton.native.js
  28. 3
    27
      react/features/invite/functions.js
  29. 0
    232
      react/features/invite/middleware.native.js
  30. 2
    5
      react/features/invite/reducer.js

+ 0
- 117
android/app/src/main/java/org/jitsi/meet/MainActivity.java 파일 보기

24
 import org.jitsi.meet.sdk.JitsiMeetActivity;
24
 import org.jitsi.meet.sdk.JitsiMeetActivity;
25
 import org.jitsi.meet.sdk.JitsiMeetView;
25
 import org.jitsi.meet.sdk.JitsiMeetView;
26
 import org.jitsi.meet.sdk.JitsiMeetViewListener;
26
 import org.jitsi.meet.sdk.JitsiMeetViewListener;
27
-import org.jitsi.meet.sdk.invite.AddPeopleController;
28
-import org.jitsi.meet.sdk.invite.AddPeopleControllerListener;
29
-import org.jitsi.meet.sdk.invite.InviteController;
30
-import org.jitsi.meet.sdk.invite.InviteControllerListener;
31
 
27
 
32
 import com.crashlytics.android.Crashlytics;
28
 import com.crashlytics.android.Crashlytics;
33
 import com.facebook.react.bridge.UiThreadUtil;
29
 import com.facebook.react.bridge.UiThreadUtil;
36
 
32
 
37
 import java.net.MalformedURLException;
33
 import java.net.MalformedURLException;
38
 import java.net.URL;
34
 import java.net.URL;
39
-import java.util.ArrayList;
40
-import java.util.List;
41
 import java.util.Map;
35
 import java.util.Map;
42
 
36
 
43
 /**
37
 /**
53
  * {@code react-native run-android}.
47
  * {@code react-native run-android}.
54
  */
48
  */
55
 public class MainActivity extends JitsiMeetActivity {
49
 public class MainActivity extends JitsiMeetActivity {
56
-    /**
57
-     * The query to perform through {@link AddPeopleController} when the
58
-     * {@code InviteButton} is tapped in order to exercise the public API of the
59
-     * feature invite. If {@code null}, the {@code InviteButton} will not be
60
-     * rendered.
61
-     */
62
-    private static final String ADD_PEOPLE_CONTROLLER_QUERY = null;
63
 
50
 
64
     @Override
51
     @Override
65
     protected JitsiMeetView initializeView() {
52
     protected JitsiMeetView initializeView() {
113
                 }
100
                 }
114
             });
101
             });
115
 
102
 
116
-            // inviteController
117
-            final InviteController inviteController
118
-                = view.getInviteController();
119
-
120
-            inviteController.setListener(new InviteControllerListener() {
121
-                public void beginAddPeople(
122
-                        AddPeopleController addPeopleController) {
123
-                    onInviteControllerBeginAddPeople(
124
-                        inviteController,
125
-                        addPeopleController);
126
-                }
127
-            });
128
-            inviteController.setAddPeopleEnabled(
129
-                ADD_PEOPLE_CONTROLLER_QUERY != null);
130
-            inviteController.setDialOutEnabled(
131
-                inviteController.isAddPeopleEnabled());
132
         }
103
         }
133
 
104
 
134
         return view;
105
         return view;
135
     }
106
     }
136
 
107
 
137
-    private void onAddPeopleControllerInviteSettled(
138
-            AddPeopleController addPeopleController,
139
-            List<Map<String, Object>> failedInvitees) {
140
-        UiThreadUtil.assertOnUiThread();
141
-
142
-        // XXX Explicitly invoke endAddPeople on addPeopleController; otherwise,
143
-        // it is going to be memory-leaked in the associated InviteController
144
-        // and no subsequent InviteButton clicks/taps will be delivered.
145
-        // Technically, endAddPeople will automatically be invoked if there are
146
-        // no failedInviteees i.e. the invite succeeeded for all specified
147
-        // invitees.
148
-        addPeopleController.endAddPeople();
149
-    }
150
-
151
-    private void onAddPeopleControllerReceivedResults(
152
-            AddPeopleController addPeopleController,
153
-            List<Map<String, Object>> results,
154
-            String query) {
155
-        UiThreadUtil.assertOnUiThread();
156
-
157
-        int size = results.size();
158
-
159
-        if (size > 0) {
160
-            // Exercise AddPeopleController's inviteById implementation.
161
-            List<String> ids = new ArrayList<>(size);
162
-
163
-            for (Map<String, Object> result : results) {
164
-                Object id = result.get("id");
165
-
166
-                if (id != null) {
167
-                    ids.add(id.toString());
168
-                }
169
-            }
170
-
171
-            addPeopleController.inviteById(ids);
172
-
173
-            return;
174
-        }
175
-
176
-        // XXX Explicitly invoke endAddPeople on addPeopleController; otherwise,
177
-        // it is going to be memory-leaked in the associated InviteController
178
-        // and no subsequent InviteButton clicks/taps will be delivered.
179
-        addPeopleController.endAddPeople();
180
-    }
181
-
182
     @Override
108
     @Override
183
     protected void onCreate(Bundle savedInstanceState) {
109
     protected void onCreate(Bundle savedInstanceState) {
184
         // As this is the Jitsi Meet app (i.e. not the Jitsi Meet SDK), we do
110
         // As this is the Jitsi Meet app (i.e. not the Jitsi Meet SDK), we do
213
         }
139
         }
214
     }
140
     }
215
 
141
 
216
-    private void onInviteControllerBeginAddPeople(
217
-            InviteController inviteController,
218
-            AddPeopleController addPeopleController) {
219
-        UiThreadUtil.assertOnUiThread();
220
-
221
-        // Log with the tag "ReactNative" in order to have the log visible in
222
-        // react-native log-android as well.
223
-        Log.d(
224
-            "ReactNative",
225
-            InviteControllerListener.class.getSimpleName() + ".beginAddPeople");
226
-
227
-        String query = ADD_PEOPLE_CONTROLLER_QUERY;
228
-    
229
-        if (query != null
230
-                && (inviteController.isAddPeopleEnabled()
231
-                    || inviteController.isDialOutEnabled())) {
232
-            addPeopleController.setListener(new AddPeopleControllerListener() {
233
-                public void onInviteSettled(
234
-                        AddPeopleController addPeopleController,
235
-                        List<Map<String, Object>> failedInvitees) {
236
-                    onAddPeopleControllerInviteSettled(
237
-                        addPeopleController,
238
-                        failedInvitees);
239
-                }
240
-
241
-                public void onReceivedResults(
242
-                        AddPeopleController addPeopleController,
243
-                        List<Map<String, Object>> results,
244
-                        String query) {
245
-                    onAddPeopleControllerReceivedResults(
246
-                        addPeopleController,
247
-                        results, query);
248
-                }
249
-            });
250
-            addPeopleController.performQuery(query);
251
-        } else {
252
-            // XXX Explicitly invoke endAddPeople on addPeopleController;
253
-            // otherwise, it is going to be memory-leaked in the associated
254
-            // InviteController and no subsequent InviteButton clicks/taps will
255
-            // be delivered.
256
-            addPeopleController.endAddPeople();
257
-        }
258
-    }
259
 }
142
 }

+ 0
- 37
android/sdk/src/main/java/org/jitsi/meet/sdk/JitsiMeetView.java 파일 보기

24
 
24
 
25
 import com.facebook.react.bridge.ReadableMap;
25
 import com.facebook.react.bridge.ReadableMap;
26
 
26
 
27
-import org.jitsi.meet.sdk.invite.InviteController;
28
-
29
 import java.lang.reflect.Method;
27
 import java.lang.reflect.Method;
30
 import java.net.URL;
28
 import java.net.URL;
31
 import java.util.Map;
29
 import java.util.Map;
78
      */
76
      */
79
     private URL defaultURL;
77
     private URL defaultURL;
80
 
78
 
81
-    /**
82
-     * The entry point into the invite feature of Jitsi Meet. The Java
83
-     * counterpart of the JavaScript {@code InviteButton}.
84
-     */
85
-    private final InviteController inviteController;
86
-
87
     /**
79
     /**
88
      * Whether Picture-in-Picture is enabled. If {@code null}, defaults to
80
      * Whether Picture-in-Picture is enabled. If {@code null}, defaults to
89
      * {@code true} iff the Android platform supports Picture-in-Picture
81
      * {@code true} iff the Android platform supports Picture-in-Picture
106
     public JitsiMeetView(@NonNull Context context) {
98
     public JitsiMeetView(@NonNull Context context) {
107
         super(context);
99
         super(context);
108
 
100
 
109
-        // The entry point into the invite feature of Jitsi Meet. The Java
110
-        // counterpart of the JavaScript InviteButton.
111
-        inviteController = new InviteController(externalAPIScope);
112
-
113
         // Check if the parent Activity implements JitsiMeetActivityInterface,
101
         // Check if the parent Activity implements JitsiMeetActivityInterface,
114
         // otherwise things may go wrong.
102
         // otherwise things may go wrong.
115
         if (!(context instanceof JitsiMeetActivityInterface)) {
103
         if (!(context instanceof JitsiMeetActivityInterface)) {
155
         return defaultURL;
143
         return defaultURL;
156
     }
144
     }
157
 
145
 
158
-    /**
159
-     * Gets the {@link InviteController} which represents the entry point into
160
-     * the invite feature of Jitsi Meet and is the Java counterpart of the
161
-     * JavaScript {@code InviteButton}.
162
-     *
163
-     * @return the {@link InviteController} which represents the entry point
164
-     * into the invite feature of Jitsi Meet and is the Java counterpart of the
165
-     * JavaScript {@code InviteButton}
166
-     */
167
-    public InviteController getInviteController() {
168
-        return inviteController;
169
-    }
170
-
171
     /**
146
     /**
172
      * Gets the URL of the current conference.
147
      * Gets the URL of the current conference.
173
      *
148
      *
238
             props.putString("defaultURL", defaultURL.toString());
213
             props.putString("defaultURL", defaultURL.toString());
239
         }
214
         }
240
 
215
 
241
-        // inviteController
242
-        InviteController inviteController = getInviteController();
243
-
244
-        if (inviteController != null) {
245
-            props.putBoolean(
246
-                "addPeopleEnabled",
247
-                inviteController.isAddPeopleEnabled());
248
-            props.putBoolean(
249
-                "dialOutEnabled",
250
-                inviteController.isDialOutEnabled());
251
-        }
252
-
253
         // pictureInPictureEnabled
216
         // pictureInPictureEnabled
254
         props.putBoolean(
217
         props.putBoolean(
255
             "pictureInPictureEnabled",
218
             "pictureInPictureEnabled",

+ 0
- 1
android/sdk/src/main/java/org/jitsi/meet/sdk/ReactInstanceManagerHolder.java 파일 보기

54
                 new ProximityModule(reactContext),
54
                 new ProximityModule(reactContext),
55
                 new WiFiStatsModule(reactContext),
55
                 new WiFiStatsModule(reactContext),
56
                 new org.jitsi.meet.sdk.dropbox.Dropbox(reactContext),
56
                 new org.jitsi.meet.sdk.dropbox.Dropbox(reactContext),
57
-                new org.jitsi.meet.sdk.invite.InviteModule(reactContext),
58
                 new org.jitsi.meet.sdk.net.NAT64AddrInfoModule(reactContext)));
57
                 new org.jitsi.meet.sdk.net.NAT64AddrInfoModule(reactContext)));
59
 
58
 
60
         if (android.os.Build.VERSION.SDK_INT
59
         if (android.os.Build.VERSION.SDK_INT

+ 0
- 211
android/sdk/src/main/java/org/jitsi/meet/sdk/invite/AddPeopleController.java 파일 보기

1
-/*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-package org.jitsi.meet.sdk.invite;
18
-
19
-import android.util.Log;
20
-
21
-import com.facebook.react.bridge.ReactApplicationContext;
22
-import com.facebook.react.bridge.ReadableArray;
23
-import com.facebook.react.bridge.ReadableMap;
24
-import com.facebook.react.bridge.WritableArray;
25
-import com.facebook.react.bridge.WritableNativeArray;
26
-import com.facebook.react.bridge.WritableNativeMap;
27
-
28
-import java.lang.ref.WeakReference;
29
-import java.util.ArrayList;
30
-import java.util.HashMap;
31
-import java.util.List;
32
-import java.util.Map;
33
-import java.util.UUID;
34
-
35
-/**
36
- * Controller object used by native code to query and submit user selections for
37
- * the user invitation flow.
38
- */
39
-public class AddPeopleController {
40
-
41
-    /**
42
-     * The AddPeopleControllerListener for this controller, used to pass query
43
-     * results back to the native code that initiated the query.
44
-     */
45
-    private AddPeopleControllerListener listener;
46
-
47
-    /**
48
-     * Local cache of search query results. Used to re-hydrate the list of
49
-     * selected items based on their ids passed to inviteById in order to pass
50
-     * the full item maps back to the JitsiMeetView during submission.
51
-     */
52
-    private final Map<String, ReadableMap> items = new HashMap<>();
53
-
54
-    private final WeakReference<InviteController> owner;
55
-
56
-    private final WeakReference<ReactApplicationContext> reactContext;
57
-
58
-    /**
59
-     * Randomly generated UUID, used for identification in the InviteModule.
60
-     */
61
-    private final String uuid = UUID.randomUUID().toString();
62
-
63
-    public AddPeopleController(
64
-            InviteController owner,
65
-            ReactApplicationContext reactContext) {
66
-        this.owner = new WeakReference<>(owner);
67
-        this.reactContext = new WeakReference<>(reactContext);
68
-    }
69
-
70
-    /**
71
-     * Cancel the invitation flow and free memory allocated to the
72
-     * AddPeopleController. After calling this method, this object is invalid -
73
-     * a new AddPeopleController will be passed to the caller through
74
-     * beginAddPeople.
75
-     */
76
-    public void endAddPeople() {
77
-        InviteController owner = this.owner.get();
78
-
79
-        if (owner != null) {
80
-            owner.endAddPeople(this);
81
-        }
82
-    }
83
-
84
-    /**
85
-     *
86
-     * @return the AddPeopleControllerListener for this controller, used to pass
87
-     * query results back to the native code that initiated the query.
88
-     */
89
-    public AddPeopleControllerListener getListener() {
90
-        return listener;
91
-    }
92
-
93
-    final ReactApplicationContext getReactApplicationContext() {
94
-        return reactContext.get();
95
-    }
96
-
97
-    /**
98
-     *
99
-     * @return the unique identifier for this AddPeopleController
100
-     */
101
-    public String getUuid() {
102
-        return uuid;
103
-    }
104
-
105
-    /**
106
-     * Send invites to selected users based on their item ids
107
-     *
108
-     * @param ids
109
-     */
110
-    public void inviteById(List<String> ids) {
111
-        InviteController owner = this.owner.get();
112
-
113
-        if (owner != null) {
114
-            WritableArray invitees = new WritableNativeArray();
115
-
116
-            for(int i = 0, size = ids.size(); i < size; i++) {
117
-                String id = ids.get(i);
118
-
119
-                if(items.containsKey(id)) {
120
-                    WritableNativeMap map = new WritableNativeMap();
121
-                    map.merge(items.get(id));
122
-                    invitees.pushMap(map);
123
-                } else {
124
-                    // If the id doesn't exist in the map, we can't do anything,
125
-                    // so just skip it.
126
-                }
127
-            }
128
-
129
-            owner.invite(this, invitees);
130
-        }
131
-    }
132
-
133
-    void inviteSettled(ReadableArray failedInvitees) {
134
-        AddPeopleControllerListener listener = getListener();
135
-
136
-        if (listener != null) {
137
-            ArrayList<Map<String, Object>> jFailedInvitees = new ArrayList<>();
138
-
139
-            for (int i = 0, size = failedInvitees.size(); i < size; ++i) {
140
-                jFailedInvitees.add(failedInvitees.getMap(i).toHashMap());
141
-            }
142
-
143
-            listener.onInviteSettled(this, jFailedInvitees);
144
-        }
145
-    }
146
-
147
-    /**
148
-     * Start a search for entities to invite with the given query. Results will
149
-     * be returned through the associated AddPeopleControllerListener's
150
-     * onReceivedResults method.
151
-     *
152
-     * @param query
153
-     */
154
-    public void performQuery(String query) {
155
-        InviteController owner = this.owner.get();
156
-
157
-        if (owner != null) {
158
-            owner.performQuery(this, query);
159
-        }
160
-    }
161
-
162
-    /**
163
-     * Caches results received by the search into a local map for use later when
164
-     * the items are submitted.  Submission requires the full map of
165
-     * information, but only the IDs are returned back to the delegate. Using
166
-     * this map means we don't have to send the whole map back to the delegate.
167
-     *
168
-     * @param results
169
-     * @param query
170
-     */
171
-    void receivedResultsForQuery(ReadableArray results, String query) {
172
-        AddPeopleControllerListener listener = getListener();
173
-
174
-        if (listener != null) {
175
-            List<Map<String, Object>> jvmResults = new ArrayList<>();
176
-
177
-            // cache results for use in submission later
178
-            // convert to jvm array
179
-            for(int i = 0; i < results.size(); i++) {
180
-                ReadableMap map = results.getMap(i);
181
-
182
-                if(map.hasKey("id")) {
183
-                    items.put(map.getString("id"), map);
184
-                } else if(map.hasKey("type")
185
-                        && map.getString("type").equals("phone")
186
-                        && map.hasKey("number")) {
187
-                    items.put(map.getString("number"), map);
188
-                } else {
189
-                    Log.w(
190
-                        "AddPeopleController",
191
-                        "Received result without id and that was not a phone number, so not adding it to suggestions: "
192
-                            + map);
193
-                }
194
-
195
-                jvmResults.add(map.toHashMap());
196
-            }
197
-
198
-            listener.onReceivedResults(this, jvmResults, query);
199
-        }
200
-    }
201
-
202
-    /**
203
-     * Sets the AddPeopleControllerListener for this controller, used to pass
204
-     * query results back to the native code that initiated the query.
205
-     *
206
-     * @param listener
207
-     */
208
-    public void setListener(AddPeopleControllerListener listener) {
209
-        this.listener = listener;
210
-    }
211
-}

+ 0
- 56
android/sdk/src/main/java/org/jitsi/meet/sdk/invite/AddPeopleControllerListener.java 파일 보기

1
-/*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-package org.jitsi.meet.sdk.invite;
18
-
19
-import java.util.List;
20
-import java.util.Map;
21
-
22
-public interface AddPeopleControllerListener {
23
-    /**
24
-     * Called when the call to {@link AddPeopleController#inviteById(List)}
25
-     * completes.
26
-     *
27
-     * @param addPeopleController the active {@link AddPeopleController} for
28
-     * this invite flow.  This object should be cleaned up by calling
29
-     * {@link AddPeopleController#endAddPeople()} if the user exits the invite
30
-     * flow. Otherwise, it can stay active if the user will attempt to invite
31
-     * @param failedInvitees a {@code List} of {@code Map<String, Object>}
32
-     * dictionaries that represent the invitations that failed. The data type of
33
-     * the objects is identical to the results returned in onReceivedResuls.
34
-     */
35
-    void onInviteSettled(
36
-        AddPeopleController addPeopleController,
37
-        List<Map<String, Object>> failedInvitees);
38
-
39
-    /**
40
-     * Called when results are received for a query called through
41
-     * AddPeopleController.query().
42
-     *
43
-     * @param addPeopleController
44
-     * @param results a List of Map<String, Object> objects that represent items
45
-     * returned by the query. The object at key "type" describes the type of
46
-     * item: "user", "videosipgw" (conference room), or "phone". "user" types
47
-     * have properties at "id", "name", and "avatar". "videosipgw" types have
48
-     * properties at "id" and "name". "phone" types have properties at "number",
49
-     * "title", "and "subtitle"
50
-     * @param query the query that generated the given results
51
-     */
52
-    void onReceivedResults(
53
-        AddPeopleController addPeopleController,
54
-        List<Map<String, Object>> results,
55
-        String query);
56
-}

+ 0
- 265
android/sdk/src/main/java/org/jitsi/meet/sdk/invite/InviteController.java 파일 보기

1
-/*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-package org.jitsi.meet.sdk.invite;
18
-
19
-import com.facebook.react.bridge.Arguments;
20
-import com.facebook.react.bridge.ReactApplicationContext;
21
-import com.facebook.react.bridge.ReactContext;
22
-import com.facebook.react.bridge.ReadableArray;
23
-import com.facebook.react.bridge.WritableArray;
24
-import com.facebook.react.bridge.WritableNativeMap;
25
-
26
-import org.jitsi.meet.sdk.ReactContextUtils;
27
-
28
-import java.util.Collections;
29
-import java.util.HashMap;
30
-import java.util.List;
31
-import java.util.Map;
32
-import java.util.UUID;
33
-import java.util.concurrent.Callable;
34
-import java.util.concurrent.Future;
35
-import java.util.concurrent.FutureTask;
36
-
37
-/**
38
- * Represents the entry point into the invite feature of Jitsi Meet and is the
39
- * Java counterpart of the JavaScript {@code InviteButton}.
40
- */
41
-public class InviteController {
42
-    private AddPeopleController addPeopleController;
43
-
44
-    /**
45
-     * Whether adding/inviting people by name (as opposed to phone number) is
46
-     * enabled.
47
-     */
48
-    private Boolean addPeopleEnabled;
49
-
50
-    /**
51
-     * Whether adding/inviting people by phone number (as opposed to name) is
52
-     * enabled.
53
-     */
54
-    private Boolean dialOutEnabled;
55
-
56
-    private final String externalAPIScope;
57
-
58
-    private InviteControllerListener listener;
59
-
60
-    public InviteController(String externalAPIScope) {
61
-        this.externalAPIScope = externalAPIScope;
62
-    }
63
-
64
-    void beginAddPeople(ReactApplicationContext reactContext) {
65
-        InviteControllerListener listener = getListener();
66
-
67
-        if (listener != null) {
68
-            // XXX For the sake of simplicity and in order to reduce the risk of
69
-            // memory leaks, allow a single AddPeopleController at a time.
70
-            AddPeopleController addPeopleController = this.addPeopleController;
71
-
72
-            if (addPeopleController != null) {
73
-                return;
74
-            }
75
-
76
-            // Initialize a new AddPeopleController to represent the click/tap
77
-            // on the InviteButton and notify the InviteControllerListener
78
-            // about the event.
79
-            addPeopleController = new AddPeopleController(this, reactContext);
80
-
81
-            boolean success = false;
82
-
83
-            this.addPeopleController = addPeopleController;
84
-            try {
85
-                listener.beginAddPeople(addPeopleController);
86
-                success = true;
87
-            } finally {
88
-                if (!success) {
89
-                    endAddPeople(addPeopleController);
90
-                }
91
-            }
92
-        }
93
-    }
94
-
95
-    void endAddPeople(AddPeopleController addPeopleController) {
96
-        if (this.addPeopleController == addPeopleController) {
97
-            this.addPeopleController = null;
98
-        }
99
-    }
100
-
101
-    public InviteControllerListener getListener() {
102
-        return listener;
103
-    }
104
-
105
-    /**
106
-     * Sends JavaScript event to submit invitations to the given item ids
107
-     *
108
-     * @param invitees a WritableArray of WritableNativeMaps representing
109
-     * selected items. Each map representing a selected item should match the
110
-     * data passed back in the return from a query.
111
-     */
112
-    boolean invite(
113
-            AddPeopleController addPeopleController,
114
-            WritableArray invitees) {
115
-        return
116
-            invite(
117
-                addPeopleController.getUuid(),
118
-                addPeopleController.getReactApplicationContext(),
119
-                invitees);
120
-    }
121
-
122
-    public Future<List<Map<String, Object>>> invite(
123
-            final List<Map<String, Object>> invitees) {
124
-        final boolean inviteBegan
125
-            = invite(
126
-                UUID.randomUUID().toString(),
127
-                /* reactContext */ null,
128
-                Arguments.makeNativeArray(invitees));
129
-        FutureTask futureTask
130
-            = new FutureTask(new Callable() {
131
-                @Override
132
-                public List<Map<String, Object>> call() {
133
-                    if (inviteBegan) {
134
-                        // TODO Complete the returned Future when the invite
135
-                        // settles.
136
-                        return Collections.emptyList();
137
-                    } else {
138
-                        // The invite failed to even begin so report that all
139
-                        // invitees failed.
140
-                        return invitees;
141
-                    }
142
-                }
143
-            });
144
-
145
-        // If the invite failed to even begin, complete the returned Future
146
-        // already and the Future implementation will report that all invitees
147
-        // failed.
148
-        if (!inviteBegan) {
149
-            futureTask.run();
150
-        }
151
-
152
-        return futureTask;
153
-    }
154
-
155
-    private boolean invite(
156
-            String addPeopleControllerScope,
157
-            ReactContext reactContext,
158
-            WritableArray invitees) {
159
-        WritableNativeMap data = new WritableNativeMap();
160
-
161
-        data.putString("addPeopleControllerScope", addPeopleControllerScope);
162
-        data.putString("externalAPIScope", externalAPIScope);
163
-        data.putArray("invitees", invitees);
164
-
165
-        return
166
-            ReactContextUtils.emitEvent(
167
-                reactContext,
168
-                "org.jitsi.meet:features/invite#invite",
169
-                data);
170
-    }
171
-
172
-    void inviteSettled(
173
-            String addPeopleControllerScope,
174
-            ReadableArray failedInvitees) {
175
-        AddPeopleController addPeopleController = this.addPeopleController;
176
-
177
-        if (addPeopleController != null
178
-                && addPeopleController.getUuid().equals(
179
-                    addPeopleControllerScope)) {
180
-            try {
181
-                addPeopleController.inviteSettled(failedInvitees);
182
-            } finally {
183
-                if (failedInvitees.size() == 0) {
184
-                    endAddPeople(addPeopleController);
185
-                }
186
-            }
187
-        }
188
-    }
189
-
190
-    public boolean isAddPeopleEnabled() {
191
-        Boolean b = this.addPeopleEnabled;
192
-
193
-        return
194
-            (b == null || b.booleanValue()) ? (getListener() != null) : false;
195
-    }
196
-
197
-    public boolean isDialOutEnabled() {
198
-        Boolean b = this.dialOutEnabled;
199
-
200
-        return
201
-            (b == null || b.booleanValue()) ? (getListener() != null) : false;
202
-    }
203
-
204
-    /**
205
-     * Starts a query for users to invite to the conference. Results will be
206
-     * returned through
207
-     * {@link AddPeopleControllerListener#onReceivedResults(AddPeopleController, List, String)}.
208
-     *
209
-     * @param query {@code String} to use for the query
210
-     */
211
-    void performQuery(AddPeopleController addPeopleController, String query) {
212
-        WritableNativeMap params = new WritableNativeMap();
213
-
214
-        params.putString("addPeopleControllerScope", addPeopleController.getUuid());
215
-        params.putString("externalAPIScope", externalAPIScope);
216
-        params.putString("query", query);
217
-        ReactContextUtils.emitEvent(
218
-            addPeopleController.getReactApplicationContext(),
219
-            "org.jitsi.meet:features/invite#performQuery",
220
-            params);
221
-    }
222
-
223
-    void receivedResultsForQuery(
224
-            String addPeopleControllerScope,
225
-            String query,
226
-            ReadableArray results) {
227
-        AddPeopleController addPeopleController = this.addPeopleController;
228
-
229
-        if (addPeopleController != null
230
-                && addPeopleController.getUuid().equals(
231
-                    addPeopleControllerScope)) {
232
-            addPeopleController.receivedResultsForQuery(results, query);
233
-        }
234
-    }
235
-
236
-    /**
237
-     * Sets whether the ability to add users to the call is enabled. If this is
238
-     * enabled, an add user button will appear on the {@link JitsiMeetView}. If
239
-     * enabled, and the user taps the add user button,
240
-     * {@link InviteControllerListener#beginAddPeople(AddPeopleController)}
241
-     * will be called.
242
-     *
243
-     * @param addPeopleEnabled {@code true} to enable the add people button;
244
-     * otherwise, {@code false}
245
-     */
246
-    public void setAddPeopleEnabled(boolean addPeopleEnabled) {
247
-        this.addPeopleEnabled = Boolean.valueOf(addPeopleEnabled);
248
-    }
249
-
250
-    /**
251
-     * Sets whether the ability to add phone numbers to the call is enabled.
252
-     * Must be enabled along with {@link #setAddPeopleEnabled(boolean)} to be
253
-     * effective.
254
-     *
255
-     * @param dialOutEnabled {@code true} to enable the ability to add phone
256
-     * numbers to the call; otherwise, {@code false}
257
-     */
258
-    public void setDialOutEnabled(boolean dialOutEnabled) {
259
-        this.dialOutEnabled = Boolean.valueOf(dialOutEnabled);
260
-    }
261
-
262
-    public void setListener(InviteControllerListener listener) {
263
-        this.listener = listener;
264
-    }
265
-}

+ 0
- 29
android/sdk/src/main/java/org/jitsi/meet/sdk/invite/InviteControllerListener.java 파일 보기

1
-/*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-package org.jitsi.meet.sdk.invite;
18
-
19
-public interface InviteControllerListener {
20
-    /**
21
-     * Called when the add user button is tapped.
22
-     *
23
-     * @param addPeopleController {@code AddPeopleController} scoped for this
24
-     * user invite flow. The {@code AddPeopleController} is used to start user
25
-     * queries and accepts an {@code AddPeopleControllerListener} for receiving
26
-     * user query responses.
27
-     */
28
-    void beginAddPeople(AddPeopleController addPeopleController);
29
-}

+ 0
- 171
android/sdk/src/main/java/org/jitsi/meet/sdk/invite/InviteModule.java 파일 보기

1
-/*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-package org.jitsi.meet.sdk.invite;
18
-
19
-import android.util.Log;
20
-
21
-import com.facebook.react.bridge.ReactApplicationContext;
22
-import com.facebook.react.bridge.ReactContextBaseJavaModule;
23
-import com.facebook.react.bridge.ReactMethod;
24
-import com.facebook.react.bridge.ReadableArray;
25
-import com.facebook.react.bridge.UiThreadUtil;
26
-
27
-import org.jitsi.meet.sdk.BaseReactView;
28
-import org.jitsi.meet.sdk.JitsiMeetView;
29
-
30
-/**
31
- * Implements the react-native module of the feature invite.
32
- */
33
-public class InviteModule
34
-    extends ReactContextBaseJavaModule {
35
-
36
-    public InviteModule(ReactApplicationContext reactContext) {
37
-        super(reactContext);
38
-    }
39
-
40
-    /**
41
-     * Signals that a click/tap has been performed on {@code InviteButton} and
42
-     * that the execution flow for adding/inviting people to the current
43
-     * conference/meeting is to begin
44
-     *
45
-     * @param externalAPIScope the unique identifier of the
46
-     * {@code JitsiMeetView} whose {@code InviteButton} was clicked/tapped.
47
-     */
48
-    @ReactMethod
49
-    public void beginAddPeople(final String externalAPIScope) {
50
-        // Make sure InviteControllerListener (like all other listeners of the
51
-        // SDK) is invoked on the UI thread. It was requested by SDK consumers.
52
-        if (!UiThreadUtil.isOnUiThread()) {
53
-            UiThreadUtil.runOnUiThread(new Runnable() {
54
-                @Override
55
-                public void run() {
56
-                    beginAddPeople(externalAPIScope);
57
-                }
58
-            });
59
-            return;
60
-        }
61
-
62
-        InviteController inviteController
63
-            = findInviteControllerByExternalAPIScope(externalAPIScope);
64
-
65
-        if (inviteController != null) {
66
-            inviteController.beginAddPeople(getReactApplicationContext());
67
-        }
68
-    }
69
-
70
-    private InviteController findInviteControllerByExternalAPIScope(
71
-            String externalAPIScope) {
72
-        JitsiMeetView view
73
-            = (JitsiMeetView)
74
-                BaseReactView.findViewByExternalAPIScope(externalAPIScope);
75
-
76
-        return view == null ? null : view.getInviteController();
77
-    }
78
-
79
-    @Override
80
-    public String getName() {
81
-        return "Invite";
82
-    }
83
-
84
-    /**
85
-     * Callback for invitation failures
86
-     *
87
-     * @param failedInvitees the items for which the invitation failed
88
-     * @param addPeopleControllerScope a string that represents a connection to
89
-     * a specific AddPeopleController
90
-     */
91
-    @ReactMethod
92
-    public void inviteSettled(
93
-            final String externalAPIScope,
94
-            final String addPeopleControllerScope,
95
-            final ReadableArray failedInvitees) {
96
-        // Make sure AddPeopleControllerListener (like all other listeners of
97
-        // the SDK) is invoked on the UI thread. It was requested by SDK
98
-        // consumers.
99
-        if (!UiThreadUtil.isOnUiThread()) {
100
-            UiThreadUtil.runOnUiThread(new Runnable() {
101
-                @Override
102
-                public void run() {
103
-                    inviteSettled(
104
-                        externalAPIScope, 
105
-                        addPeopleControllerScope,
106
-                        failedInvitees);
107
-                }
108
-            });
109
-            return;
110
-        }
111
-
112
-        InviteController inviteController
113
-            = findInviteControllerByExternalAPIScope(externalAPIScope);
114
-
115
-        if (inviteController == null) {
116
-            Log.w(
117
-                "InviteModule",
118
-                "Invite settled, but failed to find active controller to notify");
119
-        } else {
120
-            inviteController.inviteSettled(
121
-                addPeopleControllerScope,
122
-                failedInvitees);
123
-        }
124
-    }
125
-
126
-    /**
127
-     * Callback for results received from the JavaScript invite search call
128
-     *
129
-     * @param results the results in a ReadableArray of ReadableMap objects
130
-     * @param query the query associated with the search
131
-     * @param addPeopleControllerScope a string that represents a connection to
132
-     * a specific AddPeopleController
133
-     */
134
-    @ReactMethod
135
-    public void receivedResults(
136
-            final String externalAPIScope,
137
-            final String addPeopleControllerScope,
138
-            final String query,
139
-            final ReadableArray results) {
140
-        // Make sure AddPeopleControllerListener (like all other listeners of
141
-        // the SDK) is invoked on the UI thread. It was requested by SDK
142
-        // consumers.
143
-        if (!UiThreadUtil.isOnUiThread()) {
144
-            UiThreadUtil.runOnUiThread(new Runnable() {
145
-                @Override
146
-                public void run() {
147
-                    receivedResults(
148
-                        externalAPIScope,
149
-                        addPeopleControllerScope,
150
-                        query,
151
-                        results);
152
-                }
153
-            });
154
-            return;
155
-        }
156
-
157
-        InviteController inviteController
158
-            = findInviteControllerByExternalAPIScope(externalAPIScope);
159
-
160
-        if (inviteController == null) {
161
-            Log.w(
162
-                "InviteModule",
163
-                "Received results, but failed to find active controller to send results back");
164
-        } else {
165
-            inviteController.receivedResultsForQuery(
166
-                addPeopleControllerScope,
167
-                query,
168
-                results);
169
-        }
170
-    }
171
-}

+ 1
- 5
ios/app/src/ViewController.h 파일 보기

18
 
18
 
19
 #import <JitsiMeet/JitsiMeet.h>
19
 #import <JitsiMeet/JitsiMeet.h>
20
 
20
 
21
-@interface ViewController
22
-    : UIViewController<
23
-        JitsiMeetViewDelegate,
24
-        JMAddPeopleControllerDelegate,
25
-        JMInviteControllerDelegate>
21
+@interface ViewController : UIViewController<JitsiMeetViewDelegate>
26
 
22
 
27
 @end
23
 @end

+ 0
- 103
ios/app/src/ViewController.m 파일 보기

24
 // Needed for NSUserActivity suggestedInvocationPhrase
24
 // Needed for NSUserActivity suggestedInvocationPhrase
25
 @import Intents;
25
 @import Intents;
26
 
26
 
27
-/**
28
- * The query to perform through JMAddPeopleController when the InviteButton is
29
- * tapped in order to exercise the public API of the feature invite. If nil, the
30
- * InviteButton will not be rendered.
31
- */
32
-static NSString * const ADD_PEOPLE_CONTROLLER_QUERY = nil;
33
 
27
 
34
 @interface ViewController ()
28
 @interface ViewController ()
35
-
36
 @end
29
 @end
37
 
30
 
38
 @implementation ViewController
31
 @implementation ViewController
43
     JitsiMeetView *view = (JitsiMeetView *) self.view;
36
     JitsiMeetView *view = (JitsiMeetView *) self.view;
44
     view.delegate = self;
37
     view.delegate = self;
45
 
38
 
46
-#ifdef DEBUG
47
-
48
-    // inviteController
49
-    JMInviteController *inviteController = view.inviteController;
50
-    inviteController.delegate = self;
51
-    inviteController.addPeopleEnabled
52
-        = inviteController.dialOutEnabled
53
-        = ADD_PEOPLE_CONTROLLER_QUERY != nil;
54
-
55
-#endif // #ifdef DEBUG
56
-
57
     // As this is the Jitsi Meet app (i.e. not the Jitsi Meet SDK), we do want
39
     // As this is the Jitsi Meet app (i.e. not the Jitsi Meet SDK), we do want
58
     // the Welcome page to be enabled. It defaults to disabled in the SDK at the
40
     // the Welcome page to be enabled. It defaults to disabled in the SDK at the
59
     // time of this writing but it is clearer to be explicit about what we want
41
     // time of this writing but it is clearer to be explicit about what we want
135
     [self _onJitsiMeetViewDelegateEvent:@"LOAD_CONFIG_ERROR" withData:data];
117
     [self _onJitsiMeetViewDelegateEvent:@"LOAD_CONFIG_ERROR" withData:data];
136
 }
118
 }
137
 
119
 
138
-#if DEBUG
139
-
140
-// JMInviteControllerDelegate
141
-
142
-- (void)beginAddPeople:(JMAddPeopleController *)addPeopleController {
143
-    NSLog(
144
-        @"[%s:%d] JMInviteControllerDelegate %s",
145
-        __FILE__, __LINE__, __FUNCTION__);
146
-
147
-    NSAssert(
148
-        [NSThread isMainThread],
149
-        @"JMInviteControllerDelegate beginAddPeople: invoked on a non-main thread");
150
-
151
-    NSString *query = ADD_PEOPLE_CONTROLLER_QUERY;
152
-    JitsiMeetView *view = (JitsiMeetView *) self.view;
153
-    JMInviteController *inviteController = view.inviteController;
154
-
155
-    if (query
156
-            && (inviteController.addPeopleEnabled
157
-                || inviteController.dialOutEnabled)) {
158
-        addPeopleController.delegate = self;
159
-        [addPeopleController performQuery:query];
160
-    } else {
161
-        // XXX Explicitly invoke endAddPeople on addPeopleController; otherwise,
162
-        // it is going to be memory-leaked in the associated JMInviteController
163
-        // and no subsequent InviteButton clicks/taps will be delivered.
164
-        [addPeopleController endAddPeople];
165
-    }
166
-}
167
-
168
-// JMAddPeopleControllerDelegate
169
-
170
-- (void)addPeopleController:(JMAddPeopleController * _Nonnull)controller
171
-          didReceiveResults:(NSArray<NSDictionary *> * _Nonnull)results
172
-                   forQuery:(NSString * _Nonnull)query {
173
-    NSAssert(
174
-        [NSThread isMainThread],
175
-        @"JMAddPeopleControllerDelegate addPeopleController:didReceiveResults:forQuery: invoked on a non-main thread");
176
-
177
-    NSUInteger count = results.count;
178
-
179
-    if (count) {
180
-        // Exercise JMAddPeopleController's inviteById: implementation.
181
-        NSMutableArray *ids = [NSMutableArray arrayWithCapacity:count];
182
-
183
-        for (NSUInteger i = 0; i < count; ++i) {
184
-            ids[i] = results[i][@"id"];
185
-        }
186
-
187
-        [controller inviteById:ids];
188
-
189
-        // Exercise JMInviteController's invite:withCompletion: implementation.
190
-        //
191
-        // XXX Technically, only at most one of the two exercises will result in
192
-        // an actual invitation eventually.
193
-        JitsiMeetView *view = (JitsiMeetView *) self.view;
194
-        JMInviteController *inviteController = view.inviteController;
195
-
196
-        [inviteController invite:results withCompletion:nil];
197
-
198
-        return;
199
-    }
200
-
201
-    // XXX Explicitly invoke endAddPeople on addPeopleController; otherwise, it
202
-    // is going to be memory-leaked in the associated JMInviteController and no
203
-    // subsequent InviteButton clicks/taps will be delivered.
204
-    [controller endAddPeople];
205
-}
206
-
207
-- (void) inviteSettled:(NSArray<NSDictionary *> * _Nonnull)failedInvitees
208
-  fromSearchController:(JMAddPeopleController * _Nonnull)addPeopleController {
209
-    NSAssert(
210
-        [NSThread isMainThread],
211
-        @"JMAddPeopleControllerDelegate inviteSettled:fromSearchController: invoked on a non-main thread");
212
-
213
-    // XXX Explicitly invoke endAddPeople on addPeopleController; otherwise, it
214
-    // is going to be memory-leaked in the associated JMInviteController and no
215
-    // subsequent InviteButton clicks/taps will be delivered. Technically,
216
-    // endAddPeople will automatically be invoked if there are no
217
-    // failedInviteees i.e. the invite succeeeded for all specified invitees.
218
-    [addPeopleController endAddPeople];
219
-}
220
-
221
-#endif // #ifdef DEBUG
222
-
223
 @end
120
 @end

+ 0
- 42
ios/sdk/sdk.xcodeproj/project.pbxproj 파일 보기

35
 		87FE6F3321E52437004A5DC7 /* incomingMessage.wav in Resources */ = {isa = PBXBuildFile; fileRef = 87FE6F3221E52437004A5DC7 /* incomingMessage.wav */; };
35
 		87FE6F3321E52437004A5DC7 /* incomingMessage.wav in Resources */ = {isa = PBXBuildFile; fileRef = 87FE6F3221E52437004A5DC7 /* incomingMessage.wav */; };
36
 		A4414AE020B37F1A003546E6 /* rejected.wav in Resources */ = {isa = PBXBuildFile; fileRef = A4414ADF20B37F1A003546E6 /* rejected.wav */; };
36
 		A4414AE020B37F1A003546E6 /* rejected.wav in Resources */ = {isa = PBXBuildFile; fileRef = A4414ADF20B37F1A003546E6 /* rejected.wav */; };
37
 		A4A934E9212F3ADB001E9388 /* Dropbox.m in Sources */ = {isa = PBXBuildFile; fileRef = A4A934E8212F3ADB001E9388 /* Dropbox.m */; };
37
 		A4A934E9212F3ADB001E9388 /* Dropbox.m in Sources */ = {isa = PBXBuildFile; fileRef = A4A934E8212F3ADB001E9388 /* Dropbox.m */; };
38
-		B386B85720981A75000DEF7A /* InviteController.m in Sources */ = {isa = PBXBuildFile; fileRef = B386B85020981A74000DEF7A /* InviteController.m */; };
39
-		B386B85820981A75000DEF7A /* AddPeopleController.m in Sources */ = {isa = PBXBuildFile; fileRef = B386B85120981A74000DEF7A /* AddPeopleController.m */; };
40
-		B386B85920981A75000DEF7A /* AddPeopleControllerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B386B85220981A74000DEF7A /* AddPeopleControllerDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
41
-		B386B85A20981A75000DEF7A /* AddPeopleController.h in Headers */ = {isa = PBXBuildFile; fileRef = B386B85320981A74000DEF7A /* AddPeopleController.h */; settings = {ATTRIBUTES = (Public, ); }; };
42
-		B386B85B20981A75000DEF7A /* InviteControllerDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = B386B85420981A74000DEF7A /* InviteControllerDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
43
-		B386B85C20981A75000DEF7A /* InviteController.h in Headers */ = {isa = PBXBuildFile; fileRef = B386B85520981A75000DEF7A /* InviteController.h */; settings = {ATTRIBUTES = (Public, ); }; };
44
-		B386B85D20981A75000DEF7A /* Invite.m in Sources */ = {isa = PBXBuildFile; fileRef = B386B85620981A75000DEF7A /* Invite.m */; };
45
 		C6245F5D2053091D0040BE68 /* image-resize@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C6245F5B2053091D0040BE68 /* image-resize@2x.png */; };
38
 		C6245F5D2053091D0040BE68 /* image-resize@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = C6245F5B2053091D0040BE68 /* image-resize@2x.png */; };
46
 		C6245F5E2053091D0040BE68 /* image-resize@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = C6245F5C2053091D0040BE68 /* image-resize@3x.png */; };
39
 		C6245F5E2053091D0040BE68 /* image-resize@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = C6245F5C2053091D0040BE68 /* image-resize@3x.png */; };
47
 		C69EFA0C209A0F660027712B /* JMCallKitEmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69EFA09209A0F650027712B /* JMCallKitEmitter.swift */; };
40
 		C69EFA0C209A0F660027712B /* JMCallKitEmitter.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69EFA09209A0F650027712B /* JMCallKitEmitter.swift */; };
61
 		0B44A0181F902126009D1D64 /* MPVolumeViewManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPVolumeViewManager.m; sourceTree = "<group>"; };
54
 		0B44A0181F902126009D1D64 /* MPVolumeViewManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPVolumeViewManager.m; sourceTree = "<group>"; };
62
 		0B49424320AD8DBD00BD2DE0 /* outgoingStart.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = outgoingStart.wav; path = ../../sounds/outgoingStart.wav; sourceTree = "<group>"; };
55
 		0B49424320AD8DBD00BD2DE0 /* outgoingStart.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = outgoingStart.wav; path = ../../sounds/outgoingStart.wav; sourceTree = "<group>"; };
63
 		0B49424420AD8DBD00BD2DE0 /* outgoingRinging.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = outgoingRinging.wav; path = ../../sounds/outgoingRinging.wav; sourceTree = "<group>"; };
56
 		0B49424420AD8DBD00BD2DE0 /* outgoingRinging.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = outgoingRinging.wav; path = ../../sounds/outgoingRinging.wav; sourceTree = "<group>"; };
64
-		0B6F414F20987DE600FF6789 /* Invite+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Invite+Private.h"; sourceTree = "<group>"; };
65
-		0B6F41502098840600FF6789 /* InviteController+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "InviteController+Private.h"; sourceTree = "<group>"; };
66
-		0B6F4151209884E500FF6789 /* AddPeopleController+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AddPeopleController+Private.h"; sourceTree = "<group>"; };
67
 		0B7C2CFC200F51D60060D076 /* LaunchOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LaunchOptions.m; sourceTree = "<group>"; };
57
 		0B7C2CFC200F51D60060D076 /* LaunchOptions.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LaunchOptions.m; sourceTree = "<group>"; };
68
 		0B93EF7A1EC608550030D24D /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
58
 		0B93EF7A1EC608550030D24D /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
69
 		0B93EF7C1EC9DDCD0030D24D /* RCTBridgeWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridgeWrapper.h; sourceTree = "<group>"; };
59
 		0B93EF7C1EC9DDCD0030D24D /* RCTBridgeWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTBridgeWrapper.h; sourceTree = "<group>"; };
92
 		A4414ADF20B37F1A003546E6 /* rejected.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = rejected.wav; path = ../../sounds/rejected.wav; sourceTree = "<group>"; };
82
 		A4414ADF20B37F1A003546E6 /* rejected.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = rejected.wav; path = ../../sounds/rejected.wav; sourceTree = "<group>"; };
93
 		A4A934E8212F3ADB001E9388 /* Dropbox.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Dropbox.m; sourceTree = "<group>"; };
83
 		A4A934E8212F3ADB001E9388 /* Dropbox.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Dropbox.m; sourceTree = "<group>"; };
94
 		A4A934EB21349A06001E9388 /* Dropbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Dropbox.h; sourceTree = "<group>"; };
84
 		A4A934EB21349A06001E9388 /* Dropbox.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Dropbox.h; sourceTree = "<group>"; };
95
-		B386B85020981A74000DEF7A /* InviteController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InviteController.m; sourceTree = "<group>"; };
96
-		B386B85120981A74000DEF7A /* AddPeopleController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AddPeopleController.m; sourceTree = "<group>"; };
97
-		B386B85220981A74000DEF7A /* AddPeopleControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddPeopleControllerDelegate.h; sourceTree = "<group>"; };
98
-		B386B85320981A74000DEF7A /* AddPeopleController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AddPeopleController.h; sourceTree = "<group>"; };
99
-		B386B85420981A74000DEF7A /* InviteControllerDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InviteControllerDelegate.h; sourceTree = "<group>"; };
100
-		B386B85520981A75000DEF7A /* InviteController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InviteController.h; sourceTree = "<group>"; };
101
-		B386B85620981A75000DEF7A /* Invite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Invite.m; sourceTree = "<group>"; };
102
 		C6245F5B2053091D0040BE68 /* image-resize@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "image-resize@2x.png"; path = "src/picture-in-picture/image-resize@2x.png"; sourceTree = "<group>"; };
85
 		C6245F5B2053091D0040BE68 /* image-resize@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "image-resize@2x.png"; path = "src/picture-in-picture/image-resize@2x.png"; sourceTree = "<group>"; };
103
 		C6245F5C2053091D0040BE68 /* image-resize@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "image-resize@3x.png"; path = "src/picture-in-picture/image-resize@3x.png"; sourceTree = "<group>"; };
86
 		C6245F5C2053091D0040BE68 /* image-resize@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "image-resize@3x.png"; path = "src/picture-in-picture/image-resize@3x.png"; sourceTree = "<group>"; };
104
 		C69EFA09209A0F650027712B /* JMCallKitEmitter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JMCallKitEmitter.swift; sourceTree = "<group>"; };
87
 		C69EFA09209A0F650027712B /* JMCallKitEmitter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JMCallKitEmitter.swift; sourceTree = "<group>"; };
171
 				A4A934E7212F3AB8001E9388 /* dropbox */,
154
 				A4A934E7212F3AB8001E9388 /* dropbox */,
172
 				0BA13D301EE83FF8007BEF7F /* ExternalAPI.m */,
155
 				0BA13D301EE83FF8007BEF7F /* ExternalAPI.m */,
173
 				0BD906E91EC0C00300C8C18E /* Info.plist */,
156
 				0BD906E91EC0C00300C8C18E /* Info.plist */,
174
-				B386B84F20981A11000DEF7A /* invite */,
175
 				0BD906E81EC0C00300C8C18E /* JitsiMeet.h */,
157
 				0BD906E81EC0C00300C8C18E /* JitsiMeet.h */,
176
 				0B412F161EDEC65D00B1A0A6 /* JitsiMeetView.h */,
158
 				0B412F161EDEC65D00B1A0A6 /* JitsiMeetView.h */,
177
 				0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */,
159
 				0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */,
210
 			path = dropbox;
192
 			path = dropbox;
211
 			sourceTree = "<group>";
193
 			sourceTree = "<group>";
212
 		};
194
 		};
213
-		B386B84F20981A11000DEF7A /* invite */ = {
214
-			isa = PBXGroup;
215
-			children = (
216
-				B386B85320981A74000DEF7A /* AddPeopleController.h */,
217
-				B386B85120981A74000DEF7A /* AddPeopleController.m */,
218
-				0B6F4151209884E500FF6789 /* AddPeopleController+Private.h */,
219
-				B386B85220981A74000DEF7A /* AddPeopleControllerDelegate.h */,
220
-				B386B85620981A75000DEF7A /* Invite.m */,
221
-				0B6F414F20987DE600FF6789 /* Invite+Private.h */,
222
-				B386B85520981A75000DEF7A /* InviteController.h */,
223
-				B386B85020981A74000DEF7A /* InviteController.m */,
224
-				0B6F41502098840600FF6789 /* InviteController+Private.h */,
225
-				B386B85420981A74000DEF7A /* InviteControllerDelegate.h */,
226
-			);
227
-			path = invite;
228
-			sourceTree = "<group>";
229
-		};
230
 		C5E72ADFC30ED96F9B35F076 /* Pods */ = {
195
 		C5E72ADFC30ED96F9B35F076 /* Pods */ = {
231
 			isa = PBXGroup;
196
 			isa = PBXGroup;
232
 			children = (
197
 			children = (
263
 			isa = PBXHeadersBuildPhase;
228
 			isa = PBXHeadersBuildPhase;
264
 			buildActionMask = 2147483647;
229
 			buildActionMask = 2147483647;
265
 			files = (
230
 			files = (
266
-				B386B85C20981A75000DEF7A /* InviteController.h in Headers */,
267
-				B386B85B20981A75000DEF7A /* InviteControllerDelegate.h in Headers */,
268
 				C6F99C15204DB63E0001F710 /* JitsiMeetView+Private.h in Headers */,
231
 				C6F99C15204DB63E0001F710 /* JitsiMeetView+Private.h in Headers */,
269
 				0B412F181EDEC65D00B1A0A6 /* JitsiMeetView.h in Headers */,
232
 				0B412F181EDEC65D00B1A0A6 /* JitsiMeetView.h in Headers */,
270
-				B386B85920981A75000DEF7A /* AddPeopleControllerDelegate.h in Headers */,
271
 				0B93EF7E1EC9DDCD0030D24D /* RCTBridgeWrapper.h in Headers */,
233
 				0B93EF7E1EC9DDCD0030D24D /* RCTBridgeWrapper.h in Headers */,
272
 				0B412F221EDEF6EA00B1A0A6 /* JitsiMeetViewDelegate.h in Headers */,
234
 				0B412F221EDEF6EA00B1A0A6 /* JitsiMeetViewDelegate.h in Headers */,
273
-				B386B85A20981A75000DEF7A /* AddPeopleController.h in Headers */,
274
 				0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */,
235
 				0BD906EA1EC0C00300C8C18E /* JitsiMeet.h in Headers */,
275
 			);
236
 			);
276
 			runOnlyForDeploymentPostprocessing = 0;
237
 			runOnlyForDeploymentPostprocessing = 0;
466
 				0B93EF7F1EC9DDCD0030D24D /* RCTBridgeWrapper.m in Sources */,
427
 				0B93EF7F1EC9DDCD0030D24D /* RCTBridgeWrapper.m in Sources */,
467
 				0BA13D311EE83FF8007BEF7F /* ExternalAPI.m in Sources */,
428
 				0BA13D311EE83FF8007BEF7F /* ExternalAPI.m in Sources */,
468
 				0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */,
429
 				0BCA49601EC4B6C600B793EE /* POSIX.m in Sources */,
469
-				B386B85D20981A75000DEF7A /* Invite.m in Sources */,
470
 				0B7C2CFD200F51D60060D076 /* LaunchOptions.m in Sources */,
430
 				0B7C2CFD200F51D60060D076 /* LaunchOptions.m in Sources */,
471
 				C6CC49AF207412CF000DFA42 /* PiPViewCoordinator.swift in Sources */,
431
 				C6CC49AF207412CF000DFA42 /* PiPViewCoordinator.swift in Sources */,
472
-				B386B85720981A75000DEF7A /* InviteController.m in Sources */,
473
 				DEFC743F21B178FA00E4DD96 /* LocaleDetector.m in Sources */,
432
 				DEFC743F21B178FA00E4DD96 /* LocaleDetector.m in Sources */,
474
-				B386B85820981A75000DEF7A /* AddPeopleController.m in Sources */,
475
 				0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */,
433
 				0BCA495F1EC4B6C600B793EE /* AudioMode.m in Sources */,
476
 				0B44A0191F902126009D1D64 /* MPVolumeViewManager.m in Sources */,
434
 				0B44A0191F902126009D1D64 /* MPVolumeViewManager.m in Sources */,
477
 				0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */,
435
 				0BCA49611EC4B6C600B793EE /* Proximity.m in Sources */,

+ 0
- 6
ios/sdk/src/JitsiMeet.h 파일 보기

17
 // JitsiMeetView
17
 // JitsiMeetView
18
 #import <JitsiMeet/JitsiMeetView.h>
18
 #import <JitsiMeet/JitsiMeetView.h>
19
 #import <JitsiMeet/JitsiMeetViewDelegate.h>
19
 #import <JitsiMeet/JitsiMeetViewDelegate.h>
20
-
21
-// invite/
22
-#import <JitsiMeet/AddPeopleController.h>
23
-#import <JitsiMeet/AddPeopleControllerDelegate.h>
24
-#import <JitsiMeet/InviteController.h>
25
-#import <JitsiMeet/InviteControllerDelegate.h>

+ 0
- 3
ios/sdk/src/JitsiMeetView.h 파일 보기

17
 #import <Foundation/Foundation.h>
17
 #import <Foundation/Foundation.h>
18
 #import <UIKit/UIKit.h>
18
 #import <UIKit/UIKit.h>
19
 
19
 
20
-#import "InviteController.h"
21
 #import "JitsiMeetViewDelegate.h"
20
 #import "JitsiMeetViewDelegate.h"
22
 
21
 
23
 @interface JitsiMeetView : UIView
22
 @interface JitsiMeetView : UIView
28
 
27
 
29
 @property (nonatomic, nullable, weak) id<JitsiMeetViewDelegate> delegate;
28
 @property (nonatomic, nullable, weak) id<JitsiMeetViewDelegate> delegate;
30
 
29
 
31
-@property (nonatomic, readonly, nonnull) JMInviteController *inviteController;
32
-
33
 @property (nonatomic) BOOL pictureInPictureEnabled;
30
 @property (nonatomic) BOOL pictureInPictureEnabled;
34
 
31
 
35
 @property (nonatomic) BOOL welcomePageEnabled;
32
 @property (nonatomic) BOOL welcomePageEnabled;

+ 0
- 9
ios/sdk/src/JitsiMeetView.m 파일 보기

25
 #import <RNGoogleSignin/RNGoogleSignin.h>
25
 #import <RNGoogleSignin/RNGoogleSignin.h>
26
 
26
 
27
 #import "Dropbox.h"
27
 #import "Dropbox.h"
28
-#import "Invite+Private.h"
29
-#import "InviteController+Private.h"
30
 #import "JitsiMeetView+Private.h"
28
 #import "JitsiMeetView+Private.h"
31
 #import "RCTBridgeWrapper.h"
29
 #import "RCTBridgeWrapper.h"
32
 
30
 
237
     props[@"pictureInPictureEnabled"] = @(self.pictureInPictureEnabled);
235
     props[@"pictureInPictureEnabled"] = @(self.pictureInPictureEnabled);
238
     props[@"welcomePageEnabled"] = @(self.welcomePageEnabled);
236
     props[@"welcomePageEnabled"] = @(self.welcomePageEnabled);
239
 
237
 
240
-    props[@"addPeopleEnabled"] = @(_inviteController.addPeopleEnabled);
241
-    props[@"dialOutEnabled"] = @(_inviteController.dialOutEnabled);
242
-
243
     // XXX If urlObject is nil, then it must appear as undefined in the
238
     // XXX If urlObject is nil, then it must appear as undefined in the
244
     // JavaScript source code so that we check the launchOptions there.
239
     // JavaScript source code so that we check the launchOptions there.
245
     if (urlObject) {
240
     if (urlObject) {
420
     externalAPIScope = [NSUUID UUID].UUIDString;
415
     externalAPIScope = [NSUUID UUID].UUIDString;
421
     [views setObject:self forKey:externalAPIScope];
416
     [views setObject:self forKey:externalAPIScope];
422
 
417
 
423
-    _inviteController
424
-        = [[JMInviteController alloc] initWithExternalAPIScope:externalAPIScope
425
-                                                 bridgeWrapper:bridgeWrapper];
426
-
427
     // Set a background color which is in accord with the JavaScript and Android
418
     // Set a background color which is in accord with the JavaScript and Android
428
     // parts of the application and causes less perceived visual flicker than
419
     // parts of the application and causes less perceived visual flicker than
429
     // the default background color.
420
     // the default background color.

+ 0
- 33
ios/sdk/src/invite/AddPeopleController+Private.h 파일 보기

1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import "AddPeopleController.h"
18
-#import "InviteController.h"
19
-
20
-@interface JMAddPeopleController ()
21
-
22
-@property (nonatomic, strong) NSMutableDictionary* _Nonnull items;
23
-@property (nonatomic, weak, nullable) JMInviteController *owner;
24
-@property (nonatomic, readonly) NSString* _Nonnull uuid;
25
-
26
-- (instancetype _Nonnull)initWithOwner:(JMInviteController * _Nonnull)owner;
27
-
28
-- (void)inviteSettled:(NSArray<NSDictionary *> * _Nonnull)failedInvitees;
29
-
30
-- (void)receivedResults:(NSArray<NSDictionary*> * _Nonnull)results
31
-               forQuery:(NSString * _Nonnull)query;
32
-
33
-@end

+ 0
- 31
ios/sdk/src/invite/AddPeopleController.h 파일 보기

1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import <Foundation/Foundation.h>
18
-
19
-#import "AddPeopleControllerDelegate.h"
20
-
21
-@interface JMAddPeopleController: NSObject
22
-
23
-@property (nonatomic, nullable, weak) id<JMAddPeopleControllerDelegate> delegate;
24
-
25
-- (void)endAddPeople;
26
-
27
-- (void)inviteById:(NSArray<NSString *> * _Nonnull)ids;
28
-
29
-- (void)performQuery:(NSString * _Nonnull)query;
30
-
31
-@end

+ 0
- 82
ios/sdk/src/invite/AddPeopleController.m 파일 보기

1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import "AddPeopleController+Private.h"
18
-#import "InviteController+Private.h"
19
-
20
-@implementation JMAddPeopleController
21
-
22
-- (instancetype)initWithOwner:(JMInviteController *)owner {
23
-    self = [super init];
24
-    if (self) {
25
-        _uuid = [[NSUUID UUID] UUIDString];
26
-        _items = [[NSMutableDictionary alloc] init];
27
-        _owner = owner;
28
-    }
29
-    return self;
30
-}
31
-
32
-#pragma mark API
33
-
34
-- (void)endAddPeople {
35
-    [self.owner endAddPeopleForController:self];
36
-}
37
-
38
-- (void)inviteById:(NSArray<NSString *> * _Nonnull)ids {
39
-    NSMutableArray* invitees = [[NSMutableArray alloc] init];
40
-
41
-    for (NSString* itemId in ids) {
42
-        id invitee = [self.items objectForKey:itemId];
43
-
44
-        if (invitee) {
45
-            [invitees addObject:invitee];
46
-        }
47
-    }
48
-
49
-    [self.owner invite:invitees forController:self];
50
-}
51
-
52
-- (void)performQuery:(NSString *)query {
53
-    [self.owner performQuery:query forController:self];
54
-}
55
-
56
-#pragma mark Internal API, used to call the delegate and report to the user
57
-
58
-- (void)receivedResults:(NSArray<NSDictionary *> *)results
59
-               forQuery:(NSString *)query {
60
-    for (NSDictionary* item in results) {
61
-        NSString* itemId = item[@"id"];
62
-        NSString* itemType = item[@"type"];
63
-        if (itemId) {
64
-            [self.items setObject:item forKey:itemId];
65
-        } else if (itemType != nil && [itemType isEqualToString: @"phone"]) {
66
-            NSString* number = item[@"number"];
67
-            if (number) {
68
-                [self.items setObject:item forKey:number];
69
-            }
70
-        }
71
-    }
72
-
73
-    [self.delegate addPeopleController:self
74
-                     didReceiveResults:results
75
-                              forQuery:query];
76
-}
77
-
78
-- (void)inviteSettled:(NSArray<NSDictionary *> *)failedInvitees {
79
-    [self.delegate inviteSettled:failedInvitees fromSearchController:self];
80
-}
81
-
82
-@end

+ 0
- 41
ios/sdk/src/invite/AddPeopleControllerDelegate.h 파일 보기

1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import <Foundation/Foundation.h>
18
-
19
-#import "AddPeopleController.h"
20
-
21
-@class JMAddPeopleController;
22
-
23
-@protocol JMAddPeopleControllerDelegate
24
-
25
-/**
26
- * Called when a JMAddPeopleController has results for a query that was
27
- * previously provided.
28
- */
29
-- (void)addPeopleController:(JMAddPeopleController * _Nonnull)controller
30
-          didReceiveResults:(NSArray<NSDictionary *> * _Nonnull)results
31
-                   forQuery:(NSString * _Nonnull)query;
32
-
33
-/**
34
- * Called when a JMAddPeopleController has finished the inviting process, either
35
- * succesfully or not. In case of failure the failedInvitees array will contain
36
- * the items for which invitations failed.
37
- */
38
-- (void) inviteSettled:(NSArray<NSDictionary *> * _Nonnull)failedInvitees
39
-  fromSearchController:(JMAddPeopleController * _Nonnull)addPeopleController;
40
-
41
-@end

+ 0
- 30
ios/sdk/src/invite/Invite+Private.h 파일 보기

1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import <React/RCTBridge.h>
18
-#import <React/RCTEventEmitter.h>
19
-
20
-@interface Invite : RCTEventEmitter <RCTBridgeModule>
21
-
22
-- (void)            invite:(NSArray<NSDictionary *> * _Nonnull)invitees
23
-          externalAPIScope:(NSString * _Nonnull)externalAPIScope
24
-  addPeopleControllerScope:(NSString * _Nonnull)addPeopleControllerScope;
25
-
26
-- (void)      performQuery:(NSString * _Nonnull)query
27
-          externalAPIScope:(NSString * _Nonnull)externalAPIScope
28
-  addPeopleControllerScope:(NSString * _Nonnull)addPeopleControllerScope;
29
-
30
-@end

+ 0
- 127
ios/sdk/src/invite/Invite.m 파일 보기

1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import "Invite+Private.h"
18
-#import "InviteController+Private.h"
19
-#import "JitsiMeetView+Private.h"
20
-
21
-// The events emitted/supported by the Invite react-native module:
22
-//
23
-// XXX The event names are ridiculous on purpose. Even though iOS makes it look
24
-// like it emits within the bounderies of a react-native module ony, it actually
25
-// also emits through DeviceEventEmitter. (Of course, Android emits only through
26
-// DeviceEventEmitter.)
27
-static NSString * const InviteEmitterEvent
28
-    = @"org.jitsi.meet:features/invite#invite";
29
-static NSString * const PerformQueryEmitterEvent
30
-    = @"org.jitsi.meet:features/invite#performQuery";
31
-
32
-@implementation Invite
33
-
34
-RCT_EXPORT_MODULE();
35
-
36
-/**
37
- * Make sure all methods in this module are invoked on the main/UI thread.
38
- */
39
-- (dispatch_queue_t)methodQueue {
40
-    return dispatch_get_main_queue();
41
-}
42
-
43
-- (NSArray<NSString *> *)supportedEvents {
44
-    return @[
45
-        InviteEmitterEvent,
46
-        PerformQueryEmitterEvent
47
-    ];
48
-}
49
-
50
-/**
51
- * Initiates the process to add people. This involves calling a delegate method
52
- * in the JMInviteControllerDelegate so the native host application can start
53
- * the query process.
54
- *
55
- * @param externalAPIScope - Scope identifying the JitsiMeetView where the
56
- * calling JS code is being executed.
57
- */
58
-RCT_EXPORT_METHOD(beginAddPeople:(NSString *)externalAPIScope) {
59
-    JitsiMeetView *view
60
-        = [JitsiMeetView viewForExternalAPIScope:externalAPIScope];
61
-    JMInviteController *inviteController = view.inviteController;
62
-    [inviteController beginAddPeople];
63
-}
64
-
65
-/**
66
- * Indicates the the invite process has settled / finished.
67
- *
68
- * @param externalAPIScope - Scope identifying the JitsiMeetView where the
69
- * calling JS code is being executed.
70
- * @param addPeopleControllerScope - Scope identifying the JMAddPeopleController
71
- * wich was settled.
72
- * @param failedInvitees - Array with the invitees which were not invited due
73
- * to a failure.
74
- */
75
-RCT_EXPORT_METHOD(inviteSettled:(NSString *)externalAPIScope
76
-       addPeopleControllerScope:(NSString *)addPeopleControllerScope
77
-                 failedInvitees:(NSArray *)failedInvitees) {
78
-    JitsiMeetView *view
79
-        = [JitsiMeetView viewForExternalAPIScope:externalAPIScope];
80
-    JMInviteController *inviteController = view.inviteController;
81
-    [inviteController inviteSettled:addPeopleControllerScope
82
-                     failedInvitees:failedInvitees];
83
-}
84
-
85
-/**
86
- * Process results received for the given query. This involves calling a
87
- * delegate method in JMAddPeopleControllerDelegate so the native host
88
- * application is made aware of the query results.
89
- *
90
- * @param externalAPIScope - Scope identifying the JitsiMeetView where the
91
- * calling JS code is being executed.
92
- * @param addPeopleControllerScope - Scope identifying the JMAddPeopleController
93
- * for which the results were received.
94
- * @param query - The actual query for which the results were received.
95
- * @param results - The query results.
96
- */
97
-RCT_EXPORT_METHOD(receivedResults:(NSString *)externalAPIScope
98
-         addPeopleControllerScope:(NSString *)addPeopleControllerScope
99
-                            query:(NSString *)query
100
-                          results:(NSArray *)results) {
101
-    JitsiMeetView *view
102
-        = [JitsiMeetView viewForExternalAPIScope:externalAPIScope];
103
-    JMInviteController *inviteController = view.inviteController;
104
-    [inviteController receivedResults:addPeopleControllerScope
105
-                                query:query
106
-                              results:results];
107
-}
108
-
109
-- (void)            invite:(NSArray<NSDictionary *> * _Nonnull)invitees
110
-          externalAPIScope:(NSString * _Nonnull)externalAPIScope
111
-  addPeopleControllerScope:(NSString * _Nonnull) addPeopleControllerScope {
112
-    [self sendEventWithName:InviteEmitterEvent
113
-                       body:@{ @"addPeopleControllerScope": addPeopleControllerScope,
114
-                               @"externalAPIScope": externalAPIScope,
115
-                               @"invitees": invitees }];
116
-}
117
-
118
-- (void)      performQuery:(NSString * _Nonnull)query
119
-          externalAPIScope:(NSString * _Nonnull)externalAPIScope
120
-  addPeopleControllerScope:(NSString * _Nonnull) addPeopleControllerScope {
121
-    [self sendEventWithName:PerformQueryEmitterEvent
122
-                       body:@{ @"addPeopleControllerScope": addPeopleControllerScope,
123
-                               @"externalAPIScope": externalAPIScope,
124
-                               @"query": query }];
125
-}
126
-
127
-@end

+ 0
- 53
ios/sdk/src/invite/InviteController+Private.h 파일 보기

1
-/*
2
- * Copyright @ 2018-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import "InviteController.h"
18
-
19
-#import "AddPeopleController.h"
20
-#import "Invite+Private.h"
21
-#import "RCTBridgeWrapper.h"
22
-
23
-@interface JMInviteController ()
24
-
25
-@property (nonatomic, nullable) JMAddPeopleController *addPeopleController;
26
-
27
-@property (nonatomic) NSString * _Nonnull externalAPIScope;
28
-
29
-@property (nonatomic, nullable, weak) RCTBridgeWrapper *bridgeWrapper;
30
-
31
-@property (nonatomic, readonly) Invite * _Nullable inviteModule;
32
-
33
-- (instancetype _Nonnull)initWithExternalAPIScope:(NSString * _Nonnull)externalAPIScope
34
-                                    bridgeWrapper:(RCTBridgeWrapper * _Nullable)bridgeWrapper;
35
-
36
-- (void)beginAddPeople;
37
-
38
-- (void)endAddPeopleForController:(JMAddPeopleController * _Nonnull)controller;
39
-
40
-- (void) invite:(NSArray * _Nonnull)invitees
41
-  forController:(JMAddPeopleController * _Nonnull)controller;
42
-
43
-- (void)inviteSettled:(NSString * _Nonnull)addPeopleControllerScope
44
-       failedInvitees:(NSArray * _Nonnull)failedInvitees;
45
-
46
-- (void)performQuery:(NSString * _Nonnull)query
47
-       forController:(JMAddPeopleController * _Nonnull)controller;
48
-
49
-- (void)receivedResults:(NSString * _Nonnull)addPeopleControllerScope
50
-                  query:(NSString * _Nonnull)query
51
-                results:(NSArray * _Nonnull)results;
52
-
53
-@end

+ 0
- 32
ios/sdk/src/invite/InviteController.h 파일 보기

1
-/*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import <Foundation/Foundation.h>
18
-
19
-#import "InviteControllerDelegate.h"
20
-
21
-@interface JMInviteController : NSObject
22
-
23
-@property (nonatomic) BOOL addPeopleEnabled;
24
-
25
-@property (nonatomic) BOOL dialOutEnabled;
26
-
27
-@property (nonatomic, nullable, weak) id<JMInviteControllerDelegate> delegate;
28
-
29
-- (void)  invite:(NSArray * _Nonnull)invitees
30
-  withCompletion:(void (^ _Nullable)(NSArray<NSDictionary *> * _Nonnull failedInvitees))completion;
31
-
32
-@end

+ 0
- 160
ios/sdk/src/invite/InviteController.m 파일 보기

1
-/*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import "InviteController+Private.h"
18
-#import "AddPeopleController+Private.h"
19
-
20
-@implementation JMInviteController {
21
-    NSNumber *_addPeopleEnabled;
22
-    NSNumber *_dialOutEnabled;
23
-}
24
-
25
-@dynamic addPeopleEnabled;
26
-@dynamic dialOutEnabled;
27
-
28
-#pragma mark Constructor
29
-
30
--(instancetype)initWithExternalAPIScope:(NSString * _Nonnull)externalAPIScope
31
-                          bridgeWrapper:(RCTBridgeWrapper * _Nullable)bridgeWrapper {
32
-    self = [super init];
33
-    if (self) {
34
-        self.externalAPIScope = externalAPIScope;
35
-        self.bridgeWrapper = bridgeWrapper;
36
-    }
37
-
38
-    return self;
39
-}
40
-
41
-#pragma mark Public API
42
-
43
--(Invite * _Nullable)inviteModule {
44
-    return [self.bridgeWrapper.bridge moduleForName:@"Invite"];
45
-}
46
-
47
--(void)beginAddPeople {
48
-    if (_delegate == nil) {
49
-        return;
50
-    }
51
-
52
-    if (_addPeopleController != nil) {
53
-        return;
54
-    }
55
-
56
-    _addPeopleController = [[JMAddPeopleController alloc] initWithOwner:self];
57
-
58
-    @try {
59
-        if (self.delegate
60
-                && [self.delegate respondsToSelector:@selector(beginAddPeople:)]) {
61
-            [self.delegate beginAddPeople:_addPeopleController];
62
-        }
63
-    } @catch (NSException *e) {
64
-        [self endAddPeopleForController:_addPeopleController];
65
-    }
66
-}
67
-
68
--(void)endAddPeopleForController:(JMAddPeopleController *)controller {
69
-    if (self.addPeopleController == controller) {
70
-        self.addPeopleController = nil;
71
-    }
72
-}
73
-
74
-#pragma mark Property getters / setters
75
-
76
-- (void) setAddPeopleEnabled:(BOOL)addPeopleEnabled {
77
-    _addPeopleEnabled = [NSNumber numberWithBool:addPeopleEnabled];
78
-}
79
-
80
-- (BOOL) addPeopleEnabled {
81
-    if (_addPeopleEnabled == nil || [_addPeopleEnabled boolValue]) {
82
-        return self.delegate
83
-            && [self.delegate respondsToSelector:@selector(beginAddPeople:)];
84
-    }
85
-
86
-    return NO;
87
-}
88
-
89
-- (void) setDialOutEnabled:(BOOL)dialOutEnabled {
90
-    _dialOutEnabled = [NSNumber numberWithBool:dialOutEnabled];
91
-}
92
-
93
-- (BOOL) dialOutEnabled {
94
-    if (_dialOutEnabled == nil || [_dialOutEnabled boolValue]) {
95
-        return self.delegate
96
-            && [self.delegate respondsToSelector:@selector(beginAddPeople:)];
97
-    }
98
-
99
-    return NO;
100
-}
101
-
102
-#pragma mark Result handling
103
-
104
-- (void)inviteSettled:(NSString *)addPeopleControllerScope
105
-       failedInvitees:(NSArray *)failedInvitees {
106
-    JMAddPeopleController *controller = self.addPeopleController;
107
-
108
-    if (controller != nil
109
-            && [controller.uuid isEqualToString:addPeopleControllerScope]) {
110
-        @try {
111
-            [controller inviteSettled:failedInvitees];
112
-        } @finally {
113
-            if ([failedInvitees count] == 0) {
114
-                [self endAddPeopleForController:controller];
115
-            }
116
-        }
117
-    }
118
-}
119
-
120
-- (void)receivedResults:(NSString *)addPeopleControllerScope
121
-                  query:(NSString *)query
122
-                results:(NSArray *)results {
123
-    JMAddPeopleController *controller = self.addPeopleController;
124
-
125
-    if (controller != nil
126
-            && [controller.uuid isEqualToString:addPeopleControllerScope]) {
127
-        [controller receivedResults:results forQuery:query];
128
-    }
129
-}
130
-
131
-#pragma mark Use the Invite react-native module to emit the search / submission events
132
-
133
-- (void) invite:(NSArray *)invitees
134
-  forController:(JMAddPeopleController * _Nonnull)controller {
135
-    [self        invite:invitees
136
-     forControllerScope:controller.uuid];
137
-}
138
-
139
-- (void)      invite:(NSArray *)invitees
140
-  forControllerScope:(NSString * _Nonnull)controllerScope {
141
-    [self.inviteModule invite:invitees
142
-             externalAPIScope:self.externalAPIScope
143
-     addPeopleControllerScope:controllerScope];
144
-}
145
-
146
-- (void)  invite:(NSArray *)invitees
147
-  withCompletion:(void (^)(NSArray<NSDictionary *> *failedInvitees))completion {
148
-    // TODO Execute the specified completion block when the invite settles.
149
-    [self        invite:invitees
150
-     forControllerScope:[[NSUUID UUID] UUIDString]];
151
-}
152
-
153
-- (void)performQuery:(NSString * _Nonnull)query
154
-       forController:(JMAddPeopleController * _Nonnull)controller {
155
-    [self.inviteModule performQuery:query
156
-                   externalAPIScope:self.externalAPIScope
157
-           addPeopleControllerScope:controller.uuid];
158
-}
159
-
160
-@end

+ 0
- 29
ios/sdk/src/invite/InviteControllerDelegate.h 파일 보기

1
-/*
2
- * Copyright @ 2017-present Atlassian Pty Ltd
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- *     http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
-#import "AddPeopleController.h"
18
-
19
-@protocol JMInviteControllerDelegate <NSObject>
20
-
21
-/**
22
- * Called when the invite button in the conference is tapped.
23
- *
24
- * The search controller provided can be used to query user search within the
25
- * conference.
26
- */
27
-- (void)beginAddPeople:(JMAddPeopleController *)addPeopleController;
28
-
29
-@end

+ 0
- 10
react/features/app/components/App.native.js 파일 보기

35
  */
35
  */
36
 type Props = AbstractAppProps & {
36
 type Props = AbstractAppProps & {
37
 
37
 
38
-    /**
39
-     * Whether the add people feature is enabled.
40
-     */
41
-    addPeopleEnabled: boolean,
42
-
43
-    /**
44
-     * Whether the dial-out feature is enabled.
45
-     */
46
-    dialOutEnabled: boolean,
47
-
48
     /**
38
     /**
49
      * Whether Picture-in-Picture is enabled. If {@code true}, a toolbar button
39
      * Whether Picture-in-Picture is enabled. If {@code true}, a toolbar button
50
      * is rendered in the {@link Conference} view to afford entering
40
      * is rendered in the {@link Conference} view to afford entering

+ 0
- 13
react/features/invite/actionTypes.js 파일 보기

1
-/**
2
- * The type of redux action to set the {@code EventEmitter} subscriptions
3
- * utilized by the feature invite.
4
- *
5
- * {
6
- *     type: _SET_EMITTER_SUBSCRIPTIONS,
7
- *     emitterSubscriptions: Array|undefined
8
- * }
9
- *
10
- * @protected
11
- */
12
-export const _SET_EMITTER_SUBSCRIPTIONS = Symbol('_SET_EMITTER_SUBSCRIPTIONS');
13
-
14
 /**
1
 /**
15
  * The type of redux action which will add pending invite request to the redux
2
  * The type of redux action which will add pending invite request to the redux
16
  * store.
3
  * store.

+ 3
- 36
react/features/invite/components/InviteButton.native.js 파일 보기

38
     _onShareRoom: Function
38
     _onShareRoom: Function
39
 };
39
 };
40
 
40
 
41
-/**
42
- * The indicator which determines (at bundle time) whether there should be a
43
- * button in {@code Toolbox} to expose the functionality of the feature
44
- * share-room in the user interface of the app.
45
- *
46
- * @private
47
- * @type {boolean}
48
- */
49
-const _SHARE_ROOM_TOOLBAR_BUTTON = true;
50
-
51
 /**
41
 /**
52
  * Implements an {@link AbstractButton} to enter add/invite people to the
42
  * Implements an {@link AbstractButton} to enter add/invite people to the
53
  * current call/conference/meeting.
43
  * current call/conference/meeting.
64
      * @returns {void}
54
      * @returns {void}
65
      */
55
      */
66
     _handleClick() {
56
     _handleClick() {
57
+        // FIXME: dispatch _onAddPeople here, when we have a dialog for it.
67
         const {
58
         const {
68
-            _addPeopleEnabled,
69
-            _dialOutEnabled,
70
-            _onAddPeople,
71
             _onShareRoom
59
             _onShareRoom
72
         } = this.props;
60
         } = this.props;
73
 
61
 
74
-        if (_addPeopleEnabled || _dialOutEnabled) {
75
-            _onAddPeople();
76
-        } else if (_SHARE_ROOM_TOOLBAR_BUTTON) {
77
-            _onShareRoom();
78
-        }
79
-    }
80
-
81
-    /**
82
-     * Implements React's {@link Component#render()}.
83
-     *
84
-     * @inheritdoc
85
-     * @returns {React$Node}
86
-     */
87
-    render() {
88
-        const { _addPeopleEnabled, _dialOutEnabled } = this.props;
89
-
90
-        return (
91
-            _SHARE_ROOM_TOOLBAR_BUTTON
92
-                    || _addPeopleEnabled
93
-                    || _dialOutEnabled
94
-                ? super.render()
95
-                : null);
62
+        _onShareRoom();
96
     }
63
     }
97
 }
64
 }
98
 
65
 
110
 function _mapDispatchToProps(dispatch: Dispatch<*>) {
77
 function _mapDispatchToProps(dispatch: Dispatch<*>) {
111
     return {
78
     return {
112
         /**
79
         /**
113
-         * Launches native invite dialog.
80
+         * Launches the add people dialog.
114
          *
81
          *
115
          * @private
82
          * @private
116
          * @returns {void}
83
          * @returns {void}

+ 3
- 27
react/features/invite/functions.js 파일 보기

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { getAppProp } from '../base/app';
4
 import { i18next } from '../base/i18n';
3
 import { i18next } from '../base/i18n';
5
 import { isLocalParticipantModerator } from '../base/participants';
4
 import { isLocalParticipantModerator } from '../base/participants';
6
 import { doGetJSON, parseURIString } from '../base/util';
5
 import { doGetJSON, parseURIString } from '../base/util';
297
 export function isAddPeopleEnabled(state: Object): boolean {
296
 export function isAddPeopleEnabled(state: Object): boolean {
298
     const { isGuest } = state['features/base/jwt'];
297
     const { isGuest } = state['features/base/jwt'];
299
 
298
 
300
-    if (!isGuest) {
301
-        // XXX The mobile/react-native app is capable of disabling the
302
-        // adding/inviting of people in the current conference. Anyway, the
303
-        // Web/React app does not have that capability so default appropriately.
304
-        const addPeopleEnabled = getAppProp(state, 'addPeopleEnabled');
305
-
306
-        return (
307
-            (typeof addPeopleEnabled === 'undefined')
308
-                || Boolean(addPeopleEnabled));
309
-    }
310
-
311
-    return false;
299
+    return !isGuest;
312
 }
300
 }
313
 
301
 
314
 /**
302
 /**
319
  */
307
  */
320
 export function isDialOutEnabled(state: Object): boolean {
308
 export function isDialOutEnabled(state: Object): boolean {
321
     const { conference } = state['features/base/conference'];
309
     const { conference } = state['features/base/conference'];
322
-    let dialOutEnabled = isLocalParticipantModerator(state)
323
-        && conference
324
-        && conference.isSIPCallingSupported();
325
-
326
-    if (dialOutEnabled) {
327
-        // XXX The mobile/react-native app is capable of disabling of dial-out.
328
-        // Anyway, the Web/React app does not have that capability so default
329
-        // appropriately.
330
-        dialOutEnabled = getAppProp(state, 'dialOutEnabled');
331
-
332
-        return (
333
-            (typeof dialOutEnabled === 'undefined') || Boolean(dialOutEnabled));
334
-    }
335
 
310
 
336
-    return false;
311
+    return isLocalParticipantModerator(state)
312
+        && conference && conference.isSIPCallingSupported();
337
 }
313
 }
338
 
314
 
339
 /**
315
 /**

+ 0
- 232
react/features/invite/middleware.native.js 파일 보기

1
-// @flow
2
-
3
-import i18next from 'i18next';
4
-import { NativeEventEmitter, NativeModules } from 'react-native';
5
-
6
-import { APP_WILL_MOUNT, APP_WILL_UNMOUNT, getAppProp } from '../base/app';
7
-import { MiddlewareRegistry } from '../base/redux';
8
-
9
-import { invite } from './actions';
10
-import {
11
-    BEGIN_ADD_PEOPLE,
12
-    _SET_EMITTER_SUBSCRIPTIONS
13
-} from './actionTypes';
14
-import {
15
-    getInviteResultsForQuery,
16
-    isAddPeopleEnabled,
17
-    isDialOutEnabled
18
-} from './functions';
19
-import './middleware.any';
20
-
21
-/**
22
- * The react-native module of the feature invite.
23
- */
24
-const { Invite } = NativeModules;
25
-
26
-/**
27
- * The middleware of the feature invite specific to mobile/react-native.
28
- *
29
- * @param {Store} store - The redux store.
30
- * @returns {Function}
31
- */
32
-Invite && MiddlewareRegistry.register(store => next => action => {
33
-    switch (action.type) {
34
-    case _SET_EMITTER_SUBSCRIPTIONS:
35
-        return _setEmitterSubscriptions(store, next, action);
36
-
37
-    case APP_WILL_MOUNT:
38
-        return _appWillMount(store, next, action);
39
-
40
-    case APP_WILL_UNMOUNT: {
41
-        const result = next(action);
42
-
43
-        store.dispatch({
44
-            type: _SET_EMITTER_SUBSCRIPTIONS,
45
-            emitterSubscriptions: undefined
46
-        });
47
-
48
-        return result;
49
-    }
50
-
51
-    case BEGIN_ADD_PEOPLE:
52
-        return _beginAddPeople(store, next, action);
53
-    }
54
-
55
-    return next(action);
56
-});
57
-
58
-/**
59
- * Notifies the feature jwt that the action {@link APP_WILL_MOUNT} is being
60
- * dispatched within a specific redux {@code store}.
61
- *
62
- * @param {Store} store - The redux store in which the specified {@code action}
63
- * is being dispatched.
64
- * @param {Dispatch} next - The redux dispatch function to dispatch the
65
- * specified {@code action} to the specified {@code store}.
66
- * @param {Action} action - The redux action {@code APP_WILL_MOUNT} which is
67
- * being dispatched in the specified {@code store}.
68
- * @private
69
- * @returns {*} The value returned by {@code next(action)}.
70
- */
71
-function _appWillMount({ dispatch, getState }, next, action) {
72
-    const result = next(action);
73
-
74
-    const emitter = new NativeEventEmitter(Invite);
75
-    const context = {
76
-        dispatch,
77
-        getState
78
-    };
79
-
80
-    dispatch({
81
-        type: _SET_EMITTER_SUBSCRIPTIONS,
82
-        emitterSubscriptions: [
83
-            emitter.addListener(
84
-                'org.jitsi.meet:features/invite#invite',
85
-                _onInvite,
86
-                context),
87
-            emitter.addListener(
88
-                'org.jitsi.meet:features/invite#performQuery',
89
-                _onPerformQuery,
90
-                context)
91
-        ]
92
-    });
93
-
94
-    return result;
95
-}
96
-
97
-/**
98
- * Notifies the feature invite that the action {@link BEGIN_ADD_PEOPLE} is being
99
- * dispatched within a specific redux {@code store}.
100
- *
101
- * @param {Store} store - The redux store in which the specified {@code action}
102
- * is being dispatched.
103
- * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
104
- * specified {@code action} to the specified {@code store}.
105
- * @param {Action} action - The redux action {@code BEGIN_ADD_PEOPLE} which is
106
- * being dispatched in the specified {@code store}.
107
- * @private
108
- * @returns {*} The value returned by {@code next(action)}.
109
- */
110
-function _beginAddPeople(store, next, action) {
111
-    const result = next(action);
112
-
113
-    // The JavaScript App needs to provide uniquely identifying information to
114
-    // the native Invite module so that the latter may match the former to the
115
-    // native JitsiMeetView which hosts it.
116
-    const externalAPIScope = getAppProp(store, 'externalAPIScope');
117
-
118
-    externalAPIScope && Invite.beginAddPeople(externalAPIScope);
119
-
120
-    return result;
121
-}
122
-
123
-/**
124
- * Handles the {@code invite} event of the feature invite and invites specific
125
- * invitees to the current, ongoing conference.
126
- *
127
- * @param {Object} event - The details of the event.
128
- * @returns {void}
129
- */
130
-function _onInvite({ addPeopleControllerScope, externalAPIScope, invitees }) {
131
-    const { dispatch, getState } = this; // eslint-disable-line no-invalid-this
132
-
133
-    // If there are multiple JitsiMeetView instances alive, they will all get
134
-    // the event, since there is a single bridge, so make sure we don't act if
135
-    // the event is not for us.
136
-    if (getAppProp(getState, 'externalAPIScope') !== externalAPIScope) {
137
-        return;
138
-    }
139
-
140
-    dispatch(invite(invitees))
141
-        .then(failedInvitees =>
142
-            Invite.inviteSettled(
143
-                externalAPIScope,
144
-                addPeopleControllerScope,
145
-                failedInvitees));
146
-}
147
-
148
-/**
149
- * Handles the {@code performQuery} event of the feature invite and queries for
150
- * invitees who may subsequently be invited to the current, ongoing conference.
151
- *
152
- * @param {Object} event - The details of the event.
153
- * @returns {void}
154
- */
155
-function _onPerformQuery(
156
-        { addPeopleControllerScope, externalAPIScope, query }) {
157
-    const { getState } = this; // eslint-disable-line no-invalid-this
158
-    const state = getState();
159
-
160
-    // If there are multiple JitsiMeetView instances alive, they will all get
161
-    // the event, since there is a single bridge, so make sure we don't act if
162
-    // the event is not for us.
163
-    if (getAppProp(state, 'externalAPIScope') !== externalAPIScope) {
164
-        return;
165
-    }
166
-
167
-    const {
168
-        dialOutAuthUrl,
169
-        peopleSearchQueryTypes,
170
-        peopleSearchUrl
171
-    } = state['features/base/config'];
172
-    const options = {
173
-        dialOutAuthUrl,
174
-        addPeopleEnabled: isAddPeopleEnabled(state),
175
-        dialOutEnabled: isDialOutEnabled(state),
176
-        jwt: state['features/base/jwt'].jwt,
177
-        peopleSearchQueryTypes,
178
-        peopleSearchUrl
179
-    };
180
-
181
-    getInviteResultsForQuery(query, options)
182
-        .catch(() => [])
183
-        .then(results => {
184
-            const translatedResults = results.map(result => {
185
-                if (result.type === 'phone') {
186
-                    result.title = i18next.t('addPeople.telephone', {
187
-                        number: result.number
188
-                    });
189
-
190
-                    if (result.showCountryCodeReminder) {
191
-                        result.subtitle = i18next.t(
192
-                            'addPeople.countryReminder'
193
-                        );
194
-                    }
195
-                }
196
-
197
-                return result;
198
-            }).filter(result => result.type !== 'phone' || result.allowed);
199
-
200
-            Invite.receivedResults(
201
-                externalAPIScope,
202
-                addPeopleControllerScope,
203
-                query,
204
-                translatedResults);
205
-        });
206
-}
207
-
208
-/**
209
- * Notifies the feature invite that the action
210
- * {@link _SET_EMITTER_SUBSCRIPTIONS} is being dispatched within a specific
211
- * redux {@code store}.
212
- *
213
- * @param {Store} store - The redux store in which the specified {@code action}
214
- * is being dispatched.
215
- * @param {Dispatch} next - The redux dispatch function to dispatch the
216
- * specified {@code action} to the specified {@code store}.
217
- * @param {Action} action - The redux action {@code _SET_EMITTER_SUBSCRIPTIONS}
218
- * which is being dispatched in the specified {@code store}.
219
- * @private
220
- * @returns {*}
221
- */
222
-function _setEmitterSubscriptions({ getState }, next, action) {
223
-    const { emitterSubscriptions } = getState()['features/invite'];
224
-
225
-    if (emitterSubscriptions) {
226
-        for (const subscription of emitterSubscriptions) {
227
-            subscription.remove();
228
-        }
229
-    }
230
-
231
-    return next(action);
232
-}

+ 2
- 5
react/features/invite/reducer.js 파일 보기

1
 // @flow
1
 // @flow
2
 
2
 
3
-import { assign, ReducerRegistry } from '../base/redux';
3
+import { ReducerRegistry } from '../base/redux';
4
 
4
 
5
 import {
5
 import {
6
-    _SET_EMITTER_SUBSCRIPTIONS,
7
     ADD_PENDING_INVITE_REQUEST,
6
     ADD_PENDING_INVITE_REQUEST,
8
     REMOVE_PENDING_INVITE_REQUESTS,
7
     REMOVE_PENDING_INVITE_REQUESTS,
9
     SET_CALLEE_INFO_VISIBLE,
8
     SET_CALLEE_INFO_VISIBLE,
26
 
25
 
27
 ReducerRegistry.register('features/invite', (state = DEFAULT_STATE, action) => {
26
 ReducerRegistry.register('features/invite', (state = DEFAULT_STATE, action) => {
28
     switch (action.type) {
27
     switch (action.type) {
29
-    case _SET_EMITTER_SUBSCRIPTIONS:
30
-        return (
31
-            assign(state, 'emitterSubscriptions', action.emitterSubscriptions));
32
     case ADD_PENDING_INVITE_REQUEST:
28
     case ADD_PENDING_INVITE_REQUEST:
33
         return {
29
         return {
34
             ...state,
30
             ...state,
37
                 action.request
33
                 action.request
38
             ]
34
             ]
39
         };
35
         };
36
+
40
     case REMOVE_PENDING_INVITE_REQUESTS:
37
     case REMOVE_PENDING_INVITE_REQUESTS:
41
         return {
38
         return {
42
             ...state,
39
             ...state,

Loading…
취소
저장