Parcourir la source

Merge pull request #3096 from jmacelroy/master

Cleaning up call flow presence stanzas and cancel triggers.
j8
Aaron van Meerten il y a 7 ans
Parent
révision
ff0d42a95b
Aucun compte lié à l'adresse e-mail de l'auteur

+ 0
- 2
resources/prosody-plugins/mod_muc_call.lua Voir le fichier

@@ -17,7 +17,6 @@ end
17 17
 
18 18
 -- Status strings that trigger call events.
19 19
 local calling_status   = "calling"
20
-local ringing_status   = "ringing"
21 20
 local busy_status      = "busy"
22 21
 local rejected_status  = "rejected"
23 22
 local connected_status = "connected"
@@ -53,7 +52,6 @@ end
53 52
 --    Status      | Event Type
54 53
 --    _________________________
55 54
 --    "calling"   | INVITE
56 55
 --    "busy"      | CANCEL
57 56
 --    "rejected"  | CANCEL
58 57
 --    "connected" | CANCEL
@@ -93,7 +91,6 @@ module:hook("muc-broadcast-presence", function (event)
93 91
 	local switch = function(status)
94 92
 	   case = {
95 93
 		  [calling_status]   = function() invite() end,
96
-		  [ringing_status]   = function() cancel() end,
97 94
 		  [busy_status]      = function() cancel() end,
98 95
 		  [rejected_status]  = function() cancel() end,
99 96
 		  [connected_status] = function() cancel() end

+ 8
- 1
resources/prosody-plugins/mod_muc_poltergeist.lua Voir le fichier

@@ -241,8 +241,14 @@ function create_poltergeist_occupant(room, nick, name, avatar, status, context)
241 241
         join:tag("password", { xmlns = MUC_NS }):text(room_password);
242 242
     end
243 243
 
244
+    -- Update the nil call id to the initial call id for call flows.
244 245
 	local call_id = get_username(room, context.user.id);
245
-	join_presence:tag("call_id"):text(get_username(room, context.user.id)):up();
246
+    join_presence:maptags(function (tag)
247
+        if tag.name == "call_id" then
248
+           return st.stanza("call_id"):text(call_id);
249
+        end
250
+        return tag;
251
+    end);
246 252
 
247 253
     update_presence_identity(
248 254
         join_presence,
@@ -356,6 +362,7 @@ function update_presence_tags(presence_stanza, status, call_details)
356 362
                 return st.stanza("call_cancel"):text("false");
357 363
             end
358 364
         end
365
+        return tag;
359 366
     end);
360 367
 
361 368
     return presence_stanza

Chargement…
Annuler
Enregistrer