update ui on block #22
15
lib.go
15
lib.go
|
@ -346,10 +346,9 @@ func AcceptContact(profile, handle string) {
|
||||||
err := application.GetPeer(profile).SetContactAuthorization(handle, model.AuthApproved)
|
err := application.GetPeer(profile).SetContactAuthorization(handle, model.AuthApproved)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
eventHandler.Push(event.NewEvent(event.PeerStateChange, map[event.Field]string{
|
eventHandler.Push(event.NewEvent(event.PeerStateChange, map[event.Field]string{
|
||||||
//application.GetPrimaryBus().Publish(event.NewEvent(event.PeerStateChange, map[event.Field]string{
|
"ProfileOnion": profile,
|
||||||
"ProfileOnion": profile,
|
event.RemotePeer: handle,
|
||||||
event.RemotePeer: handle,
|
"authorization": string(model.AuthApproved),
|
||||||
"authorization": string(model.AuthApproved),
|
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
log.Errorf("error accepting contact: %s", err.Error())
|
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) {
|
func BlockContact(profile, handle string) {
|
||||||
err := application.GetPeer(profile).SetContactAuthorization(handle, model.AuthBlocked)
|
err := application.GetPeer(profile).SetContactAuthorization(handle, model.AuthBlocked)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
application.GetPrimaryBus().Publish(event.NewEvent(event.PeerStateChange, map[event.Field]string{
|
eventHandler.Push(event.NewEvent(event.PeerStateChange, map[event.Field]string{
|
||||||
"ProfileOnion": profile,
|
"ProfileOnion": profile,
|
||||||
event.RemotePeer: handle,
|
event.RemotePeer: handle,
|
||||||
"authorization": string(model.AuthBlocked),
|
"authorization": string(model.AuthBlocked),
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
log.Errorf("error blocking contact: %s", err.Error())
|
log.Errorf("error blocking contact: %s", err.Error())
|
||||||
|
|
Loading…
Reference in New Issue