File tree 2 files changed +5
-5
lines changed
app/src/main/java/com/infomaniak/mail
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
2
* Infomaniak Mail - Android
3
- * Copyright (C) 2022-2023 Infomaniak Network SA
3
+ * Copyright (C) 2022-2024 Infomaniak Network SA
4
4
*
5
5
* This program is free software: you can redistribute it and/or modify
6
6
* it under the terms of the GNU General Public License as published by
@@ -60,7 +60,7 @@ class Attachment : EmbeddedRealmObject {
60
60
var uploadLocalUri: String? = null
61
61
// endregion
62
62
63
- val isCalendarEvent: Boolean get() = mimeType == " application/ics " || mimeType == " text/calendar "
63
+ val isCalendarEvent: Boolean get() = AttachmentMimeTypeUtils .calendarMatches.contains( mimeType)
64
64
65
65
val disposition: AttachmentDisposition ?
66
66
get() = enumValueOfOrNull<AttachmentDisposition >(_disposition )
Original file line number Diff line number Diff line change 1
1
/*
2
2
* Infomaniak Mail - Android
3
- * Copyright (C) 2023 Infomaniak Network SA
3
+ * Copyright (C) 2023-2024 Infomaniak Network SA
4
4
*
5
5
* This program is free software: you can redistribute it and/or modify
6
6
* it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@ object AttachmentMimeTypeUtils {
28
28
" application/x-pdf"
29
29
)
30
30
31
- private val calendarMatches = mimeTypeSetOf(
31
+ val calendarMatches = mimeTypeSetOf(
32
32
" application/ics" ,
33
33
" text/calendar"
34
34
)
@@ -136,7 +136,7 @@ object AttachmentMimeTypeUtils {
136
136
137
137
private fun mimeTypeSetOf (vararg mimeTypes : String ) = MimeTypeSet (mimeTypes.toSet())
138
138
139
- private class MimeTypeSet (private val mimeTypes : Set <String >) : Set<String> by mimeTypes {
139
+ class MimeTypeSet (private val mimeTypes : Set <String >) : Set<String> by mimeTypes {
140
140
override fun contains (element : String ): Boolean = mimeTypes.any { mimeType -> element.startsWith(mimeType) }
141
141
}
142
142
}
You can’t perform that action at this time.
0 commit comments