Skip to content
Snippets Groups Projects
Verified Commit b68df2c3 authored by Sebastian's avatar Sebastian
Browse files

Add some logging to debug ability to share private groups

parent 6fcb7693
No related merge requests found
Pipeline #15134 passed
......@@ -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 }
......
......@@ -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
......
......@@ -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"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment