X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FDefaultIdentity.kt;h=88527b30f7fc951b2d7cef535435d8b0fa7c399c;hp=b56e434f4a5ece17d936cfc0ee346d5967f10746;hb=HEAD;hpb=2f1e414e86c61435cd8b3991c475e0832f6de2fb diff --git a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/DefaultIdentity.kt b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/DefaultIdentity.kt index b56e434..88527b3 100644 --- a/src/main/kotlin/net/pterodactylus/sone/freenet/wot/DefaultIdentity.kt +++ b/src/main/kotlin/net/pterodactylus/sone/freenet/wot/DefaultIdentity.kt @@ -1,5 +1,5 @@ /* - * Sone - DefaultIdentity.kt - Copyright © 2010–2019 David Roden + * Sone - DefaultIdentity.kt - Copyright © 2010–2020 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,9 @@ package net.pterodactylus.sone.freenet.wot -import java.util.Collections.* +import java.util.Collections.synchronizedMap +import java.util.Collections.synchronizedSet +import kotlin.collections.set /** * A Web of Trust identity. @@ -77,6 +79,10 @@ open class DefaultIdentity(private val id: String, private val nickname: String? } } + override fun getTrust(): Map = synchronized(trustCache) { + trustCache.toMap() + } + override fun getTrust(ownIdentity: OwnIdentity) = synchronized(trustCache) { trustCache[ownIdentity] }