store subscriber list upon subscription
This commit is contained in:
@@ -98,7 +98,7 @@ class MuWireSettings {
|
|||||||
|
|
||||||
if (!trustSubscriptions.isEmpty()) {
|
if (!trustSubscriptions.isEmpty()) {
|
||||||
String encoded = trustSubscriptions.stream().
|
String encoded = trustSubscriptions.stream().
|
||||||
map(it.toBase64()).
|
map({it.toBase64()}).
|
||||||
collect(Collectors.joining(","))
|
collect(Collectors.joining(","))
|
||||||
props.setProperty("trustSubscriptions", encoded)
|
props.setProperty("trustSubscriptions", encoded)
|
||||||
}
|
}
|
||||||
|
@@ -46,10 +46,8 @@ class TrustSubscriber {
|
|||||||
|
|
||||||
void onTrustSubscriptionEvent(TrustSubscriptionEvent e) {
|
void onTrustSubscriptionEvent(TrustSubscriptionEvent e) {
|
||||||
if (!e.subscribe) {
|
if (!e.subscribe) {
|
||||||
settings.trustSubscriptions.remove(e.persona)
|
|
||||||
remoteTrustLists.remove(e.persona.destination)
|
remoteTrustLists.remove(e.persona.destination)
|
||||||
} else {
|
} else {
|
||||||
settings.trustSubscriptions.add(e.persona)
|
|
||||||
RemoteTrustList trustList = remoteTrustLists.putIfAbsent(e.persona.destination, new RemoteTrustList(e.persona))
|
RemoteTrustList trustList = remoteTrustLists.putIfAbsent(e.persona.destination, new RemoteTrustList(e.persona))
|
||||||
trustList?.timestamp = 0
|
trustList?.timestamp = 0
|
||||||
synchronized(waitLock) {
|
synchronized(waitLock) {
|
||||||
|
@@ -218,6 +218,8 @@ class MainFrameController {
|
|||||||
if (row < 0)
|
if (row < 0)
|
||||||
return
|
return
|
||||||
Persona p = model.trusted[row]
|
Persona p = model.trusted[row]
|
||||||
|
core.muOptions.trustSubscriptions.add(p)
|
||||||
|
saveMuWireSettings()
|
||||||
core.eventBus.publish(new TrustSubscriptionEvent(persona : p, subscribe : true))
|
core.eventBus.publish(new TrustSubscriptionEvent(persona : p, subscribe : true))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user