[API/Mobidziennik] Update messages search query to contain student name.

This commit is contained in:
Kuba Szczodrzyński 2021-05-26 17:46:03 +02:00
parent 99021f6b3a
commit c855f08f9c
No known key found for this signature in database
GPG Key ID: 70CB8A85BA1633CB

View File

@ -17,6 +17,7 @@ import pl.szczodrzynski.edziennik.data.db.entity.Metadata
import pl.szczodrzynski.edziennik.fixName
import pl.szczodrzynski.edziennik.singleOrNull
import pl.szczodrzynski.edziennik.utils.models.Date
import java.net.URLEncoder
class MobidziennikWebMessagesAll(override val data: DataMobidziennik,
override val lastSync: Long?,
@ -27,7 +28,8 @@ class MobidziennikWebMessagesAll(override val data: DataMobidziennik,
}
init {
webGet(TAG, "/dziennik/wyszukiwarkawiadomosci?q=+") { text ->
val query = URLEncoder.encode(data.profile?.studentNameLong ?: "a", "UTF-8")
webGet(TAG, "/dziennik/wyszukiwarkawiadomosci?q=$query") { text ->
MobidziennikLuckyNumberExtractor(data, text)
val doc = Jsoup.parse(text)