chore: remove debug logs

This commit is contained in:
0x330a 2023-06-28 11:10:40 +10:00
parent df0bcf8bc5
commit 9d18639862
3 changed files with 0 additions and 18 deletions

View File

@ -496,8 +496,6 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
private fun updateConvoVolatile(convos: ConversationVolatileConfig) {
val extracted = convos.all()
Log.d("Loki-DBG", "All conversations")
Log.d("Loki-DBG", convos.allCommunities().joinToString("\n"))
for (conversation in extracted) {
val threadId = when (conversation) {
is Conversation.OneToOne -> getThreadIdFor(conversation.sessionId, null, null, createThread = false)
@ -551,7 +549,6 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
toAddCommunities.forEach { toAddCommunity ->
val joinUrl = toAddCommunity.community.fullUrl()
if (!hasBackgroundGroupAddJob(joinUrl)) {
Log.d("Loki-DBG", "Adding background $joinUrl")
JobQueue.shared.add(BackgroundGroupAddJob(joinUrl))
}
}
@ -1033,7 +1030,6 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
override fun onOpenGroupAdded(server: String, room: String) {
OpenGroupManager.restartPollerForServer(server.removeSuffix("/"))
Log.d("Loki-DBG", "Checking onOpenGroupAdded: $server $room")
val groups = configFactory.userGroups ?: return
val volatileConfig = configFactory.convoVolatile ?: return
val openGroup = getOpenGroup(room, server) ?: return
@ -1042,11 +1038,9 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
val communityInfo = groups.getOrConstructCommunityInfo(infoServer, infoRoom, pubKeyHex)
groups.set(communityInfo)
val volatile = volatileConfig.getOrConstructCommunity(infoServer, infoRoom, pubKey)
Log.d("Loki-DBG", "latest volatile read for $room is ${volatile.lastRead}")
if (volatile.lastRead != 0L) {
val threadId = getThreadId(openGroup) ?: return
markConversationAsRead(threadId, volatile.lastRead, force = true)
Log.d("Loki-DBG", "set latest volatile read for $room to ${volatile.lastRead}")
}
volatileConfig.set(volatile)
}

View File

@ -28,7 +28,6 @@ class BackgroundGroupAddJob(val joinUrl: String): Job {
}
override suspend fun execute(dispatcherName: String) {
Log.d("Loki-DBG", "adding group $joinUrl")
try {
val openGroup = OpenGroupUrlParser.parseUrl(joinUrl)
val storage = MessagingModuleConfiguration.shared.storage
@ -39,8 +38,6 @@ class BackgroundGroupAddJob(val joinUrl: String): Job {
return
}
storage.addOpenGroup(openGroup.joinUrl())
Log.d(KEY, "onOpenGroupAdded(${openGroup.server})")
Log.d("Loki-DBG", "added group $joinUrl")
storage.onOpenGroupAdded(openGroup.server, openGroup.room)
} catch (e: Exception) {
Log.e("OpenGroupDispatcher", "Failed to add group because",e)

View File

@ -147,9 +147,6 @@ class BatchMessageReceiveJob(
val messageIds = linkedMapOf<Long, Pair<Boolean, Boolean>>()
val myLastSeen = storage.getLastSeen(threadId)
var newLastSeen = if (myLastSeen == -1L) 0 else myLastSeen
if (!openGroupID.isNullOrEmpty()) {
Log.d("Loki-DBG", "pre-lastSeen for: $openGroupID is $newLastSeen")
}
messages.forEach { (parameters, message, proto) ->
try {
when (message) {
@ -220,15 +217,9 @@ class BatchMessageReceiveJob(
// last seen will be the current last seen if not changed (re-computes the read counts for thread record)
// might have been updated from a different thread at this point
val currentLastSeen = storage.getLastSeen(threadId).let { if (it == -1L) 0 else it }
if (!openGroupID.isNullOrEmpty()) {
Log.d("Loki-DBG", "current-lastSeen (w/ my message read) for: $openGroupID is $currentLastSeen")
}
if (currentLastSeen > newLastSeen) {
newLastSeen = currentLastSeen
}
if (!openGroupID.isNullOrEmpty()) {
Log.d("Loki-DBG", "new-lastSeen for: $openGroupID is $currentLastSeen")
}
if (newLastSeen > 0) {
storage.markConversationAsRead(threadId, newLastSeen, force = true)
storage.updateThread(threadId, true)