forked from cwtch.im/cwtch
fmt
This commit is contained in:
parent
bd1ad4fc67
commit
be7721d02d
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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…
Reference in New Issue