From f6dcbb6594a2983505ce1837756fe391c9d7d8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Thu, 2 Apr 2020 11:19:44 +0200 Subject: [PATCH] [API/Librus] Disable Messages login when downloading homework attachment. --- .../edziennik/data/api/edziennik/librus/Librus.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/librus/Librus.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/librus/Librus.kt index 7a15806f..a79a66f8 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/librus/Librus.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/librus/Librus.kt @@ -122,20 +122,22 @@ class Librus(val app: App, val profile: Profile?, val loginStore: LoginStore, va } override fun getAttachment(owner: Any, attachmentId: Long, attachmentName: String) { - login(LOGIN_METHOD_LIBRUS_MESSAGES) { - when (owner) { - is Message -> { + when (owner) { + is Message -> { + login(LOGIN_METHOD_LIBRUS_MESSAGES) { LibrusMessagesGetAttachment(data, owner, attachmentId, attachmentName) { completed() } } - is EventFull -> { + } + is EventFull -> { + login(LOGIN_METHOD_LIBRUS_SYNERGIA) { LibrusSynergiaHomeworkGetAttachment(data, owner, attachmentId, attachmentName) { completed() } } - else -> completed() } + else -> completed() } }