Browse Source

fmt

pull/16/head
Sarah Jamie Lewis 2 years ago
parent
commit
be7721d02d
5 changed files with 6 additions and 7 deletions
  1. +1
    -1
      app/cli/main.go
  2. +1
    -2
      model/group.go
  3. +1
    -1
      model/message_test.go
  4. +2
    -2
      model/profile_test.go
  5. +1
    -1
      peer/connections/peerpeerconnection_test.go

+ 1
- 1
app/cli/main.go View File

@@ -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)


+ 1
- 2
model/group.go View File

@@ -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()


+ 1
- 1
model/message_test.go View File

@@ -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)


+ 2
- 2
model/profile_test.go View File

@@ -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)


+ 1
- 1
peer/connections/peerpeerconnection_test.go View File

@@ -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 {


Loading…
Cancel
Save