Skip to content
This repository was archived by the owner on Mar 29, 2021. It is now read-only.

Commit 3a68c1c

Browse files
committed
fixes #118
more control for notifications
1 parent dd4194f commit 3a68c1c

3 files changed

Lines changed: 28 additions & 4 deletions

File tree

src/mods/core.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,14 @@ idrinth.core = {
159159
if ( window.Notification.permission === "denied" ) {
160160
return false;
161161
}
162-
return new window.Notification ( title, {
163-
icon: "https://dotd.idrinth.de/Resources/Images/logo.png",
164-
body: content
165-
} );
162+
var data = {};
163+
if(idrinth.settings.get ('notification#image')) {
164+
data.icon = "https://dotd.idrinth.de/Resources/Images/logo.png";
165+
}
166+
if(idrinth.settings.get ('notification#content')) {
167+
data.body = content;
168+
}
169+
return new window.Notification ( title, data );
166170
},
167171
/**
168172
*

src/mods/settings.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ idrinth.settings = {
134134
* @type Boolean
135135
*/
136136
message: true,
137+
/**
138+
*
139+
* @type Boolean
140+
*/
141+
content: true,
142+
/**
143+
*
144+
* @type Boolean
145+
*/
146+
image: true,
137147
/**
138148
*
139149
* @type Boolean

src/mods/ui.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,6 +744,16 @@ idrinth.ui = {
744744
rType: '#input',
745745
type: 'checkbox',
746746
label: 'chat.notification.message'
747+
}, {
748+
name: 'notification#content',
749+
rType: '#input',
750+
type: 'checkbox',
751+
label: 'chat.notification.content'
752+
}, {
753+
name: 'notification#image',
754+
rType: '#input',
755+
type: 'checkbox',
756+
label: 'chat.notification.image'
747757
} ], 'chat' ),
748758
{
749759
css: 'idrinth-line',

0 commit comments

Comments
 (0)