mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
chore: remove debug logs
This commit is contained in:
parent
df0bcf8bc5
commit
9d18639862
@ -496,8 +496,6 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co
|
|||||||
|
|
||||||
private fun updateConvoVolatile(convos: ConversationVolatileConfig) {
|
private fun updateConvoVolatile(convos: ConversationVolatileConfig) {
|
||||||
val extracted = convos.all()
|
val extracted = convos.all()
|
||||||
Log.d("Loki-DBG", "All conversations")
|
|
||||||
Log.d("Loki-DBG", convos.allCommunities().joinToString("\n"))
|
|
||||||
for (conversation in extracted) {
|
for (conversation in extracted) {
|
||||||
val threadId = when (conversation) {
|
val threadId = when (conversation) {
|
||||||
is Conversation.OneToOne -> getThreadIdFor(conversation.sessionId, null, null, createThread = false)
|
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 ->
|
toAddCommunities.forEach { toAddCommunity ->
|
||||||
val joinUrl = toAddCommunity.community.fullUrl()
|
val joinUrl = toAddCommunity.community.fullUrl()
|
||||||
if (!hasBackgroundGroupAddJob(joinUrl)) {
|
if (!hasBackgroundGroupAddJob(joinUrl)) {
|
||||||
Log.d("Loki-DBG", "Adding background $joinUrl")
|
|
||||||
JobQueue.shared.add(BackgroundGroupAddJob(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) {
|
override fun onOpenGroupAdded(server: String, room: String) {
|
||||||
OpenGroupManager.restartPollerForServer(server.removeSuffix("/"))
|
OpenGroupManager.restartPollerForServer(server.removeSuffix("/"))
|
||||||
Log.d("Loki-DBG", "Checking onOpenGroupAdded: $server $room")
|
|
||||||
val groups = configFactory.userGroups ?: return
|
val groups = configFactory.userGroups ?: return
|
||||||
val volatileConfig = configFactory.convoVolatile ?: return
|
val volatileConfig = configFactory.convoVolatile ?: return
|
||||||
val openGroup = getOpenGroup(room, server) ?: 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)
|
val communityInfo = groups.getOrConstructCommunityInfo(infoServer, infoRoom, pubKeyHex)
|
||||||
groups.set(communityInfo)
|
groups.set(communityInfo)
|
||||||
val volatile = volatileConfig.getOrConstructCommunity(infoServer, infoRoom, pubKey)
|
val volatile = volatileConfig.getOrConstructCommunity(infoServer, infoRoom, pubKey)
|
||||||
Log.d("Loki-DBG", "latest volatile read for $room is ${volatile.lastRead}")
|
|
||||||
if (volatile.lastRead != 0L) {
|
if (volatile.lastRead != 0L) {
|
||||||
val threadId = getThreadId(openGroup) ?: return
|
val threadId = getThreadId(openGroup) ?: return
|
||||||
markConversationAsRead(threadId, volatile.lastRead, force = true)
|
markConversationAsRead(threadId, volatile.lastRead, force = true)
|
||||||
Log.d("Loki-DBG", "set latest volatile read for $room to ${volatile.lastRead}")
|
|
||||||
}
|
}
|
||||||
volatileConfig.set(volatile)
|
volatileConfig.set(volatile)
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ class BackgroundGroupAddJob(val joinUrl: String): Job {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun execute(dispatcherName: String) {
|
override suspend fun execute(dispatcherName: String) {
|
||||||
Log.d("Loki-DBG", "adding group $joinUrl")
|
|
||||||
try {
|
try {
|
||||||
val openGroup = OpenGroupUrlParser.parseUrl(joinUrl)
|
val openGroup = OpenGroupUrlParser.parseUrl(joinUrl)
|
||||||
val storage = MessagingModuleConfiguration.shared.storage
|
val storage = MessagingModuleConfiguration.shared.storage
|
||||||
@ -39,8 +38,6 @@ class BackgroundGroupAddJob(val joinUrl: String): Job {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
storage.addOpenGroup(openGroup.joinUrl())
|
storage.addOpenGroup(openGroup.joinUrl())
|
||||||
Log.d(KEY, "onOpenGroupAdded(${openGroup.server})")
|
|
||||||
Log.d("Loki-DBG", "added group $joinUrl")
|
|
||||||
storage.onOpenGroupAdded(openGroup.server, openGroup.room)
|
storage.onOpenGroupAdded(openGroup.server, openGroup.room)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e("OpenGroupDispatcher", "Failed to add group because",e)
|
Log.e("OpenGroupDispatcher", "Failed to add group because",e)
|
||||||
|
@ -147,9 +147,6 @@ class BatchMessageReceiveJob(
|
|||||||
val messageIds = linkedMapOf<Long, Pair<Boolean, Boolean>>()
|
val messageIds = linkedMapOf<Long, Pair<Boolean, Boolean>>()
|
||||||
val myLastSeen = storage.getLastSeen(threadId)
|
val myLastSeen = storage.getLastSeen(threadId)
|
||||||
var newLastSeen = if (myLastSeen == -1L) 0 else myLastSeen
|
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) ->
|
messages.forEach { (parameters, message, proto) ->
|
||||||
try {
|
try {
|
||||||
when (message) {
|
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)
|
// 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
|
// might have been updated from a different thread at this point
|
||||||
val currentLastSeen = storage.getLastSeen(threadId).let { if (it == -1L) 0 else it }
|
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) {
|
if (currentLastSeen > newLastSeen) {
|
||||||
newLastSeen = currentLastSeen
|
newLastSeen = currentLastSeen
|
||||||
}
|
}
|
||||||
if (!openGroupID.isNullOrEmpty()) {
|
|
||||||
Log.d("Loki-DBG", "new-lastSeen for: $openGroupID is $currentLastSeen")
|
|
||||||
}
|
|
||||||
if (newLastSeen > 0) {
|
if (newLastSeen > 0) {
|
||||||
storage.markConversationAsRead(threadId, newLastSeen, force = true)
|
storage.markConversationAsRead(threadId, newLastSeen, force = true)
|
||||||
storage.updateThread(threadId, true)
|
storage.updateThread(threadId, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user