Skip to content

Commit

Permalink
fix: show text for report notifications (nolanlawson#2318)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Dec 11, 2022
1 parent f61054a commit 276c6e7
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/intl/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ export default {
accountFollowedYou: '{name} followed you, {account}',
accountSignedUp: '{name} signed up, {account}',
accountRequestedFollow: '{name} requested to follow you, {account}',
accountReported: '{name} filed a report, {account}',
reblogCountsHidden: 'Boost counts hidden',
favoriteCountsHidden: 'Favorite counts hidden',
rebloggedTimes: `Boosted {count, plural,
Expand All @@ -514,6 +515,7 @@ export default {
followedYou: 'followed you',
edited: 'edited their toot',
requestedFollow: 'requested to follow you',
reported: 'filed a report',
signedUp: 'signed up',
posted: 'posted',
pollYouCreatedEnded: 'A poll you created has ended',
Expand Down
2 changes: 1 addition & 1 deletion src/routes/_api/timelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function getTimeline (instanceName, accessToken, timeline, maxId, s
}

if (timeline === 'notifications/mentions') {
params.exclude_types = ['follow', 'favourite', 'reblog', 'poll', 'admin.sign_up', 'update', 'follow_request']
params.exclude_types = ['follow', 'favourite', 'reblog', 'poll', 'admin.sign_up', 'update', 'follow_request', 'admin.report']
}

url += '?' + paramsString(params)
Expand Down
2 changes: 2 additions & 0 deletions src/routes/_components/status/Notification.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
return formatIntl('intl.accountSignedUp', params)
} else if (notificationType === 'follow_request') {
return formatIntl('intl.accountRequestedFollow', params)
} else if (notificationType === 'admin.report') {
return formatIntl('intl.accountReported', params)
} else { // 'follow'
return formatIntl('intl.accountFollowedYou', params)
}
Expand Down
4 changes: 4 additions & 0 deletions src/routes/_components/status/StatusHeader.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
return '#fa-pencil'
} else if (notificationType === 'follow_request') {
return '#fa-hourglass'
} else if (notificationType === 'admin.report') {
return '#fa-flag'
}
return '#fa-star'
},
Expand All @@ -167,6 +169,8 @@
return 'intl.edited'
} else if (notificationType === 'follow_request') {
return 'intl.requestedFollow'
} else if (notificationType === 'admin.report') {
return 'intl.reported'
} else {
return ''
}
Expand Down
1 change: 1 addition & 0 deletions src/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ async function showRichNotification (data, notification) {
switch (notification.type) {
case 'follow':
case 'follow_request':
case 'admin.report':
case 'admin.sign_up': {
await self.registration.showNotification(data.title, {
badge,
Expand Down

0 comments on commit 276c6e7

Please sign in to comment.