Parcourir la source

feat(presence-status): Add more statuses.

master
hristoterezov il y a 7 ans
Parent
révision
2b1c875b91

+ 5
- 1
lang/main.json Voir le fichier

@@ -587,10 +587,14 @@
587 587
         "invited": "Invited",
588 588
         "ringing": "Ringing",
589 589
         "calling": "Calling",
590
+        "initializingCall": "Initializing Call",
590 591
         "connected": "Connected",
591 592
         "connecting": "Connecting",
593
+        "connecting2": "Connecting*",
594
+        "disconnected": "Disconnected",
592 595
         "busy": "Busy",
593 596
         "rejected": "Rejected",
594
-        "ignored": "Ignored"
597
+        "ignored": "Ignored",
598
+        "expired": "Expired"
595 599
     }
596 600
 }

+ 72
- 16
react/features/presence-status/constants.js Voir le fichier

@@ -1,3 +1,5 @@
1
+// User invite statuses
2
+
1 3
 /**
2 4
  * Тhe status for a participant when it's invited to a conference.
3 5
  *
@@ -22,11 +24,50 @@ export const RINGING = 'Ringing';
22 24
 
23 25
 /**
24 26
  * A status for a participant that indicates the call is connected.
27
+ *
28
+ * @type {string}
29
+ */
30
+export const CONNECTED_USER = 'connected';
31
+
32
+/**
33
+ * The status for a participant when the invitation is received but the user
34
+ * has responded with busy message.
35
+ *
36
+ * @type {string}
37
+ */
38
+export const BUSY = 'Busy';
39
+
40
+/**
41
+ * The status for a participant when the invitation is rejected.
42
+ *
43
+ * @type {string}
44
+ */
45
+export const REJECTED = 'Rejected';
46
+
47
+/**
48
+ * The status for a participant when the invitation is ignored.
49
+ *
50
+ * @type {string}
51
+ */
52
+export const IGNORED = 'Ignored';
53
+
54
+/**
55
+  * The status for a participant when the invitation is expired.
56
+ *
57
+ * @type {string}
58
+ */
59
+export const EXPIRED = 'Expired';
60
+
61
+// Phone call statuses
62
+
63
+/**
64
+ * A status for a participant that indicates the call is in process of
65
+ * initialization.
25 66
  * NOTE: Currently used for phone numbers only.
26 67
  *
27 68
  * @type {string}
28 69
  */
29
-export const CONNECTED = 'Connected';
70
+export const INITIALIZING_CALL = 'Initializing Call';
30 71
 
31 72
 /**
32 73
  * A status for a participant that indicates the call is in process of
@@ -38,20 +79,30 @@ export const CONNECTED = 'Connected';
38 79
 export const CONNECTING = 'Connecting';
39 80
 
40 81
 /**
41
- * The status for a participant when the invitation is received but the user
42
- * has responded with busy message.
82
+ * A status for a participant that indicates the call is in process of
83
+ * connecting.
84
+ * NOTE: Currently used for phone numbers only.
85
+ *
86
+ * @type {string}
43 87
  */
44
-export const BUSY = 'Busy';
88
+export const CONNECTING2 = 'Connecting*';
89
+
45 90
 
46 91
 /**
47
- * The status for a participant when the invitation is rejected.
92
+ * A status for a phone number participant that indicates the call is connected.
93
+ *
94
+ * @type {string}
48 95
  */
49
-export const REJECTED = 'Rejected';
96
+export const CONNECTED_PHONE_NUMBER = 'Connected';
97
+
50 98
 
51 99
 /**
52
- * The status for a participant when the invitation is ignored.
100
+ * A status for a participant that indicates the call is disconnected.
101
+ * NOTE: Currently used for phone numbers only.
102
+ *
103
+ * @type {string}
53 104
  */
54
-export const IGNORED = 'Ignored';
105
+export const DISCONNECTED = 'Disconnected';
55 106
 
