use the new retryContact plugin
This commit is contained in:
parent
732d8ab671
commit
7e0786aea2
|
@ -1,6 +1,7 @@
|
||||||
package characters
|
package characters
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"cwtch.im/cwtch/app/plugins"
|
||||||
"cwtch.im/cwtch/event"
|
"cwtch.im/cwtch/event"
|
||||||
"cwtch.im/ui/go/cwutil"
|
"cwtch.im/ui/go/cwutil"
|
||||||
"cwtch.im/ui/go/gobjects"
|
"cwtch.im/ui/go/gobjects"
|
||||||
|
@ -66,6 +67,8 @@ func AppEventListener(gcd *gothings.GrandCentralDispatcher, subscribed chan bool
|
||||||
}
|
}
|
||||||
onion := e.Data[event.Identity]
|
onion := e.Data[event.Identity]
|
||||||
|
|
||||||
|
the.CwtchApp.AddPeerPlugin(onion, plugins.CONTACTRETRY)
|
||||||
|
|
||||||
the.Peer = the.CwtchApp.GetPeer(onion)
|
the.Peer = the.CwtchApp.GetPeer(onion)
|
||||||
the.EventBus = the.CwtchApp.GetEventBus(onion)
|
the.EventBus = the.CwtchApp.GetEventBus(onion)
|
||||||
|
|
||||||
|
|
|
@ -101,11 +101,6 @@ func IncomingListener(uiState *gothings.InterfaceState, subscribed chan bool) {
|
||||||
uiContact.Status = int(cxnState)
|
uiContact.Status = int(cxnState)
|
||||||
uiState.UpdateContact(contact.Onion)
|
uiState.UpdateContact(contact.Onion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stub reconnection-handler simply attempts reconnection
|
|
||||||
if cxnState == connections.DISCONNECTED {
|
|
||||||
the.Peer.PeerWithOnion(contact.Onion)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
case event.ServerStateChange:
|
case event.ServerStateChange:
|
||||||
serverOnion := e.Data[event.GroupServer]
|
serverOnion := e.Data[event.GroupServer]
|
||||||
|
|
Reference in New Issue