diff --git a/recipes/groupme/package.json b/recipes/groupme/package.json index f282c9af0..06c02b178 100644 --- a/recipes/groupme/package.json +++ b/recipes/groupme/package.json @@ -1,7 +1,7 @@ { "id": "groupme", "name": "GroupMe", - "version": "1.3.0", + "version": "1.3.1", "license": "MIT", "config": { "serviceURL": "https://web.groupme.com", diff --git a/recipes/groupme/webview.js b/recipes/groupme/webview.js index 0f0d3a6ba..680f12e3c 100644 --- a/recipes/groupme/webview.js +++ b/recipes/groupme/webview.js @@ -7,20 +7,18 @@ const _path = _interopRequireDefault(require('path')); module.exports = Ferdium => { const getMessages = () => { // array-ify the list of conversations - const allConversations = [ - ...document.querySelectorAll('#tray .tray-list .list-item'), + const unreadConversations = [ + ...document.querySelectorAll('#tray .tray-list .list-item.unread'), ]; // for each conversation on the list... - const filteredConversations = allConversations.filter(e => { - // keep it on the list if [1] it has unread messages (not .ng-hide), and [2] it isn't muted (not .overlay) - return ( - !e.innerHTML.includes('ng-hide') && !e.innerHTML.includes('overlay') - ); + const filteredConversations = unreadConversations.filter(e => { + // keep it on the list if it isn't muted (not .muted) + return !e.innerHTML.includes('muted'); }); - const unreadConversations = filteredConversations.length; + const unreadUnmutedConversations = filteredConversations.length; // set Ferdium badge - Ferdium.setBadge(unreadConversations); + Ferdium.setBadge(unreadUnmutedConversations); }; Ferdium.loop(getMessages);