From d2abed7583f5cc2174e2af9e4cc40ca9f2202694 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Fri, 10 Dec 2021 16:28:13 -0800 Subject: [PATCH] fix server description; fix serverInfo to have identifier; add themeMode to settings; cwtch bump --- features/groups/group_functionality.go | 5 ++--- features/groups/server.go | 9 +++++---- features/servers/servers_functionality.go | 2 -- go.mod | 2 +- go.sum | 2 ++ utils/settings.go | 1 + 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/features/groups/group_functionality.go b/features/groups/group_functionality.go index 77be796..7c0d7b0 100644 --- a/features/groups/group_functionality.go +++ b/features/groups/group_functionality.go @@ -8,7 +8,6 @@ import ( "cwtch.im/cwtch/protocol/connections" "fmt" "git.openprivacy.ca/cwtch.im/libcwtch-go/constants" - "git.openprivacy.ca/cwtch.im/libcwtch-go/features/servers" ) const groupExperiment = "tapir-groups-experiment" @@ -57,6 +56,6 @@ func (gf *GroupFunctionality) GetServerInfo(serverOnion string, profile peer.Cwt } } - description, _ := serverInfo.GetAttribute(attr.LocalScope, servers.ServerZone, constants.Description) - return Server{Onion: serverOnion, Status: connections.ConnectionStateName[profile.GetPeerState(serverInfo.Handle)], Keys: serverKeys, Description: description} + description, _ := serverInfo.GetAttribute(attr.LocalScope, attr.ServerZone, constants.Description) + return Server{Onion: serverOnion, Identifier: serverInfo.ID, Status: connections.ConnectionStateName[profile.GetPeerState(serverInfo.Handle)], Keys: serverKeys, Description: description} } diff --git a/features/groups/server.go b/features/groups/server.go index 700f038..e24be46 100644 --- a/features/groups/server.go +++ b/features/groups/server.go @@ -6,8 +6,9 @@ type ServerKey struct { } type Server struct { - Onion string `json:"onion"` - Status string `json:"status"` - Description string `json:"description"` - Keys []ServerKey `json:"keys"` + Onion string `json:"onion"` + Identifier int `json:"identifier"` + Status string `json:"status"` + Description string `json:"description"` + Keys []ServerKey `json:"keys"` } diff --git a/features/servers/servers_functionality.go b/features/servers/servers_functionality.go index f15d361..41a8fce 100644 --- a/features/servers/servers_functionality.go +++ b/features/servers/servers_functionality.go @@ -2,7 +2,6 @@ package servers import ( "cwtch.im/cwtch/event" - "cwtch.im/cwtch/model/attr" "fmt" "git.openprivacy.ca/cwtch.im/server" "git.openprivacy.ca/openprivacy/connectivity" @@ -36,7 +35,6 @@ const ( ) // TODO: move into Cwtch model/attr -const ServerZone = attr.Zone("server") type ServerInfo struct { Onion string diff --git a/go.mod b/go.mod index e5b29ee..313bb29 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go go 1.15 require ( - cwtch.im/cwtch v0.14.2 + cwtch.im/cwtch v0.14.3 git.openprivacy.ca/cwtch.im/server v1.4.1 git.openprivacy.ca/openprivacy/connectivity v1.5.0 git.openprivacy.ca/openprivacy/log v1.0.3 diff --git a/go.sum b/go.sum index 1d4c5e1..0984f1b 100644 --- a/go.sum +++ b/go.sum @@ -13,6 +13,8 @@ cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiy cwtch.im/cwtch v0.14.1/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI= cwtch.im/cwtch v0.14.2 h1:Q9rUainxUcHB2+F46lxhIS5kwZLy9BhPoQI1WnKcOD4= cwtch.im/cwtch v0.14.2/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI= +cwtch.im/cwtch v0.14.3 h1:CKNBYGfKErtLDY3fUOyadTVNbI2JjOe+Ud/srydVAko= +cwtch.im/cwtch v0.14.3/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= diff --git a/utils/settings.go b/utils/settings.go index c28379f..1786729 100644 --- a/utils/settings.go +++ b/utils/settings.go @@ -27,6 +27,7 @@ const saltFile = "SALT" type GlobalSettings struct { Locale string Theme string + ThemeMode string PreviousPid int64 ExperimentsEnabled bool Experiments map[string]bool