From c1121f13a1c29467b8a76fec7d278d833a946f9b Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 7 May 2021 16:35:07 -0700 Subject: [PATCH 1/3] Support partially syncing groups (faster syncing) Also properly handle server connection issues for groups --- go.mod | 4 ++-- go.sum | 2 ++ lib.go | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index c578091..d70c7d3 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module git.openprivacy.ca/flutter/libcwtch-go go 1.15 require ( - cwtch.im/cwtch v0.7.1 + cwtch.im/cwtch v0.7.4 git.openprivacy.ca/openprivacy/connectivity v1.4.3 git.openprivacy.ca/openprivacy/log v1.0.2 golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08 // indirect -) +) \ No newline at end of file diff --git a/go.sum b/go.sum index b437428..c56e80d 100644 --- a/go.sum +++ b/go.sum @@ -26,6 +26,8 @@ cwtch.im/cwtch v0.7.0 h1:iBAPk2h9onxAoUAqTpr4w9HHTD8thQrufKEgk7Uwekw= cwtch.im/cwtch v0.7.0/go.mod h1:CVgA/YFG1BUlGLqgxOLgCfYQayquw7D0c25VIK4ZCog= cwtch.im/cwtch v0.7.1 h1:H+/LWucU2TO6j+reMcf7CJcU6s+qq0FlxdZWEOxTvNo= cwtch.im/cwtch v0.7.1/go.mod h1:S0JRLSTwFM+kRrpOPKgUQn/loKe/fc6lLDnOFopRKq8= +cwtch.im/cwtch v0.7.4 h1:8XdTe0zzI6yUV6DaLcDp/OZvFRTlSD+SelKc2Ys2APU= +cwtch.im/cwtch v0.7.4/go.mod h1:S0JRLSTwFM+kRrpOPKgUQn/loKe/fc6lLDnOFopRKq8= cwtch.im/tapir v0.2.1 h1:t1YJB9q5sV1A9xwiiwL6WVfw3dwQWLoecunuzT1PQtw= cwtch.im/tapir v0.2.1/go.mod h1:xzzZ28adyUXNkYL1YodcHsAiTt3IJ8Loc29YVn9mIEQ= git.openprivacy.ca/cwtch.im/tapir v0.3.2 h1:thLWqqY1LkirWFcy9Tg6NgWeYbvo9xBm+s2XVnCIvpY= diff --git a/lib.go b/lib.go index e708e59..f6e762f 100644 --- a/lib.go +++ b/lib.go @@ -101,6 +101,7 @@ func StartCwtch(appDir string, torPath string) { event.NewGroupInvite, event.ServerStateChange, event.ProtocolEngineStopped, + event.RetryServerRequest, } settings := utils.ReadGlobalSettings() settingsJson, _ := json.Marshal(settings) From 8a67b88f2e5c68f3c069322986fbb3214ba14f7b Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Mon, 10 May 2021 16:54:16 -0700 Subject: [PATCH 2/3] Upgrade Cwtch for SendMessageToGroupError --- features/groups/group_functionality.go | 9 +++------ go.mod | 4 ++-- go.sum | 2 ++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/features/groups/group_functionality.go b/features/groups/group_functionality.go index 29c4911..8a45144 100644 --- a/features/groups/group_functionality.go +++ b/features/groups/group_functionality.go @@ -47,19 +47,16 @@ func ExperimentGate(experimentMap map[string]bool) (*GroupFunctionality, error) } // SendMessage is a deprecated api -func (gf *GroupFunctionality) SendMessage(peer peer.CwtchPeer, handle string, message string) error { +func (gf *GroupFunctionality) SendMessage(peer peer.CwtchPeer, handle string, message string) (string, error) { // TODO this auto accepting behaviour needs some thinking through if !peer.GetGroup(handle).Accepted { err := peer.AcceptInvite(handle) if err != nil { log.Errorf("tried to mark a nonexistent group as existed. bad!") - return err + return "", err } } - - _, err := peer.SendMessageToGroupTracked(handle, message) - - return err + return peer.SendMessageToGroupTracked(handle, message) } // ValidPrefix returns true if an import string contains a prefix that indicates it contains information about a diff --git a/go.mod b/go.mod index d70c7d3..47eb333 100644 --- a/go.mod +++ b/go.mod @@ -3,8 +3,8 @@ module git.openprivacy.ca/flutter/libcwtch-go go 1.15 require ( - cwtch.im/cwtch v0.7.4 + cwtch.im/cwtch v0.7.5 git.openprivacy.ca/openprivacy/connectivity v1.4.3 git.openprivacy.ca/openprivacy/log v1.0.2 golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08 // indirect -) \ No newline at end of file +) diff --git a/go.sum b/go.sum index c56e80d..33f0f87 100644 --- a/go.sum +++ b/go.sum @@ -28,6 +28,8 @@ cwtch.im/cwtch v0.7.1 h1:H+/LWucU2TO6j+reMcf7CJcU6s+qq0FlxdZWEOxTvNo= cwtch.im/cwtch v0.7.1/go.mod h1:S0JRLSTwFM+kRrpOPKgUQn/loKe/fc6lLDnOFopRKq8= cwtch.im/cwtch v0.7.4 h1:8XdTe0zzI6yUV6DaLcDp/OZvFRTlSD+SelKc2Ys2APU= cwtch.im/cwtch v0.7.4/go.mod h1:S0JRLSTwFM+kRrpOPKgUQn/loKe/fc6lLDnOFopRKq8= +cwtch.im/cwtch v0.7.5 h1:Ab0XUGWUVUP0WWXT6AsPwWrUaOuM1RmNiw+6AGYsfdk= +cwtch.im/cwtch v0.7.5/go.mod h1:S0JRLSTwFM+kRrpOPKgUQn/loKe/fc6lLDnOFopRKq8= cwtch.im/tapir v0.2.1 h1:t1YJB9q5sV1A9xwiiwL6WVfw3dwQWLoecunuzT1PQtw= cwtch.im/tapir v0.2.1/go.mod h1:xzzZ28adyUXNkYL1YodcHsAiTt3IJ8Loc29YVn9mIEQ= git.openprivacy.ca/cwtch.im/tapir v0.3.2 h1:thLWqqY1LkirWFcy9Tg6NgWeYbvo9xBm+s2XVnCIvpY= From 62db9958429b49edde49d07905724070f1f177a8 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Mon, 10 May 2021 17:11:13 -0700 Subject: [PATCH 3/3] Version Bump to 0.7.6 --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 47eb333..972284a 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.openprivacy.ca/flutter/libcwtch-go go 1.15 require ( - cwtch.im/cwtch v0.7.5 + cwtch.im/cwtch v0.7.6 git.openprivacy.ca/openprivacy/connectivity v1.4.3 git.openprivacy.ca/openprivacy/log v1.0.2 golang.org/x/mobile v0.0.0-20210220033013-bdb1ca9a1e08 // indirect diff --git a/go.sum b/go.sum index 33f0f87..92ab857 100644 --- a/go.sum +++ b/go.sum @@ -30,6 +30,8 @@ cwtch.im/cwtch v0.7.4 h1:8XdTe0zzI6yUV6DaLcDp/OZvFRTlSD+SelKc2Ys2APU= cwtch.im/cwtch v0.7.4/go.mod h1:S0JRLSTwFM+kRrpOPKgUQn/loKe/fc6lLDnOFopRKq8= cwtch.im/cwtch v0.7.5 h1:Ab0XUGWUVUP0WWXT6AsPwWrUaOuM1RmNiw+6AGYsfdk= cwtch.im/cwtch v0.7.5/go.mod h1:S0JRLSTwFM+kRrpOPKgUQn/loKe/fc6lLDnOFopRKq8= +cwtch.im/cwtch v0.7.6 h1:dEj9vtk9gv7Fwc7ru6ir/mZLSEnqBU1Pr0on/xyUdKE= +cwtch.im/cwtch v0.7.6/go.mod h1:S0JRLSTwFM+kRrpOPKgUQn/loKe/fc6lLDnOFopRKq8= cwtch.im/tapir v0.2.1 h1:t1YJB9q5sV1A9xwiiwL6WVfw3dwQWLoecunuzT1PQtw= cwtch.im/tapir v0.2.1/go.mod h1:xzzZ28adyUXNkYL1YodcHsAiTt3IJ8Loc29YVn9mIEQ= git.openprivacy.ca/cwtch.im/tapir v0.3.2 h1:thLWqqY1LkirWFcy9Tg6NgWeYbvo9xBm+s2XVnCIvpY=