From f0ea5131773129a4c201a241ee4ea5467d6deef1 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Sat, 10 Sep 2022 10:51:34 -0700 Subject: [PATCH 1/2] Update Cwtch / Trigger Antispam PLugin --- go.mod | 2 ++ utils/eventHandler.go | 1 + 2 files changed, 3 insertions(+) diff --git a/go.mod b/go.mod index 9af3cd6..5a3172b 100644 --- a/go.mod +++ b/go.mod @@ -29,3 +29,5 @@ require ( golang.org/x/tools v0.1.10 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect ) + +replace cwtch.im/cwtch => /home/sarah/workspace/src/cwtch.im/cwtch \ No newline at end of file diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 9a7ba6d..0e9b7a2 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -143,6 +143,7 @@ func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { profile.SetScopedZonedAttribute(attr.LocalScope, attr.ProfileZone, constants2.PeerOnline, event.False) eh.app.AddPeerPlugin(onion, plugins.CONNECTIONRETRY) eh.app.AddPeerPlugin(onion, plugins.NETWORKCHECK) + eh.app.AddPeerPlugin(onion, plugins.ANTISPAM) // If the user has chosen to block unknown profiles // then explicitly configure the protocol engine to do so.. From 39eaa5c8c3fc88fadab4be147c0bc782e1165dd6 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Sat, 10 Sep 2022 11:45:00 -0700 Subject: [PATCH 2/2] upgrade cwtch, fix acn reset --- go.mod | 6 ++---- go.sum | 5 ++--- utils/eventHandler.go | 5 ++++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go.mod b/go.mod index 5a3172b..9d6b48f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go go 1.17 require ( - cwtch.im/cwtch v0.18.1 + cwtch.im/cwtch v0.18.3 git.openprivacy.ca/cwtch.im/server v1.4.5 git.openprivacy.ca/openprivacy/connectivity v1.8.6 git.openprivacy.ca/openprivacy/log v1.0.3 @@ -28,6 +28,4 @@ require ( golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64 // indirect golang.org/x/tools v0.1.10 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect -) - -replace cwtch.im/cwtch => /home/sarah/workspace/src/cwtch.im/cwtch \ No newline at end of file +) \ No newline at end of file diff --git a/go.sum b/go.sum index 859044d..c7f6f6a 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,6 @@ cwtch.im/cwtch v0.18.0/go.mod h1:StheazFFY7PKqBbEyDVLhzWW6WOat41zV0ckC240c5Y= -cwtch.im/cwtch v0.18.1 h1:Z5doy6bMLMZFyLRXOxiZ0CjyUGA3Y59mrN4Ps0/HAw8= -cwtch.im/cwtch v0.18.1/go.mod h1:StheazFFY7PKqBbEyDVLhzWW6WOat41zV0ckC240c5Y= +cwtch.im/cwtch v0.18.3 h1:3zBvC4buII6pWQ+OOVUR6WuAwQDKCxSrj0ZOYKEeB6I= +cwtch.im/cwtch v0.18.3/go.mod h1:StheazFFY7PKqBbEyDVLhzWW6WOat41zV0ckC240c5Y= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -95,7 +95,6 @@ golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9t golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08 h1:h+GZ3ubjuWaQjGe8owMGcmMVCqs0xYJtRG5y2bpHaqU= golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= diff --git a/utils/eventHandler.go b/utils/eventHandler.go index 0e9b7a2..68f4644 100644 --- a/utils/eventHandler.go +++ b/utils/eventHandler.go @@ -84,9 +84,12 @@ func (eh *EventHandler) GetNextEvent() string { } } +// track acnStatus across events +var acnStatus = -1 + // handleAppBusEvent enriches AppBus events so they are usable with out further data fetches func (eh *EventHandler) handleAppBusEvent(e *event.Event) string { - acnStatus := -1 + if eh.app != nil { switch e.EventType { case event.ACNStatus: