fix server description; fix serverInfo to have identifier; add themeMode to settings; cwtch bump
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Dan Ballard 2021-12-10 16:28:13 -08:00
parent 28a13aaca9
commit d2abed7583
6 changed files with 11 additions and 10 deletions

View File

@ -8,7 +8,6 @@ import (
"cwtch.im/cwtch/protocol/connections" "cwtch.im/cwtch/protocol/connections"
"fmt" "fmt"
"git.openprivacy.ca/cwtch.im/libcwtch-go/constants" "git.openprivacy.ca/cwtch.im/libcwtch-go/constants"
"git.openprivacy.ca/cwtch.im/libcwtch-go/features/servers"
) )
const groupExperiment = "tapir-groups-experiment" 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) description, _ := serverInfo.GetAttribute(attr.LocalScope, attr.ServerZone, constants.Description)
return Server{Onion: serverOnion, Status: connections.ConnectionStateName[profile.GetPeerState(serverInfo.Handle)], Keys: serverKeys, Description: description} return Server{Onion: serverOnion, Identifier: serverInfo.ID, Status: connections.ConnectionStateName[profile.GetPeerState(serverInfo.Handle)], Keys: serverKeys, Description: description}
} }

View File

@ -6,8 +6,9 @@ type ServerKey struct {
} }
type Server struct { type Server struct {
Onion string `json:"onion"` Onion string `json:"onion"`
Status string `json:"status"` Identifier int `json:"identifier"`
Description string `json:"description"` Status string `json:"status"`
Keys []ServerKey `json:"keys"` Description string `json:"description"`
Keys []ServerKey `json:"keys"`
} }

View File

@ -2,7 +2,6 @@ package servers
import ( import (
"cwtch.im/cwtch/event" "cwtch.im/cwtch/event"
"cwtch.im/cwtch/model/attr"
"fmt" "fmt"
"git.openprivacy.ca/cwtch.im/server" "git.openprivacy.ca/cwtch.im/server"
"git.openprivacy.ca/openprivacy/connectivity" "git.openprivacy.ca/openprivacy/connectivity"
@ -36,7 +35,6 @@ const (
) )
// TODO: move into Cwtch model/attr // TODO: move into Cwtch model/attr
const ServerZone = attr.Zone("server")
type ServerInfo struct { type ServerInfo struct {
Onion string Onion string

2
go.mod
View File

@ -3,7 +3,7 @@ module git.openprivacy.ca/cwtch.im/libcwtch-go
go 1.15 go 1.15
require ( 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/cwtch.im/server v1.4.1
git.openprivacy.ca/openprivacy/connectivity v1.5.0 git.openprivacy.ca/openprivacy/connectivity v1.5.0
git.openprivacy.ca/openprivacy/log v1.0.3 git.openprivacy.ca/openprivacy/log v1.0.3

2
go.sum
View File

@ -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.1/go.mod h1:/fLuoYLY/7JHw6RojFojpd245CiOcU24QpWqzh9FRDI=
cwtch.im/cwtch v0.14.2 h1:Q9rUainxUcHB2+F46lxhIS5kwZLy9BhPoQI1WnKcOD4= 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.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= 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 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=

View File

@ -27,6 +27,7 @@ const saltFile = "SALT"
type GlobalSettings struct { type GlobalSettings struct {
Locale string Locale string
Theme string Theme string
ThemeMode string
PreviousPid int64 PreviousPid int64
ExperimentsEnabled bool ExperimentsEnabled bool
Experiments map[string]bool Experiments map[string]bool