mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 13:48:20 +01:00
[Mobidziennik/Web] Fix getting a sent message.
This commit is contained in:
parent
22abad35cc
commit
e825af0ff0
@ -74,16 +74,16 @@ class MobidziennikWebGetMessage(override val data: DataMobidziennik,
|
|||||||
message.senderId = null
|
message.senderId = null
|
||||||
|
|
||||||
content.select("table.spis tr:has(td)")?.forEach { recipientEl ->
|
content.select("table.spis tr:has(td)")?.forEach { recipientEl ->
|
||||||
val senderEl = recipientEl.select("td:eq(0)").first()
|
val senderEl = recipientEl.select("td:eq(1)")?.first() ?: return@forEach
|
||||||
val senderName = senderEl.text().fixName()
|
val senderName = senderEl.text().fixName()
|
||||||
|
|
||||||
val teacher = data.teacherList.singleOrNull { it.fullNameLastFirst == senderName }
|
val teacher = data.teacherList.singleOrNull { it.fullNameLastFirst == senderName }
|
||||||
val receiverId = teacher?.id ?: -1
|
val receiverId = teacher?.id ?: -1
|
||||||
|
|
||||||
var readDate = 0L
|
var readDate = 0L
|
||||||
val isReadEl = recipientEl.select("td:eq(2)").first()
|
val isReadEl = recipientEl.select("td:eq(4)")?.first() ?: return@forEach
|
||||||
if (isReadEl.ownText() != "NIE") {
|
if (isReadEl.html().contains("tak")) {
|
||||||
val readDateEl = recipientEl.select("td:eq(3) small").first()
|
val readDateEl = recipientEl.select("td:eq(5) small")?.first() ?: return@forEach
|
||||||
Regexes.MOBIDZIENNIK_MESSAGE_SENT_READ_DATE.find(readDateEl.ownText())?.let {
|
Regexes.MOBIDZIENNIK_MESSAGE_SENT_READ_DATE.find(readDateEl.ownText())?.let {
|
||||||
val date = Date(
|
val date = Date(
|
||||||
it[3].toIntOrNull() ?: 2019,
|
it[3].toIntOrNull() ?: 2019,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user