InnovateAsterisk / Browser-Phone

A fully featured browser based WebRTC SIP phone for Asterisk

Home Page:https://www.innovateasterisk.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Patch to restore missed call badge after client restart.

ArminXG opened this issue · comments

If you have a missed call and the badge is for it is shown, after restart of the client this info (badge) is not shown any longer.
This patch fixes it:

--- phone.js.bak	2024-01-08 15:21:31.596651767 +0100
+++ phone.js	2024-01-13 20:08:20.625728173 +0100
@@ -9517,7 +9517,7 @@
 
 // Buddy & Contacts
 // ================
-var Buddy = function(type, identity, CallerIDName, ExtNo, MobileNumber, ContactNumber1, ContactNumber2, lastActivity, desc, Email, jid, dnd, subscribe, subscription, autoDelete, pinned){
+var Buddy = function(type, identity, CallerIDName, ExtNo, MobileNumber, ContactNumber1, ContactNumber2, lastActivity, desc, Email, jid, dnd, subscribe, subscription, autoDelete, pinned, missed){
     this.type = type; // extension | xmpp | contact | group
     this.identity = identity;
     this.jid = jid;
@@ -9531,7 +9531,7 @@
     this.lastActivity = lastActivity; // Full Date as string eg "1208-03-21 15:34:23 UTC"
     this.devState = "dotOffline";
     this.presence = "Unknown";
-    this.missed = 0;
+    this.missed = (typeof missed !== 'undefined')? missed : 0;
     this.IsSelected = false;
     this.imageObjectURL = "";
     this.presenceText = lang.default_status;
@@ -9772,7 +9772,8 @@
                                     item.Subscribe,
                                     item.SubscribeUser,
                                     item.AutoDelete,
-                                    item.Pinned);
+                                    item.Pinned,
+                                    item.missed);
             AddBuddy(buddy, false, false, false);
         }
         else if(item.Type == "xmpp"){
@@ -9812,7 +9813,8 @@
                                     item.Subscribe,
                                     item.SubscribeUser,
                                     item.AutoDelete,
-                                    item.Pinned);
+                                    item.Pinned,
+                                    item.missed);
             AddBuddy(buddy, false, false, false);
         }
         else if(item.Type == "group"){

Thank you!