diff --git a/app/src/main/java/com/gatecontrol/android/chat/ChatUpdateHint.kt b/app/src/main/java/com/gatecontrol/android/chat/ChatUpdateHint.kt index bcc28292..ae96e3ea 100644 --- a/app/src/main/java/com/gatecontrol/android/chat/ChatUpdateHint.kt +++ b/app/src/main/java/com/gatecontrol/android/chat/ChatUpdateHint.kt @@ -16,11 +16,17 @@ import javax.inject.Singleton * Pure, unit-tested. */ object ChatFeatureHint { - /** Every key of the `features` object this app knows (Messenger ≤ 1.4.0). */ + /** Every key of the `features` object this app knows (Messenger ≤ 1.11.0). */ val KNOWN: Set = setOf( "direct", "groups", "voice", "files", "location", "reactions", "edit", "search", "disappearing", "bridges", "e2e", ChatFeatures.VIDEO_META, ChatFeatures.FILE_THUMBS, + // 1.5.0: Freigaben anfragen (approvers), „Am Ende ausschalten“ + "action_requests", "grant_off", + // 1.6.0: „Wo Mitteilungen erscheinen“ (NotifyRoutesScreen) + "notice_routes", + // 1.11.0: Virenscan an Dateien (`media.scan`, MediaScan) + "scan", ) + ChatFeatures14.ALL /** The keys the server switches on that this app does not know. */ diff --git a/app/src/test/java/com/gatecontrol/android/chat/ChatMessenger14Test.kt b/app/src/test/java/com/gatecontrol/android/chat/ChatMessenger14Test.kt index ddc08d87..e8810803 100644 --- a/app/src/test/java/com/gatecontrol/android/chat/ChatMessenger14Test.kt +++ b/app/src/test/java/com/gatecontrol/android/chat/ChatMessenger14Test.kt @@ -36,6 +36,22 @@ class ChatMessenger14Test { assertEquals(emptySet(), ChatFeatureHint.unknown(f), "all 1.4 keys are known to this app") } + /** Everything Messenger 1.11.0 can switch on (GET me features, all options on): no update hint. */ + @Test + fun `no update hint for the full feature set of messenger 1_11`() { + val all = listOf( + "direct", "groups", "voice", "files", "location", "reactions", "edit", "search", "disappearing", + "video_meta", "file_thumbs", "scan", + "status", "stories", "story_duration", "polls", "events", "arrival", "msg_tools", "privacy2", + "actions", "action_requests", "grant_off", "notices", "notice_routes", + ) + val f = ChatJson.features(json(all.joinToString(",", "{", "}") { "\"$it\":true" })) + assertEquals(emptySet(), ChatFeatureHint.unknown(f)) + assertFalse(ChatFeatureHint.show(f, null)) + val newer = ChatJson.features(json(all.joinToString(",", "{", ",\"later\":true}") { "\"$it\":true" })) + assertEquals(setOf("later"), ChatFeatureHint.unknown(newer), "a key of a newer messenger still shows the hint") + } + // ─── polls ────────────────────────────────────────────────────── @Test