Follow request notifications
I'm not sure why the other clients don't have these. I want them!
This commit is contained in:
parent
3814ee8f62
commit
dae4d98f54
@ -762,6 +762,14 @@ notifyNotification notification =
|
||||
, clickUrl = "#account/" ++ notification.account.id
|
||||
}
|
||||
|
||||
"follow_request" ->
|
||||
Ports.notify
|
||||
{ title = notification.account.acct ++ " sent you a follow request"
|
||||
, icon = notification.account.avatar
|
||||
, body = notification.account.note
|
||||
, clickUrl = "#account/" ++ notification.account.id
|
||||
}
|
||||
|
||||
_ ->
|
||||
Cmd.none
|
||||
|
||||
|
@ -176,6 +176,7 @@ aggregateNotifications notifications =
|
||||
, notifications |> only "favourite" |> groupWhile sameStatus |> aggregate
|
||||
, notifications |> only "mention" |> groupWhile sameStatus |> aggregate
|
||||
, notifications |> only "follow" |> groupWhile (\_ _ -> True) |> aggregate
|
||||
, notifications |> only "follow_request" |> groupWhile (\_ _ -> True) |> aggregate
|
||||
]
|
||||
|> List.concat
|
||||
|> List.sortBy .created_at
|
||||
|
@ -166,7 +166,7 @@ type alias Mention =
|
||||
type alias Notification =
|
||||
{-
|
||||
- id: The notification ID
|
||||
- type_: One of: "mention", "reblog", "favourite", "follow"
|
||||
- type_: One of: "mention", "reblog", "favourite", "follow", "follow_request", "poll", "status"
|
||||
- created_at: The time the notification was created
|
||||
- account: The Account sending the notification to the user
|
||||
- status: The Status associated with the notification, if applicable
|
||||
|
@ -47,7 +47,7 @@ filterNotifications filter notifications =
|
||||
type_ == "favourite"
|
||||
|
||||
NotificationOnlyFollows ->
|
||||
type_ == "follow"
|
||||
type_ == "follow" || type_ == "follow_request"
|
||||
in
|
||||
if filter == NotificationAll then
|
||||
notifications
|
||||
@ -105,7 +105,7 @@ notificationStatusView ( context, currentUser, status, { type_, accounts } ) =
|
||||
|
||||
|
||||
notificationFollowView : CurrentUser -> NotificationAggregate -> Html Msg
|
||||
notificationFollowView currentUser { accounts } =
|
||||
notificationFollowView currentUser { type_, accounts } =
|
||||
let
|
||||
profileView : AccountNotificationDate -> Html Msg
|
||||
profileView { account, created_at } =
|
||||
@ -122,9 +122,15 @@ notificationFollowView currentUser { accounts } =
|
||||
, onClick <| Navigate ("#account/" ++ account.id)
|
||||
]
|
||||
]
|
||||
|
||||
message =
|
||||
if type_ == "follow_request" then
|
||||
"sent you a follow request"
|
||||
else
|
||||
"started following you"
|
||||
in
|
||||
div [ class "notification follow" ]
|
||||
[ notificationHeading accounts "started following you" "user"
|
||||
[ notificationHeading accounts message "user"
|
||||
, div [ class "" ] <| List.map profileView (List.take 3 accounts)
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user