Skip to content

Commit

Permalink
Communication: Fix exam post notifications having no content (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
anian03 authored Nov 30, 2024
1 parent ac78440 commit 83a8eaf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Sources/PushNotifications/Models/PushNotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,11 @@ public enum PushNotificationType: String, Codable {
notificationPlaceholders[3],
notificationPlaceholders[4].replacingMarkdownImages())
case .newReplyForExamPost:
return nil
guard notificationPlaceholders.count > 7 else { return nil }
return R.string.localizable.artemisAppGroupNotificationTextNewReplyForExamPost(
notificationPlaceholders[3],
notificationPlaceholders[4].replacingMarkdownImages(),
notificationPlaceholders[7])
case .newReplyForExercisePost:
guard notificationPlaceholders.count > 7 else { return nil }
return R.string.localizable.artemisAppGroupNotificationTextNewReplyForExercisePost(
Expand All @@ -302,7 +306,10 @@ public enum PushNotificationType: String, Codable {
// Post Content
return notificationPlaceholders[1].replacingMarkdownImages()
case .newExamPost:
return nil
guard notificationPlaceholders.count > 4 else { return nil }
return R.string.localizable.artemisAppGroupNotificationTextNewExamPost(
notificationPlaceholders[1].replacingMarkdownImages(),
notificationPlaceholders[3])
case .newExercisePost:
guard notificationPlaceholders.count > 4 else { return nil }
return R.string.localizable.artemisAppGroupNotificationTextNewExercisePost(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@
"artemisApp.groupNotification.text.quizExerciseStarted" = "The quiz \"%1$@\" just started.";
"artemisApp.groupNotification.text.newReplyForExercisePost" = "A message from %1$@ regarding exercise \"%3$@\" got a new reply: \"%2$@\"";
"artemisApp.groupNotification.text.newReplyForLecturePost" = "A message from %1$@ regarding lecture \"%3$@\" got a new reply: \"%2$@\"";
"artemisApp.groupNotification.text.newReplyForExamPost" = "A message from %1$@ regarding exam \"%3$@\" got a new reply: \"%2$@\"";
"artemisApp.groupNotification.text.newReplyForCoursePost" = "A course-wide message from %1$@ got a new reply: \"%2$@\"";
"artemisApp.groupNotification.text.newExercisePost" = "The exercise \"%2$@\" got a new message: \"%1$@\"";
"artemisApp.groupNotification.text.newLecturePost" = "The lecture \"%2$@\" got a new message: \"%1$@\"";
"artemisApp.groupNotification.text.newExamPost" = "The exam \"%2$@\" got a new message: \"%1$@\"";
"artemisApp.singleUserNotification.text.fileSubmissionSuccessful" = "Your file for the exercise \"%1$@\" was successfully submitted.";
"artemisApp.singleUserNotification.text.newPlagiarismCaseStudent" = "New plagiarism case concerning the %1$@ exercise \"%2$@\".";
"artemisApp.singleUserNotification.text.plagiarismCaseVerdictStudent" = "Your plagiarism case concerning the %1$@ exercise \"%2$@\" has a verdict.";
Expand Down

0 comments on commit 83a8eaf

Please sign in to comment.