56 107
 /**
57 108
  * Maps the presence status values to i18n translation keys.
@@ -59,12 +110,17 @@ export const IGNORED = 'Ignored';
59 110
  * @type {Object<String, String>}
60 111
  */
61 112
 export const STATUS_TO_I18N_KEY = {
62
-    'Invited': 'presenceStatus.invited',
63
-    'Ringing': 'presenceStatus.ringing',
64
-    'Calling': 'presenceStatus.calling',
65
-    'Connected': 'presenceStatus.connected',
66
-    'Connecting': 'presenceStatus.connecting',
67
-    'Busy': 'presenceStatus.busy',
68
-    'Rejected': 'presenceStatus.rejected',
69
-    'Ignored': 'presenceStatus.ignored'
113
+    [INVITED]: 'presenceStatus.invited',
114
+    [RINGING]: 'presenceStatus.ringing',
115
+    [CALLING]: 'presenceStatus.calling',
116
+    [BUSY]: 'presenceStatus.busy',
117
+    [REJECTED]: 'presenceStatus.rejected',
118
+    [IGNORED]: 'presenceStatus.ignored',
119
+    [EXPIRED]: 'presenceStatus.expired',
120
+
121
+    [INITIALIZING_CALL]: 'presenceStatus.initializingCall',
122
+    [CONNECTING]: 'presenceStatus.connecting',
123
+    [CONNECTING2]: 'presenceStatus.connecting2',
124
+    [CONNECTED_PHONE_NUMBER]: 'presenceStatus.connected',
125
+    [DISCONNECTED]: 'presenceStatus.disconnected'
70 126
 };

+ 11
- 23
resources/prosody-plugins/mod_muc_poltergeist.lua Voir le fichier

@@ -36,10 +36,6 @@ local token_util = module:require "token/util".new(parentCtx);
36 36
 local disableTokenVerification
37 37
     = module:get_option_boolean("disable_polergeist_token_verification", false);
38 38
 
39
-local poltergeistExpiredStatus
40
-    = module:get_option_string("poltergeist_expired_status");
41
-
42 39
 -- table to store all poltergeists we create
43 40
 local poltergeists = {};
44 41
 -- table to mark that outgoing unavailable presences
@@ -240,31 +236,22 @@ function create_poltergeist_occupant(room, nick, name, avatar, status, context)
240 236
     room:handle_first_presence(
241 237
         prosody.hosts[poltergeist_component], join_presence);
242 238
 
243
-    local timeout = poltergeist_timeout;
244 239
     -- the timeout before removing so participants can see the status update
245 240
     local removeTimeout = 5;
246
-    if (poltergeistExpiredStatus) then
247
-        timeout = timeout - removeTimeout;
248
-    end
241
+    local timeout = poltergeist_timeout - removeTimeout;
249 242
 
250 243
     timer.add_task(timeout,
251 244
         function ()
252
-            if (poltergeistExpiredStatus) then
253
-                update_poltergeist_occupant_status(
254
-                    room, nick, poltergeistExpiredStatus);
255
-                -- and remove it after some time so participant can see
256
-                -- the update
257
-                timer.add_task(removeTimeout,
258
-                    function ()
259
-                        if (have_poltergeist_occupant(room, nick)) then
260
-                            remove_poltergeist_occupant(room, nick, false);
261
-                        end
262
-                    end);
263
-            else
264
-                if (have_poltergeist_occupant(room, nick)) then
265
-                    remove_poltergeist_occupant(room, nick, false);
266
-                end
267
-            end
245
+            update_poltergeist_occupant_status(
246
+                room, nick, "Expired");
247
+            -- and remove it after some time so participant can see
248
+            -- the update
249
+            timer.add_task(removeTimeout,
250
+                function ()
251
+                    if (have_poltergeist_occupant(room, nick)) then
252
+                        remove_poltergeist_occupant(room, nick, false);
253
+                    end
254
+                end);
268 255
         end);
269 256
 end
270 257
 

Chargement…
Annuler
Enregistrer