summaryrefslogtreecommitdiffstats
path: root/webapp/actions/webrtc_actions.jsx
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2017-01-27 11:39:13 +0100
committerGeorge Goldberg <george@gberg.me>2017-01-27 10:39:13 +0000
commitd72547433af3ec5829ce0de4f4e1cfd440be7142 (patch)
tree6bd7664e9058468842c7b7bb7c7a76abf1b7c5e3 /webapp/actions/webrtc_actions.jsx
parent49c677f6b46409289210abc0e0bda63735be3e9f (diff)
downloadchat-d72547433af3ec5829ce0de4f4e1cfd440be7142.tar.gz
chat-d72547433af3ec5829ce0de4f4e1cfd440be7142.tar.bz2
chat-d72547433af3ec5829ce0de4f4e1cfd440be7142.zip
Move remaining client functions in components to actions (#5171)
Diffstat (limited to 'webapp/actions/webrtc_actions.jsx')
-rw-r--r--webapp/actions/webrtc_actions.jsx16
1 files changed, 16 insertions, 0 deletions
diff --git a/webapp/actions/webrtc_actions.jsx b/webapp/actions/webrtc_actions.jsx
index 444eee241..b096e1c33 100644
--- a/webapp/actions/webrtc_actions.jsx
+++ b/webapp/actions/webrtc_actions.jsx
@@ -4,6 +4,8 @@
import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
import {WebrtcActionTypes} from 'utils/constants.jsx';
+import Client from 'client/web_client.jsx';
+
export function initWebrtc(userId, isCalling) {
AppDispatcher.handleServerAction({
type: WebrtcActionTypes.INITIALIZE,
@@ -18,3 +20,17 @@ export function handle(message) {
message
});
}
+
+export function webrtcToken(success, error) {
+ Client.webrtcToken(
+ (data) => {
+ if (success) {
+ success(data);
+ }
+ },
+ () => {
+ if (error) {
+ error();
+ }
+ });
+}