aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Sampath Kumar Krishnan <sampathBlam@users.noreply.github.com>2020-04-18 11:16:04 +0530
committerLibravatar Sampath Kumar Krishnan <sampathBlam@users.noreply.github.com>2020-04-18 11:16:04 +0530
commit8698ff27fa039a5b8fc7d9eb1985ebf3135b07e8 (patch)
tree3511fb4b978d8f7ac81915c12aafeddef04cfc1c
parentRepackage Jitsi recipe (diff)
downloadferdium-recipes-8698ff27fa039a5b8fc7d9eb1985ebf3135b07e8.tar.gz
ferdium-recipes-8698ff27fa039a5b8fc7d9eb1985ebf3135b07e8.tar.zst
ferdium-recipes-8698ff27fa039a5b8fc7d9eb1985ebf3135b07e8.zip
fix: Update notification handling in hangouts chat
- Fix the logic of handling direct and indirect messages - Update the modified class names - Refactor webview.js - Update png and svg icons (they were not 1024x1024) - Fixes #102 Co-Authored-By: Mahadevan Sreenivasan <mahadevan_sv@yahoo.com>
-rw-r--r--all.json2
-rw-r--r--archives/hangoutschat.tar.gzbin10244 -> 113815 bytes
-rw-r--r--uncompressed/hangoutschat/icon.pngbin5414 -> 112748 bytes
-rw-r--r--uncompressed/hangoutschat/icon.svg37
-rw-r--r--uncompressed/hangoutschat/package.json2
-rw-r--r--uncompressed/hangoutschat/webview.js23
6 files changed, 25 insertions, 39 deletions
diff --git a/all.json b/all.json
index a7f19dd..8b53691 100644
--- a/all.json
+++ b/all.json
@@ -345,7 +345,7 @@
345 "featured": false, 345 "featured": false,
346 "id": "hangoutschat", 346 "id": "hangoutschat",
347 "name": "Hangouts Chat", 347 "name": "Hangouts Chat",
348 "version": "1.2.1", 348 "version": "1.2.2",
349 "icons": { 349 "icons": {
350 "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/hangoutschat/icon.png", 350 "png": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/hangoutschat/icon.png",
351 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/hangoutschat/icon.svg" 351 "svg": "https://cdn.jsdelivr.net/gh/getferdi/recipes/uncompressed/hangoutschat/icon.svg"
diff --git a/archives/hangoutschat.tar.gz b/archives/hangoutschat.tar.gz
index 609643e..4aaa597 100644
--- a/archives/hangoutschat.tar.gz
+++ b/archives/hangoutschat.tar.gz
Binary files differ
diff --git a/uncompressed/hangoutschat/icon.png b/uncompressed/hangoutschat/icon.png
index 288e3ba..2f7120e 100644
--- a/uncompressed/hangoutschat/icon.png
+++ b/uncompressed/hangoutschat/icon.png
Binary files differ
diff --git a/uncompressed/hangoutschat/icon.svg b/uncompressed/hangoutschat/icon.svg
index eae3ddd..9238971 100644
--- a/uncompressed/hangoutschat/icon.svg
+++ b/uncompressed/hangoutschat/icon.svg
@@ -1,30 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<svg width="80px" height="80px" viewBox="0 0 80 80" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 2<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024" viewBox="0 0 1024 1024" version="1.1">
3 <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch --> 3<g id="surface1">
4 <title>hangoutschat</title> 4<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,53.72549%,48.235294%);fill-opacity:1;" d="M 512 0 C 276.351562 0 85.332031 191.039062 85.332031 426.730469 C 85.332031 662.421875 276.351562 853.460938 512 853.460938 L 512 1024 C 532.308594 1024 938.667969 812.800781 938.667969 426.730469 C 938.667969 191.039062 747.648438 0 512 0 Z M 512 0 "/>
5 <desc>Created with Sketch.</desc> 5<path style=" stroke:none;fill-rule:nonzero;fill:rgb(0%,47.45098%,41.960784%);fill-opacity:1;" d="M 931.625 514.347656 C 901.121094 698.878906 779.519531 836.265625 674.988281 921.601562 L 346.027344 592.640625 C 254.292969 500.90625 254.292969 352.425781 346.027344 260.691406 C 437.761719 168.960938 586.238281 168.960938 677.972656 260.691406 Z M 931.625 514.347656 "/>
6 <defs> 6<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 512 554.667969 C 441.40625 554.667969 384 497.257812 384 426.667969 C 384 356.074219 441.40625 298.667969 512 298.667969 C 569.769531 298.667969 640 356.074219 640 426.667969 C 640 497.257812 582.59375 554.667969 512 554.667969 Z M 512 352 C 470.335938 352 437.332031 384 437.332031 426.667969 C 437.332031 469.332031 468.886719 501.332031 512 501.332031 C 559.0625 501.332031 586.667969 473.726562 586.667969 426.667969 C 586.667969 379.605469 559.0625 352 512 352 Z M 512 352 "/>
7 <path d="M67.9018789,28.2204882 C66.6910039,21.6010607 63.8001645,15.8184624 59.2336961,10.8844306 C57.3057472,8.80126937 55.146722,6.99067533 52.7626899,5.45395266 C48.3228149,2.59177951 43.4853845,0.838568044 38.2399937,0.216923512 C37.6005233,0.141282848 36.9519487,0.15084661 36.3215827,0 L31.7954334,0 C31.7460099,0.114330428 31.6410934,0.0725976482 31.5582874,0.0799878279 C30.3933676,0.183450345 29.2327832,0.316038864 28.0834707,0.534701241 C19.6784462,2.1318495 12.7760685,6.26948073 7.43356489,12.953681 C3.03921152,18.4511053 0.619195683,24.7571022 0.0963474024,31.7882061 C-0.156839493,35.1955137 0.0889772359,38.5719564 0.833797589,41.9023192 C1.38742715,44.3806377 2.2128858,46.7741865 3.32404678,49.062534 C3.42115956,49.2572869 3.51827234,49.4524746 3.61668574,49.6463582 C5.44145225,53.2497229 7.78906704,56.4601039 10.7306305,59.2331602 C12.2796661,60.6933727 13.9340517,62.0136066 15.7267363,63.1547373 C21.2170768,66.6489882 27.2103228,68.4813181 33.7212145,68.5634795 C34.1205041,68.5686961 34.2293225,68.6678114 34.2271548,69.0768796 C34.2089461,72.5711305 34.2163163,76.0658161 34.2171834,79.5605017 C34.2176169,79.6961332 34.2284554,79.83133 34.2358256,80 C34.3481122,79.9534853 34.4187791,79.9278371 34.4872783,79.8956681 C41.0319861,76.8122242 47.0421401,72.9158606 52.4002512,68.0318212 C53.4663241,67.0597952 54.4864418,66.0416893 55.467541,64.9818506 C55.8876405,64.5284413 56.3038381,64.0667724 56.7252383,63.6142326 C57.3755471,62.9169474 57.9382809,62.1375008 58.5517389,61.4036994 C59.2592749,60.5568718 59.8948434,59.6570087 60.5217411,58.7510596 C61.9081994,56.7487556 63.1455203,54.6599431 64.1860144,52.4533223 C64.712331,51.3374052 65.2139359,50.2132284 65.6570129,49.0629687 C65.6717533,49.0412329 65.6916961,49.0221053 65.7008004,48.9981959 C66.9095077,45.8473711 67.6842423,42.5869976 68.0969716,39.2414198 C68.2409066,38.0768144 68.3341175,36.9039494 68.3926453,35.7323885 C68.5183717,33.2114678 68.3557945,30.7027192 67.9018789,28.2204882" id="path-1"></path> 7<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,100%,100%);fill-opacity:1;" d="M 512 661.332031 C 384.789062 661.332031 277.332031 553.855469 277.332031 426.667969 C 277.332031 299.476562 384.789062 192 512 192 C 639.210938 192 746.667969 299.476562 746.667969 426.667969 C 746.667969 506.816406 717.953125 554.667969 669.867188 554.667969 C 642.773438 554.667969 597.332031 538.046875 597.332031 426.667969 L 597.332031 320 L 640 320 L 640 426.667969 C 640 480.105469 651.15625 512 669.867188 512 C 693.441406 512 704 469.140625 704 426.667969 C 704 322.601562 616.085938 234.667969 512 234.667969 C 407.914062 234.667969 320 322.601562 320 426.667969 C 320 530.730469 407.914062 618.667969 512 618.667969 C 564.542969 618.667969 599.105469 601.707031 599.445312 601.515625 L 618.539062 639.679688 C 616.746094 640.574219 574.507812 661.332031 512 661.332031 Z M 512 661.332031 "/>
8 <path d="M37.8634293,35.3543361 C37.866947,32.1384791 35.8223623,29.9435997 32.8150153,29.9360925 C29.8555628,29.9283073 27.6618825,32.207434 27.6459176,35.3065125 C27.629141,38.5451691 29.7687031,40.9163284 32.7541323,40.8968653 C35.8908218,40.876012 38.0947845,38.3327435 37.8634293,35.3543361 M39.0358996,42.0674306 C35.2327448,46.8508997 29.2280625,45.6694908 26.4177056,43.1125981 C22.5409501,39.5856098 22.0111331,33.1825343 25.3172125,28.9039931 C28.4725728,24.8206388 33.1151005,24.4338796 38.0081955,27.9166589 C38.0412075,27.374473 38.0712431,26.8859497 38.1107494,26.2392193 L42.2775784,26.2392193 C42.2775784,26.830897 42.2775784,27.4097846 42.2773078,27.9883942 C42.276496,31.3699654 42.2575547,34.7515367 42.2808255,38.1328299 C42.2938138,40.060787 43.0587743,41.1782459 44.3881873,41.3525795 C45.8323308,41.5422055 46.7964461,40.7342096 47.3005569,38.9121872 C48.8740429,33.2250751 46.7247395,26.9557388 41.986152,23.4109557 C33.7071534,17.2178034 21.7979075,21.5419439 19.398037,31.6132539 C17.3596759,40.168112 22.7663523,48.3159136 31.2371998,49.6563638 C34.1609343,50.1193071 36.8395134,49.5192881 39.6141523,48.3665176 C40.1152867,49.6541394 40.591256,50.8761429 41.1930501,52.4226236 C39.4991512,52.9066983 37.9565126,53.5639943 36.3592146,53.7669664 C29.14905,54.6831214 22.89813,52.6358834 18.3386737,46.6445911 C9.82561395,35.4586026 16.069228,19.2530856 29.7592324,16.7331727 C38.5537067,15.1146786 46.6773861,19.2322323 50.3501162,27.3216447 C52.284841,31.5832252 52.6376915,36.0060712 51.03877,40.5237303 C49.0761743,46.06904 42.0356701,47.1648114 39.0358996,42.0674306" id="path-3"></path> 8</g>
9 <filter x="-23.9%" y="-23.9%" width="147.9%" height="147.9%" filterUnits="objectBoundingBox" id="filter-4"> 9</svg>
10 <feOffset dx="0" dy="0" in="SourceAlpha" result="shadowOffsetOuter1"></feOffset>
11 <feGaussianBlur stdDeviation="3" in="shadowOffsetOuter1" result="shadowBlurOuter1"></feGaussianBlur>
12 <feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.233723958 0" type="matrix" in="shadowBlurOuter1"></feColorMatrix>
13 </filter>
14 </defs>
15 <g id="icons" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
16 <g id="hangoutschat">
17 <g id="Group-11" transform="translate(6.000000, 0.000000)">
18 <mask id="mask-2" fill="white">
19 <use xlink:href="#path-1"></use>
20 </mask>
21 <use id="Fill-1" fill="#009585" xlink:href="#path-1"></use>
22 <polygon id="Path-2" fill="#008375" mask="url(#mask-2)" points="18.313253 46.448374 47.2572637 76.1445783 67.4698795 54.4236818 67.4698795 41.9750224 47.2572637 21.4115799 35.1746623 18.313253 24.0791919 21.4115799 18.313253 29.3940121"></polygon>
23 <g id="Fill-1" mask="url(#mask-2)">
24 <use fill="black" fill-opacity="1" filter="url(#filter-4)" xlink:href="#path-3"></use>
25 <use fill="#F5F5F5" fill-rule="evenodd" xlink:href="#path-3"></use>
26 </g>
27 </g>
28 </g>
29 </g>
30</svg> \ No newline at end of file
diff --git a/uncompressed/hangoutschat/package.json b/uncompressed/hangoutschat/package.json
index 4b69fd3..3dce42f 100644
--- a/uncompressed/hangoutschat/package.json
+++ b/uncompressed/hangoutschat/package.json
@@ -1,7 +1,7 @@
1{ 1{
2 "id": "hangoutschat", 2 "id": "hangoutschat",
3 "name": "Hangouts Chat", 3 "name": "Hangouts Chat",
4 "version": "1.2.1", 4 "version": "1.2.2",
5 "description": "Hangouts Chat", 5 "description": "Hangouts Chat",
6 "main": "index.js", 6 "main": "index.js",
7 "author": "Stefan Malzner <stefan@adlk.io> and Iván López (ilopmar)", 7 "author": "Stefan Malzner <stefan@adlk.io> and Iván López (ilopmar)",
diff --git a/uncompressed/hangoutschat/webview.js b/uncompressed/hangoutschat/webview.js
index ea8a1b2..9597f58 100644
--- a/uncompressed/hangoutschat/webview.js
+++ b/uncompressed/hangoutschat/webview.js
@@ -1,29 +1,36 @@
1module.exports = (Franz) => { 1module.exports = (Franz) => {
2 2
3 // class corresponding to the mute icon
3 const muteSelector = '.DQy0Rb'; 4 const muteSelector = '.DQy0Rb';
4 const directMessageSelector = '.eM5l9e.FVKzAb'; 5
5 const indirectMessageSelector = '.PL5Wwe.H7du2 .t5F5nf'; 6 // class corresponding to the red badge that is visible for direct messages
7 const directMessageSelector = '.SaMfhe.m9MHid';
8
9 // class corresponding to the bold text that is visible for all messages
10 const allMessageSelector = '.IL9EXe.PL5Wwe.dHI9xe.H7du2';
6 11
7 const isMuted = node => !!node.closest('[role="listitem"]').querySelector(muteSelector); 12 const isMuted = node => !!node.closest('[role="listitem"]').querySelector(muteSelector);
8 13
9 const getMessages = function getMessages() { 14 const getMessages = function getMessages() {
10 15 let allMessageCount = 0;
11 // get unread messages
12 let directCount = 0; 16 let directCount = 0;
17
18 // get unread direct messages
13 document.querySelectorAll(directMessageSelector).forEach((node) => { 19 document.querySelectorAll(directMessageSelector).forEach((node) => {
14 // Hangouts Chat overrides the muted indicator when there is a direct mention 20 // Hangouts Chat overrides the muted indicator when there is a direct mention
15 if (!isMuted(node)) { 21 // Check for the width of the badge element
22 if (!isMuted(node) && node.clientWidth != 0 ) {
16 directCount += 1; 23 directCount += 1;
17 } 24 }
18 }); 25 });
19 26
20 let indirectCount = 0; 27 let indirectCount = 0;
21 document.querySelectorAll(indirectMessageSelector).forEach((node) => { 28 document.querySelectorAll(allMessageSelector).forEach((node) => {
22 if (!isMuted(node)) { 29 if (!isMuted(node)) {
23 indirectCount += 1; 30 allMessageCount += 1;
24 } 31 }
25 }); 32 });
26 indirectCount -= directCount; 33 indirectCount = allMessageCount - directCount;
27 34
28 // set Franz badge 35 // set Franz badge
29 Franz.setBadge(directCount, indirectCount); 36 Franz.setBadge(directCount, indirectCount);