forked from cwtch.im/cwtch
Merge branch 'master' of sofi/cwtch into master
This commit is contained in:
commit
1f190f4398
|
@ -73,7 +73,7 @@ func NewApp(acn connectivity.ACN, appDirectory string) Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreatePeer creates a new Peer with a given name and core required accessories (eventbus)
|
// CreatePeer creates a new Peer with a given name and core required accessories (eventbus)
|
||||||
func (ac *applicationCore) CreatePeer(name string, password string) (*model.Profile, error) {
|
func (ac *applicationCore) CreatePeer(name string) (*model.Profile, error) {
|
||||||
log.Debugf("CreatePeer(%v)\n", name)
|
log.Debugf("CreatePeer(%v)\n", name)
|
||||||
|
|
||||||
profile := storage.NewProfile(name)
|
profile := storage.NewProfile(name)
|
||||||
|
@ -94,7 +94,7 @@ func (ac *applicationCore) CreatePeer(name string, password string) (*model.Prof
|
||||||
|
|
||||||
// CreatePeer creates a new Peer with the given name and required accessories (eventbus, storage, protocol engine)
|
// CreatePeer creates a new Peer with the given name and required accessories (eventbus, storage, protocol engine)
|
||||||
func (app *application) CreatePeer(name string, password string) {
|
func (app *application) CreatePeer(name string, password string) {
|
||||||
profile, err := app.applicationCore.CreatePeer(name, password)
|
profile, err := app.applicationCore.CreatePeer(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.appBus.Publish(event.NewEventList(event.PeerError, event.Error, err.Error()))
|
app.appBus.Publish(event.NewEventList(event.PeerError, event.Error, err.Error()))
|
||||||
return
|
return
|
||||||
|
|
|
@ -81,7 +81,7 @@ func (as *applicationService) handleEvent(ev *event.Event) {
|
||||||
|
|
||||||
func (as *applicationService) createPeer(name, password string) {
|
func (as *applicationService) createPeer(name, password string) {
|
||||||
log.Infof("app Service create peer %v %v\n", name, password)
|
log.Infof("app Service create peer %v %v\n", name, password)
|
||||||
profile, err := as.applicationCore.CreatePeer(name, password)
|
profile, err := as.applicationCore.CreatePeer(name)
|
||||||
as.eventBuses[profile.Onion] = event.IPCEventManagerFrom(as.bridge, profile.Onion, as.eventBuses[profile.Onion])
|
as.eventBuses[profile.Onion] = event.IPCEventManagerFrom(as.bridge, profile.Onion, as.eventBuses[profile.Onion])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Could not create Peer: %v\n", err)
|
log.Errorf("Could not create Peer: %v\n", err)
|
||||||
|
|
Loading…
Reference in New Issue