Skip to content

Commit

Permalink
support mention notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
treethought committed Jun 16, 2024
1 parent 061e6b8 commit c3185e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/notifications.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ func (n *notifItem) Title() string {
return fmt.Sprintf("%s %s recasted your post", EmojiRecyle, userStr)
case api.NotificationsTypeReply:
return fmt.Sprintf("%s %s replied to your post", EmojiComment, n.Cast.Author.DisplayName)
case api.NotificationsTypeMention:
return fmt.Sprintf("%s %s mentioned you in a post",
NewStyle().Bold(true).Foreground(activeColor).Render("@"), n.Cast.Author.DisplayName,
)

default:
return "unknown notification type: " + string(n.Type)
Expand All @@ -102,7 +106,7 @@ func (i *notifItem) Description() string {
}
}
return "?"
case api.NotificationsTypeReply:
case api.NotificationsTypeReply, api.NotificationsTypeMention:
return i.Cast.Text

}
Expand Down Expand Up @@ -179,7 +183,7 @@ func (m *NotificationsView) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, noOp()
}
switch item.Type {
case api.NotificationsTypeLikes, api.NotificationsTypeRecasts, api.NotificationsTypeReply:
case api.NotificationsTypeLikes, api.NotificationsTypeRecasts, api.NotificationsTypeReply, api.NotificationsTypeMention:
return m, tea.Sequence(
m.app.FocusCast(),
selectCast(item.Cast),
Expand Down

0 comments on commit c3185e1

Please sign in to comment.