feat: update libsession-util, adjust docs, update mms and sms to use message sent timestamp instead of -1 for last read in the thread

This commit is contained in:
0x330a 2023-05-16 12:09:28 +10:00
parent dcbe548891
commit cf171fc371
5 changed files with 4 additions and 7 deletions

View File

@ -739,7 +739,7 @@ class MmsDatabase(context: Context, databaseHelper: SQLCipherOpenHelper) : Messa
) )
} }
with (get(context).threadDatabase()) { with (get(context).threadDatabase()) {
setLastSeen(threadId) setLastSeen(threadId, message.sentTimeMillis)
setHasSent(threadId, true) setHasSent(threadId, true)
if (runThreadUpdate) { if (runThreadUpdate) {
update(threadId, true, true) update(threadId, true, true)

View File

@ -564,7 +564,7 @@ public class SmsDatabase extends MessagingDatabase {
if (runThreadUpdate) { if (runThreadUpdate) {
DatabaseComponent.get(context).threadDatabase().update(threadId, true, true); DatabaseComponent.get(context).threadDatabase().update(threadId, true, true);
} }
DatabaseComponent.get(context).threadDatabase().setLastSeen(threadId); DatabaseComponent.get(context).threadDatabase().setLastSeen(threadId, message.getSentTimestampMillis());
DatabaseComponent.get(context).threadDatabase().setHasSent(threadId, true); DatabaseComponent.get(context).threadDatabase().setHasSent(threadId, true);

View File

@ -514,9 +514,7 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
toDeleteClosedGroups.forEach { deleteGroup -> toDeleteClosedGroups.forEach { deleteGroup ->
val threadId = getThreadId(deleteGroup.encodedId) val threadId = getThreadId(deleteGroup.encodedId)
if (threadId == null) { if (threadId != null) {
Log.w("Loki-DBG", "Existing group had no thread to delete")
} else {
Log.d("Loki-DBG", "Deleting group for thread $threadId") Log.d("Loki-DBG", "Deleting group for thread $threadId")
ClosedGroupManager.silentlyRemoveGroup(context,threadId,GroupUtil.doubleDecodeGroupId(deleteGroup.encodedId), deleteGroup.encodedId, localUserPublicKey, delete = true) ClosedGroupManager.silentlyRemoveGroup(context,threadId,GroupUtil.doubleDecodeGroupId(deleteGroup.encodedId), deleteGroup.encodedId, localUserPublicKey, delete = true)
} }

@ -1 +1 @@
Subproject commit 2c18eced69f464ed96aa5bb6ec7c4c6f815e17fe Subproject commit 97084c69f86e67c675095b48efacc86113ccebb0

View File

@ -154,7 +154,6 @@ class Poller(private val configFactory: ConfigFactoryProtocol, debounceTimer: Ti
Log.w("Loki-DBG", "shared config message handled in configs wasn't SharedConfigurationMessage but was ${message.javaClass.simpleName}") Log.w("Loki-DBG", "shared config message handled in configs wasn't SharedConfigurationMessage but was ${message.javaClass.simpleName}")
return@forEach return@forEach
} }
Log.d("Loki-DBG", "Merging config of kind ${message.kind} into ${forConfigObject.javaClass.simpleName}")
forConfigObject.merge(hash!! to message.data) forConfigObject.merge(hash!! to message.data)
} catch (e: Exception) { } catch (e: Exception) {
Log.e("Loki", e) Log.e("Loki", e)