This repository was archived by the owner on May 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
kotlin/de/hbch/traewelling/api/models/notifications Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -287,12 +287,15 @@ enum class NotificationType {
287
287
override val channel = NotificationChannelType .MastodonError
288
288
override val category = android.app.Notification .CATEGORY_ERROR
289
289
override fun getHeadline (context : Context , notification : Notification ): String {
290
+ return context.getString(R .string.mastodon_share_error)
291
+ }
292
+ override fun getBody (context : Context , notification : Notification ): String {
290
293
val obj = getData(notification)
291
- var headline = " "
294
+ var body = " "
292
295
if (obj != null ) {
293
- headline = context.getString(R .string.status_not_shared_on_mastodon, obj.status.id )
296
+ body = context.getString(R .string.status_not_shared_on_mastodon, obj.httpResponseCode )
294
297
}
295
- return headline
298
+ return body
296
299
}
297
300
override fun getOnClick (notification : Notification ): (NavHostController ) -> Unit {
298
301
val data = getData(notification)
@@ -322,7 +325,7 @@ enum class NotificationType {
322
325
private fun getData (notification : Notification ): MastodonNotSentData ? {
323
326
val gson = Gson ()
324
327
val data = notification.data
325
- val targetType = object : TypeToken <UserFollowedData >() {}.type
328
+ val targetType = object : TypeToken <MastodonNotSentData >() {}.type
326
329
return gson.fromJson<Any >(gson.toJson(data), targetType) as ? MastodonNotSentData
327
330
}
328
331
};
Original file line number Diff line number Diff line change 160
160
<string name =" travelling_with_from_to" >Fahrt mit %1$s von %2$s nach %3$s</string >
161
161
<string name =" follow_request_approved" >\@%1$s hat deine Folgeanfrage bestätigt!</string >
162
162
<string name =" follow_request_issued" >\@%1$s möchte dir folgen!</string >
163
+ <string name =" mastodon_share_error" >Fehler beim Posten auf Mastodon!</string >
163
164
<string name =" status_not_shared_on_mastodon" >Dein Check-In wurde aufgrund von Fehler %1$d nicht auf Mastodon geteilt.</string >
164
165
<string name =" map_view" >Kartenansicht</string >
165
166
<string name =" configure_map" >Hier kannst du die Kartenansicht konfigurieren.</string >
Original file line number Diff line number Diff line change 164
164
<string name =" travelling_with_from_to" >Ride with %1$s from %2$s to %3$s</string >
165
165
<string name =" follow_request_approved" >\@%1$s approved your follow request!</string >
166
166
<string name =" follow_request_issued" >\@%1$s would like to follow you!</string >
167
+ <string name =" mastodon_share_error" >Error when sharing to Mastodon!</string >
167
168
<string name =" status_not_shared_on_mastodon" >Your check-in wasn\'t shared to Mastodon due to error %1$d.</string >
168
169
<string name =" map_view" >Map view</string >
169
170
<string name =" configure_map" >Here you can configure the map view.</string >
You can’t perform that action at this time.
0 commit comments