From 91b3d19cf08f45e31a50e927477da712a0598f28 Mon Sep 17 00:00:00 2001 From: erinn Date: Mon, 12 Apr 2021 15:27:53 -0700 Subject: [PATCH] fixes #237 --- lib.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib.go b/lib.go index 280b1cc..a057491 100644 --- a/lib.go +++ b/lib.go @@ -346,10 +346,9 @@ func AcceptContact(profile, handle string) { err := application.GetPeer(profile).SetContactAuthorization(handle, model.AuthApproved) if err == nil { eventHandler.Push(event.NewEvent(event.PeerStateChange, map[event.Field]string{ - //application.GetPrimaryBus().Publish(event.NewEvent(event.PeerStateChange, map[event.Field]string{ - "ProfileOnion": profile, - event.RemotePeer: handle, - "authorization": string(model.AuthApproved), + "ProfileOnion": profile, + event.RemotePeer: handle, + "authorization": string(model.AuthApproved), })) } else { log.Errorf("error accepting contact: %s", err.Error()) @@ -364,10 +363,10 @@ func c_BlockContact(profilePtr *C.char, profileLen C.int, handlePtr *C.char, han func BlockContact(profile, handle string) { err := application.GetPeer(profile).SetContactAuthorization(handle, model.AuthBlocked) if err == nil { - application.GetPrimaryBus().Publish(event.NewEvent(event.PeerStateChange, map[event.Field]string{ - "ProfileOnion": profile, - event.RemotePeer: handle, - "authorization": string(model.AuthBlocked), + eventHandler.Push(event.NewEvent(event.PeerStateChange, map[event.Field]string{ + "ProfileOnion": profile, + event.RemotePeer: handle, + "authorization": string(model.AuthBlocked), })) } else { log.Errorf("error blocking contact: %s", err.Error()) -- 2.25.1