Skip to content

Commit

Permalink
fix: show proper notification text for follow request (nolanlawson#2314)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Dec 11, 2022
1 parent 040462f commit b1dc43a
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 @@ -497,6 +497,7 @@ export default {
}: {description}`,
accountFollowedYou: '{name} followed you, {account}',
accountSignedUp: '{name} signed up, {account}',
accountRequestedFollow: '{name} requested to follow you, {account}',
reblogCountsHidden: 'Boost counts hidden',
favoriteCountsHidden: 'Favorite counts hidden',
rebloggedTimes: `Boosted {count, plural,
Expand All @@ -512,6 +513,7 @@ export default {
favoritedYou: 'favorited your toot',
followedYou: 'followed you',
edited: 'edited their toot',
requestedFollow: 'requested to follow you',
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']
params.exclude_types = ['follow', 'favourite', 'reblog', 'poll', 'admin.sign_up', 'update', 'follow_request']
}

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 @@ -76,6 +76,8 @@
}
if (notificationType === 'admin.sign_up') {
return formatIntl('intl.accountSignedUp', params)
} else if (notificationType === 'follow_request') {
return formatIntl('intl.accountRequestedFollow', 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 @@ -139,6 +139,8 @@
return '#fa-user-plus'
} else if (notificationType === 'update') {
return '#fa-pencil'
} else if (notificationType === 'follow_request') {
return '#fa-hourglass'
}
return '#fa-star'
},
Expand All @@ -163,6 +165,8 @@
return 'intl.reblogged'
} else if (notificationType === 'update') {
return 'intl.edited'
} else if (notificationType === 'follow_request') {
return 'intl.requestedFollow'
} 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 @@ -215,6 +215,7 @@ async function showRichNotification (data, notification) {

switch (notification.type) {
case 'follow':
case 'follow_request':
case 'admin.sign_up': {
await self.registration.showNotification(data.title, {
badge,
Expand Down

0 comments on commit b1dc43a

Please sign in to comment.