From f5049055d249da7c8977f8dbbbfb2f836c45d299 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 2 Feb 2021 14:08:30 -0800 Subject: [PATCH] Added remote typing icon to messenger. --- agents/meshcore.js | 20 +++++++++++--------- public/images/3dots-24.gif | Bin 0 -> 7338 bytes public/images/3dots-48.gif | Bin 0 -> 13424 bytes views/messenger.handlebars | 34 +++++++++++++++++++++++++++++++--- 4 files changed, 42 insertions(+), 12 deletions(-) create mode 100644 public/images/3dots-24.gif create mode 100644 public/images/3dots-48.gif diff --git a/agents/meshcore.js b/agents/meshcore.js index 50f40117..7992b1c2 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -580,9 +580,9 @@ function getIpLocationDataEx(func) { // Remove all Gateway MAC addresses for interface list. This is useful because the gateway MAC is not always populated reliably. function clearGatewayMac(str) { - if (str == null) return null; + if (typeof str != 'string') return null; var x = JSON.parse(str); - for (var i in x.netif) { if (x.netif[i].gatewaymac) { delete x.netif[i].gatewaymac } } + for (var i in x.netif) { try { if (x.netif[i].gatewaymac) { delete x.netif[i].gatewaymac } } catch (ex) { } } return JSON.stringify(x); } @@ -4207,13 +4207,15 @@ function sendNetworkUpdateNagle() { if (sendNetworkUpdateNagleTimer != null) { c function sendNetworkUpdate(force) { sendNetworkUpdateNagleTimer = null; - // Update the network interfaces information data - var netInfo = { netif2: require('os').networkInterfaces() }; - if (netInfo.netif2) { - netInfo.action = 'netinfo'; - var netInfoStr = JSON.stringify(netInfo); - if ((force == true) || (clearGatewayMac(netInfoStr) != clearGatewayMac(lastNetworkInfo))) { mesh.SendCommand(netInfo); lastNetworkInfo = netInfoStr; } - } + try { + // Update the network interfaces information data + var netInfo = { netif2: require('os').networkInterfaces() }; + if (netInfo.netif2) { + netInfo.action = 'netinfo'; + var netInfoStr = JSON.stringify(netInfo); + if ((force == true) || (clearGatewayMac(netInfoStr) != clearGatewayMac(lastNetworkInfo))) { mesh.SendCommand(netInfo); lastNetworkInfo = netInfoStr; } + } + } catch (ex) { } } // Called periodically to check if we need to send updates to the server diff --git a/public/images/3dots-24.gif b/public/images/3dots-24.gif new file mode 100644 index 0000000000000000000000000000000000000000..02cad79af275d3e4301b3cb61f2ffe4804a3496b GIT binary patch literal 7338 zcmb`LXI#_ymd5{ph$3iEK!}b+kSZvGa6@s1ZbB0T6%gsYi+~6WB_X6i1Sv`{p#?}n zNN7n=I-v?EN)uEBsiKZfy`vitcjnHH>*#J?;J|^Vrl#iRW;UDM)6*j>E32resG_2xuCA`BsYxUfD=I3g zs;a0|Dvd_d(9k$_>Xd{d!hbR!&Y%Sy`Epklw+7Z@0L`SRtku(0Up=;Y+&)YMcbCnpaN4}X9ExVX6Z_;?!| z8%IaSt5>ha#Ka(xNDKy(k&(gSa10F%&CSh2Lqo&E!_(8#3knL<)YN=^ee?74tE;Oe zB_&l=RVyni$z*a}U7e|^X-P?my}f-xLPAETxY-}tZk0%fa z78VxQu3bw?O3KX4)X~ui4h}9aFF$hRh_$u#l`B^wBO}phbZ%}golaL)R@T?oKY#wb zv$OMN{{By2hu`nAG`6)d)VDHLJEqFV!~HYvPw+rjZ%+$XZ(nzRVQ<&KK-W{M$4+XT z)X)G9|FVt81K0)}eg`oO^>hvM^nhIT4fBC`MtS>s9di#3gq(((KmuL;JwpNIjmS21 z2KcVQnA7i6`{30r(3L^f`-2c%DntlrUt$=NQhTMYa(LUx70Zyj1I_n&_ZzK2T1t8C z7$Ufn@X^yQ+w-l?dsGehwM+^;6gZ^YKXt-osVl0?FXBP|{N*?+`2;)Na#EyLlwi!s z*bo_6b)`KqNJwhhjr5Gntedy??EE~=c5ak^gu0CY;(QF#MST|jbxw3Rr@1o!p<+&AhjIKhibEVv+fTN<^FwUk({}|mCRXJs&qlT znXd3|g?-od?lWnD_V)D;3=Z8L9#J~{#Z+bglPb*1{z6j3!IY$XTEe2pBXwm{S}Na; zn!v^aOcP2qC0$P48TEUs)ECq!I5z(q8v}8>ED}Pg9(U1GwVVf1!+jLQBF~5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I5pr&&Yx9|EYRG{-uGS$IxfTDiBj&U}TQdNcEr(FAYN@%`#i!$3@~=I|sGbo-q!>t7(C z?rOg%EmRyo+>S$pT>418^Z$kV(}fLHlvjjqQ7b9PD<~3ddH6nOS)mV0s#mnv=pjot=L^%=JDG$0uKv zGyrpbXZH)vSOH?F-xMloTe_4ecm}Pv#DZ}|t5W_{ z*x;`y?BV!N-4D2S$5(R;R!vR0oB)-oAxlBItaM(Ka${2y{ye4SJhG0?KvpPgHuf~C z;e1;t8i=;`4xqWYrxtTzsO18%sqq74tnD<#7I^Xm@a=xqM!- z=(oqh(+mgT-(43utA|>Ge>FO+o4ION=ZTFh`%TP3$^huDsO;xOKN)Lb#~G#?iT7H1-~&B{U@8^FLtQ^lNs1FKwB9A>y_&f?8R%y;`Sdh zpapJf25aG=lsnMP95gbSY^>cKiUgvgvy0o?O?ui`hrv4zz{n^OfIi@~p{1uO(i>J)toLu?F1!cN-BLjHeFFzlBQvUQU7lhsz<0Tk< zCy_Xs^= zwDXk=YGv}fAS|L@Ml;3P80cHpFncpMrEDPZo#1HZ+J2&Vu6BzLtU8NiSZPaZ|3iM; zuaJN6Q}U;8nWC)>7z>b$3G)0DD!)880rk8nBNCHjgmb(~)nQEAcH~iCV3zn?qY(gj| zrx^KQ?GWkWn2^%1C`&s=G>GRJqEXrUsCV6todXI!?sWuQcfj&ClY+z6d*HjD#;@v$ Q?7kJcCBGhWtx&QzG literal 0 HcmV?d00001 diff --git a/public/images/3dots-48.gif b/public/images/3dots-48.gif new file mode 100644 index 0000000000000000000000000000000000000000..7b63dba4b0b4c04c6bf06bde0b4854d7b66fb856 GIT binary patch literal 13424 zcmdU#S6CBj)~Evnr79#rr3fkXCcRln2oR7KiZoFa6a*9ykSaY8I-&O#YUsU}(0lI! z3P@9=*vr-v_w1SZ_xa~MGtPPDKhNPJ7hI9=Wwm!LHH@l)qUCLX1mFYU=TCckJDE)G z?(QBL8G%3`=g*&q!{LpMjZIBW9UUE=ot;8LLJA5BS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uO3yto)s;$YP63jrPRxUoU*Qzes2+It;(UBGv@0w@Xqg47|w*G&^dZI}Emrdob zG&nY+2l_>4uUysoqruUW5Tc?Bp`#L#u;7Ba#kf&!KYVm6cLsGHYstgl^2nPZ#;dfA zm!_&rzX&ymUTEZ@Tw)oALj;%pYfh zm8f-cz|Mz@F>XxOyIvs4`IxXVoK-r1KB7DtYKG@hBoQ(Cg8Fw%2SM?}NilbZzM*Qi z8j}QBoK`2B;yTe;p>j&}g0%o;*a>C+&FyJph=*1kRpSi<9>c`&f_N{*SQ`yDb+Bp^ zPG4jucg=IIG@x`t%1vta)aRw~oOmyvL{mDQi~kFO@+C(A literal 0 HcmV?d00001 diff --git a/views/messenger.handlebars b/views/messenger.handlebars index 813c7e1a..9ac14ff7 100644 --- a/views/messenger.handlebars +++ b/views/messenger.handlebars @@ -29,13 +29,14 @@
+
- + @@ -83,6 +84,8 @@ if (webrtcconfiguration == '') { webrtcconfiguration = null; } else { try { webrtcconfiguration = JSON.parse(decodeURIComponent(webrtcconfiguration)); } catch (ex) { console.log('Invalid WebRTC config: "' + webrtcconfiguration + '".'); webrtcconfiguration = null; } } var windowFocus = true; var chatTextSession = new Date().toString() + '\r\n'; + var localOutText = false; + var remoteOutText = false; // File transfer state var fileUploads = []; @@ -136,6 +139,7 @@ // Backspace var outtext = Q('xouttext').value; if (outtext.length > 0) { Q('xouttext').value = outtext.substring(0, outtext.length - 1); } + updateLocalOutText(); } } if (userInputFocus == 0) { haltEvent(e); return false; } @@ -151,7 +155,7 @@ xsend(e); } else { // Any other key - if ((userInputFocus == 0) && (e.key.length == 1)) { Q('xouttext').value = Q('xouttext').value + e.key; } + if ((userInputFocus == 0) && (e.key.length == 1)) { Q('xouttext').value = Q('xouttext').value + e.key; updateLocalOutText(); } } } if (userInputFocus == 0) { haltEvent(e); return false; } @@ -233,6 +237,7 @@ if ((state == 2) || pushMessaging) { send({ action: 'chat', msg: outtext }); } Q('xouttext').value = ''; Q('xouttext').focus(); + localOutText = false; } } @@ -247,6 +252,7 @@ QV('camButton', webchannel && webchannel.ok && !localStream && (userMediaSupport == 2)); QV('micButton', webchannel && webchannel.ok && !localStream && (userMediaSupport > 0)); QV('hangupButton', webchannel && webchannel.ok && localStream); + updateLocalOutText(); } // This is the WebRTC setup @@ -345,6 +351,8 @@ if (socket != null) { socket.close(); socket = null; } updateControls(); state = 0; + updateLocalOutText(); + updateRemoteOutText(); } // Send data over the current transport (WebRTC first) @@ -372,7 +380,8 @@ try { data = JSON.parse(data); } catch (ex) { console.log('Unable to parse', data); return; } //console.log('RECV', data); switch (data.action) { - case 'chat': { displayRemote(data.msg); break; } // Incoming chat message. + case 'chat': { displayRemote(data.msg); updateRemoteOutText(false); break; } // Incoming chat message. + case 'outtext': { updateRemoteOutText(data.value); break; } case 'ctrl': { if (data.value == 1) { displayControl("Sent as push notification."); } else if (data.value == 2) { displayControl("Push notification failed."); } @@ -688,6 +697,8 @@ state = 2; updateControls(); sendws({ action: 'random', random: random }); // Send a random number. Higher number starts the WebRTC session. + updateLocalOutText(); + updateRemoteOutText(); return; } if (msg.data[0] == '{') { processMessage(msg.data, 1); } @@ -726,6 +737,23 @@ return r; } + function updateLocalOutText() { + var l = Q('xouttext').value; + if (((state != 2) || (l == '')) && (localOutText == true)) { + localOutText = false; + send({ action: 'outtext', value: false }); + } else if ((state == 2) && ((l != '') && (localOutText == false))) { + localOutText = true; + send({ action: 'outtext', value: true }); + } + } + + function updateRemoteOutText(newState) { + //console.log('updateRemoteOutText', newState); + if (state != 2) { newState = false; } + if (remoteOutText != newState) { remoteOutText = newState; QV('typingIndicator', remoteOutText); } + } +