Update Server State on ServerStateChangeEvent in addition to individual groups. #364

Merged
dan merged 4 commits from message_flags into master 2021-06-10 17:56:36 +00:00
1 changed files with 4 additions and 0 deletions
Showing only changes of commit aa6f2499b9 - Show all commits

View File

@ -8,6 +8,7 @@ import (
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"git.openprivacy.ca/openprivacy/connectivity/tor"
"golang.org/x/crypto/ed25519"
"io"
@ -390,6 +391,9 @@ func (p *Profile) GetGroup(groupID string) (g *Group) {
func (p *Profile) ProcessInvite(invite string) (string, error) {
gci, err := ValidateInvite(invite)
if err == nil {
if _, exists := p.GetContact(gci.ServerHost); !exists {
return "", fmt.Errorf("unknown server. a server key bundle needs to be imported before this group can be verified")
}
group := new(Group)
group.Version = CurrentGroupVersion
group.GroupID = gci.GroupID