Skip to content

Commit 2390e1a

Browse files
committed
add support for "user posted" notifs
1 parent 765d603 commit 2390e1a

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24"
6+
android:tint="?attr/colorControlNormal">
7+
<path
8+
android:fillColor="#000000"
9+
android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.9,2 2,2zM18,16v-5c0,-3.07 -1.63,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.64,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2zM16,17L8,17v-6c0,-2.48 1.51,-4.5 4,-4.5s4,2.02 4,4.5v6zM7.58,4.08L6.15,2.65C3.75,4.48 2.17,7.3 2.03,10.5h2c0.15,-2.65 1.51,-4.97 3.55,-6.42zM19.97,10.5h2c-0.15,-3.2 -1.73,-6.02 -4.12,-7.85l-1.42,1.43c2.02,1.45 3.39,3.77 3.54,6.42z"/>
10+
</vector>

shared/src/commonMain/kotlin/site/remlit/snowdrop/component/Notification.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import site.remlit.snowdrop.util.toRelativeString
4545
import snowdrop.shared.generated.resources.Res
4646
import snowdrop.shared.generated.resources.icon_add_24px
4747
import snowdrop.shared.generated.resources.icon_edit_24px
48+
import snowdrop.shared.generated.resources.icon_notifications_active_24
4849
import snowdrop.shared.generated.resources.icon_repeat_24px
4950
import snowdrop.shared.generated.resources.icon_poll_24px
5051
import snowdrop.shared.generated.resources.icon_star_24px
@@ -86,6 +87,10 @@ fun Notification(notification: Notification) {
8687
painterResource(Res.drawable.icon_poll_24px), null,
8788
tint = MaterialTheme.colorScheme.primary
8889
)
90+
"status" -> Icon(
91+
painterResource(Res.drawable.icon_notifications_active_24), null,
92+
tint = MaterialTheme.colorScheme.primary
93+
)
8994
"bite" -> Icon( // todo: tooth, and test bite notifs
9095
painterResource(Res.drawable.icon_tooth_24px), null,
9196
tint = MaterialTheme.colorScheme.primary
@@ -109,7 +114,7 @@ fun Notification(notification: Notification) {
109114
var message by remember { mutableStateOf("") }
110115

111116
when (notification.type) {
112-
"favourite", "pleroma:emoji_reaction", "reblog", "update", "bite" ->
117+
"favourite", "pleroma:emoji_reaction", "reblog", "update", "status", "bite" ->
113118
displayName = notification.account.displayName
114119
?: notification.account.username
115120
}
@@ -120,6 +125,7 @@ fun Notification(notification: Notification) {
120125
"reblog" -> message = "boosted your post"
121126
"update" -> message = "edited a post"
122127
"poll" -> message = "A poll you have voted in has ended"
128+
"status" -> message = "just posted"
123129
"bite" -> message = if (notification.bite?.biteBack == true) "bit you back"
124130
else if (notification.status != null) "bit your post"
125131
else "bit you"

0 commit comments

Comments
 (0)