Remove useless group property from NotificationType (#1714)

This commit is contained in:
Michael 2021-12-11 17:12:47 +01:00 committed by GitHub
parent 9cabd7ef08
commit 70f038f15f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View File

@ -74,7 +74,7 @@ class AppNotificationManager @Inject constructor(
student: Student student: Student
) { ) {
val notificationType = groupNotificationData.type val notificationType = groupNotificationData.type
val groupType = notificationType.group ?: return val groupType = notificationType.channel
val group = "${groupType}_${student.id}" val group = "${groupType}_${student.id}"
sendSummaryNotification(groupNotificationData, group, student) sendSummaryNotification(groupNotificationData, group, student)

View File

@ -14,72 +14,58 @@ import io.github.wulkanowy.services.sync.channels.PushChannel
import io.github.wulkanowy.services.sync.channels.TimetableChangeChannel import io.github.wulkanowy.services.sync.channels.TimetableChangeChannel
enum class NotificationType( enum class NotificationType(
val group: String?,
val channel: String, val channel: String,
val icon: Int val icon: Int
) { ) {
NEW_CONFERENCE( NEW_CONFERENCE(
group = "new_conferences_group",
channel = NewConferencesChannel.CHANNEL_ID, channel = NewConferencesChannel.CHANNEL_ID,
icon = R.drawable.ic_more_conferences, icon = R.drawable.ic_more_conferences,
), ),
NEW_EXAM( NEW_EXAM(
group = "new_exam_group",
channel = NewExamChannel.CHANNEL_ID, channel = NewExamChannel.CHANNEL_ID,
icon = R.drawable.ic_main_exam icon = R.drawable.ic_main_exam
), ),
NEW_GRADE_DETAILS( NEW_GRADE_DETAILS(
group = "new_grade_details_group",
channel = NewGradesChannel.CHANNEL_ID, channel = NewGradesChannel.CHANNEL_ID,
icon = R.drawable.ic_stat_grade, icon = R.drawable.ic_stat_grade,
), ),
NEW_GRADE_PREDICTED( NEW_GRADE_PREDICTED(
group = "new_grade_predicted_group",
channel = NewGradesChannel.CHANNEL_ID, channel = NewGradesChannel.CHANNEL_ID,
icon = R.drawable.ic_stat_grade, icon = R.drawable.ic_stat_grade,
), ),
NEW_GRADE_FINAL( NEW_GRADE_FINAL(
group = "new_grade_final_group",
channel = NewGradesChannel.CHANNEL_ID, channel = NewGradesChannel.CHANNEL_ID,
icon = R.drawable.ic_stat_grade, icon = R.drawable.ic_stat_grade,
), ),
NEW_HOMEWORK( NEW_HOMEWORK(
group = "new_homework_group",
channel = NewHomeworkChannel.CHANNEL_ID, channel = NewHomeworkChannel.CHANNEL_ID,
icon = R.drawable.ic_more_homework, icon = R.drawable.ic_more_homework,
), ),
NEW_LUCKY_NUMBER( NEW_LUCKY_NUMBER(
group = null,
channel = LuckyNumberChannel.CHANNEL_ID, channel = LuckyNumberChannel.CHANNEL_ID,
icon = R.drawable.ic_stat_luckynumber, icon = R.drawable.ic_stat_luckynumber,
), ),
NEW_MESSAGE( NEW_MESSAGE(
group = "new_message_group",
channel = NewMessagesChannel.CHANNEL_ID, channel = NewMessagesChannel.CHANNEL_ID,
icon = R.drawable.ic_stat_message, icon = R.drawable.ic_stat_message,
), ),
NEW_NOTE( NEW_NOTE(
group = "new_notes_group",
channel = NewNotesChannel.CHANNEL_ID, channel = NewNotesChannel.CHANNEL_ID,
icon = R.drawable.ic_stat_note icon = R.drawable.ic_stat_note
), ),
NEW_ANNOUNCEMENT( NEW_ANNOUNCEMENT(
group = "new_school_announcements_group",
channel = NewSchoolAnnouncementsChannel.CHANNEL_ID, channel = NewSchoolAnnouncementsChannel.CHANNEL_ID,
icon = R.drawable.ic_all_about icon = R.drawable.ic_all_about
), ),
CHANGE_TIMETABLE( CHANGE_TIMETABLE(
group = "change_timetable_group",
channel = TimetableChangeChannel.CHANNEL_ID, channel = TimetableChangeChannel.CHANNEL_ID,
icon = R.drawable.ic_main_timetable icon = R.drawable.ic_main_timetable
), ),
NEW_ATTENDANCE( NEW_ATTENDANCE(
group = "new_attendance_group",
channel = NewAttendanceChannel.CHANNEL_ID, channel = NewAttendanceChannel.CHANNEL_ID,
icon = R.drawable.ic_main_attendance icon = R.drawable.ic_main_attendance
), ),
PUSH( PUSH(
group = null,
channel = PushChannel.CHANNEL_ID, channel = PushChannel.CHANNEL_ID,
icon = R.drawable.ic_stat_all icon = R.drawable.ic_stat_all
) )