diff --git a/model/message_test.go b/model/message_test.go index b440b8e..958b050 100644 --- a/model/message_test.go +++ b/model/message_test.go @@ -47,6 +47,9 @@ func TestTranscriptConsistency(t *testing.T) { sarah.AddContact(alice.Onion, &alice.PublicProfile) alice.AddContact(sarah.Onion, &sarah.PublicProfile) + // The lightest weight server entry possible (usually we would import a key bundle...) + sarah.AddContact("2c3kmoobnyghj2zw6pwv7d57yzld753auo3ugauezzpvfak3ahc4bdyd", &PublicProfile{Attributes: map[string]string{string(KeyTypeServerOnion): "2c3kmoobnyghj2zw6pwv7d57yzld753auo3ugauezzpvfak3ahc4bdyd"}}) + gid, invite, _ := alice.StartGroup("2c3kmoobnyghj2zw6pwv7d57yzld753auo3ugauezzpvfak3ahc4bdyd") sarah.ProcessInvite(invite) diff --git a/model/profile.go b/model/profile.go index b55feb0..be05f55 100644 --- a/model/profile.go +++ b/model/profile.go @@ -391,7 +391,7 @@ 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 { + if server, exists := p.GetContact(gci.ServerHost); !exists || !server.IsServer() { return "", fmt.Errorf("unknown server. a server key bundle needs to be imported before this group can be verified") } group := new(Group)