forked from github/wulkanowy-mirror
Remove useless group property from NotificationType (#1714)
This commit is contained in:
parent
9cabd7ef08
commit
70f038f15f
@ -74,7 +74,7 @@ class AppNotificationManager @Inject constructor(
|
||||
student: Student
|
||||
) {
|
||||
val notificationType = groupNotificationData.type
|
||||
val groupType = notificationType.group ?: return
|
||||
val groupType = notificationType.channel
|
||||
val group = "${groupType}_${student.id}"
|
||||
|
||||
sendSummaryNotification(groupNotificationData, group, student)
|
||||
|
@ -14,72 +14,58 @@ import io.github.wulkanowy.services.sync.channels.PushChannel
|
||||
import io.github.wulkanowy.services.sync.channels.TimetableChangeChannel
|
||||
|
||||
enum class NotificationType(
|
||||
val group: String?,
|
||||
val channel: String,
|
||||
val icon: Int
|
||||
) {
|
||||
NEW_CONFERENCE(
|
||||
group = "new_conferences_group",
|
||||
channel = NewConferencesChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_more_conferences,
|
||||
),
|
||||
NEW_EXAM(
|
||||
group = "new_exam_group",
|
||||
channel = NewExamChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_main_exam
|
||||
),
|
||||
NEW_GRADE_DETAILS(
|
||||
group = "new_grade_details_group",
|
||||
channel = NewGradesChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_stat_grade,
|
||||
),
|
||||
NEW_GRADE_PREDICTED(
|
||||
group = "new_grade_predicted_group",
|
||||
channel = NewGradesChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_stat_grade,
|
||||
),
|
||||
NEW_GRADE_FINAL(
|
||||
group = "new_grade_final_group",
|
||||
channel = NewGradesChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_stat_grade,
|
||||
),
|
||||
NEW_HOMEWORK(
|
||||
group = "new_homework_group",
|
||||
channel = NewHomeworkChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_more_homework,
|
||||
),
|
||||
NEW_LUCKY_NUMBER(
|
||||
group = null,
|
||||
channel = LuckyNumberChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_stat_luckynumber,
|
||||
),
|
||||
NEW_MESSAGE(
|
||||
group = "new_message_group",
|
||||
channel = NewMessagesChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_stat_message,
|
||||
),
|
||||
NEW_NOTE(
|
||||
group = "new_notes_group",
|
||||
channel = NewNotesChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_stat_note
|
||||
),
|
||||
NEW_ANNOUNCEMENT(
|
||||
group = "new_school_announcements_group",
|
||||
channel = NewSchoolAnnouncementsChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_all_about
|
||||
),
|
||||
CHANGE_TIMETABLE(
|
||||
group = "change_timetable_group",
|
||||
channel = TimetableChangeChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_main_timetable
|
||||
),
|
||||
NEW_ATTENDANCE(
|
||||
group = "new_attendance_group",
|
||||
channel = NewAttendanceChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_main_attendance
|
||||
),
|
||||
PUSH(
|
||||
group = null,
|
||||
channel = PushChannel.CHANNEL_ID,
|
||||
icon = R.drawable.ic_stat_all
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user