diff --git a/app/cli/main.go b/app/cli/main.go index 3639439..b54287d 100644 --- a/app/cli/main.go +++ b/app/cli/main.go @@ -273,7 +273,7 @@ func main() { case "new-group": if len(commands) == 2 { fmt.Printf("Setting up a new group on server:%v\n", commands[1]) - id, _ ,err:= app.Peer.Profile.StartGroup(commands[1]) + id, _, err := app.Peer.Profile.StartGroup(commands[1]) if err == nil { fmt.Printf("New Group [%v] created for server %v\n", id, commands[1]) app.Peer.Save(profilefile) diff --git a/model/group.go b/model/group.go index 11466e0..a11943b 100644 --- a/model/group.go +++ b/model/group.go @@ -2,6 +2,7 @@ package model import ( "crypto/rand" + "errors" "fmt" "git.mascherari.press/cwtch/protocol" "github.com/golang/protobuf/proto" @@ -10,7 +11,6 @@ import ( "io" "sync" "time" - "errors" ) //Group defines and encapsulates Cwtch's conception of group chat. Which are sessions @@ -72,7 +72,6 @@ func (g *Group) Invite() ([]byte, error) { return invite, err } - // AddMessage takes a DecryptedGroupMessage and adds it to the Groups Timeline func (g *Group) AddMessage(message *protocol.DecryptedGroupMessage, verified bool) *Message { g.lock.Lock() diff --git a/model/message_test.go b/model/message_test.go index 2573403..6e869e3 100644 --- a/model/message_test.go +++ b/model/message_test.go @@ -16,7 +16,7 @@ func TestTranscriptConsistency(t *testing.T) { sarah.AddContact(alice.Onion, &alice.PublicProfile) alice.AddContact(sarah.Onion, &sarah.PublicProfile) - gid, invite,_ := alice.StartGroup("aaa.onion") + gid, invite, _ := alice.StartGroup("aaa.onion") gci := &protocol.CwtchPeerPacket{} proto.Unmarshal(invite, gci) sarah.ProcessInvite(gci.GetGroupChatInvite(), alice.Onion) diff --git a/model/profile_test.go b/model/profile_test.go index 08a63e2..40894af 100644 --- a/model/profile_test.go +++ b/model/profile_test.go @@ -43,7 +43,7 @@ func TestProfileGroup(t *testing.T) { sarah.AddContact(alice.Onion, &alice.PublicProfile) alice.AddContact(sarah.Onion, &sarah.PublicProfile) - gid, invite,_ := alice.StartGroup("aaa.onion") + gid, invite, _ := alice.StartGroup("aaa.onion") gci := &protocol.CwtchPeerPacket{} proto.Unmarshal(invite, gci) sarah.ProcessInvite(gci.GetGroupChatInvite(), alice.Onion) @@ -52,7 +52,7 @@ func TestProfileGroup(t *testing.T) { c, _ := sarah.EncryptMessageToGroup("Hello World", group.GroupID) alice.AttemptDecryption(c) - gid2, invite2 ,_:= alice.StartGroup("bbb.onion") + gid2, invite2, _ := alice.StartGroup("bbb.onion") gci2 := &protocol.CwtchPeerPacket{} proto.Unmarshal(invite2, gci2) sarah.ProcessInvite(gci2.GetGroupChatInvite(), alice.Onion) diff --git a/peer/connections/peerpeerconnection_test.go b/peer/connections/peerpeerconnection_test.go index 9102f2d..d43609d 100644 --- a/peer/connections/peerpeerconnection_test.go +++ b/peer/connections/peerpeerconnection_test.go @@ -100,7 +100,7 @@ func TestPeerPeerConnection(t *testing.T) { t.Errorf("should have received an identity packet") } - _, invite,_ := profile.StartGroup("aaa.onion") + _, invite, _ := profile.StartGroup("aaa.onion") ppc.SendGroupInvite(invite) time.Sleep(time.Second * 3) if tp.ReceivedGroupInvite == false {