diff --git a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/privategroup/sharing/PrivateGroupSharingViewModel.kt b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/privategroup/sharing/PrivateGroupSharingViewModel.kt index 7dea7c6da11dd80db10c609309c8b366324e4d27..b3983c82822a55348be107108f67c40c222f482a 100644 --- a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/privategroup/sharing/PrivateGroupSharingViewModel.kt +++ b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/privategroup/sharing/PrivateGroupSharingViewModel.kt @@ -218,12 +218,23 @@ class PrivateGroupSharingViewModel @Inject constructor( members: List<GroupMemberItem>, isCreator: Boolean, ) { + println("loading sharing status") val contacts = contactManager.getContacts(txn) if (isCreator) { val map = contacts.associate { contact -> contact.id to privateGroupInvitationManager.getSharingStatus(txn, contact, groupId) } + val idToContact = contacts.associate { contact -> + contact.id to contact + } + map.forEach { + val contact = idToContact[it.key] + if (contact != null) { + println("${contact.id.int} ${contact.author.name} ${contact.alias}: ${it.value.name}") + } + } val sharing = map.filterValues { it == SHARING }.keys + println("shareable: $sharing") txn.attach { val online = sharing.fold(0) { acc, it -> if (connectionRegistry.isConnected(it)) acc + 1 else acc } diff --git a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/threadedgroup/sharing/ThreadedGroupSharingViewModel.kt b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/threadedgroup/sharing/ThreadedGroupSharingViewModel.kt index 55779093e0ca81c50bc6514d12d18cc21f90656a..3a8cd3147b6cea1babfdce45d5e392ce7e13f1ce 100644 --- a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/threadedgroup/sharing/ThreadedGroupSharingViewModel.kt +++ b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/threadedgroup/sharing/ThreadedGroupSharingViewModel.kt @@ -93,6 +93,12 @@ abstract class ThreadedGroupSharingViewModel( override fun onInit() { super.onInit() loadContacts() + runOnDbThreadWithTransaction(true) { txn -> + val contacts = contactManager.getContacts(txn) + for (c in contacts) { + println("${c.id.int} ${c.author.name} ${c.alias}") + } + } } @UiExecutor diff --git a/briar-desktop/src/main/resources/logback.xml b/briar-desktop/src/main/resources/logback.xml index 5db4b0e406173523988e2d72638580e861d2ae68..fa2107368e4560e3e8546af81ee09898591d4213 100644 --- a/briar-desktop/src/main/resources/logback.xml +++ b/briar-desktop/src/main/resources/logback.xml @@ -11,6 +11,9 @@ <logger name="org.briarproject.briar" level="INFO"/> <logger name="org.briarproject.briar.desktop" level="INFO"/> + <logger name="org.briarproject.onionwrapper" level="ERROR"/> + <logger name="org.briarproject.bramble.lifecycle" level="ERROR"/> + <logger name="org.briarproject.bramble.plugin" level="ERROR"/> <root level="INFO"> <appender-ref ref="STDOUT"/>