From 2caaa7eb872372dfd83cd4f1b16090cd87fe7385 Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Wed, 17 Nov 2021 16:01:25 -0800 Subject: [PATCH] More Deletions --- model/group.go | 69 -------------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/model/group.go b/model/group.go index f19bb8c..3e1b6ff 100644 --- a/model/group.go +++ b/model/group.go @@ -88,75 +88,6 @@ func (g *Group) Invite() (string, error) { return serializedInvite, err } -//// AddSentMessage takes a DecryptedGroupMessage and adds it to the Groups Timeline -//func (g *Group) AddSentMessage(message *groups.DecryptedGroupMessage, sig []byte) Message { -// g.lock.Lock() -// defer g.lock.Unlock() -// timelineMessage := Message{ -// Message: message.Text, -// Timestamp: time.Unix(int64(message.Timestamp), 0), -// Received: time.Unix(0, 0), -// Signature: sig, -// PeerID: message.Onion, -// PreviousMessageSig: message.PreviousMessageSig, -// ReceivedByServer: false, -// } -// g.Timeline.Insert(&timelineMessage) -// return timelineMessage -//} - -//// ErrorSentMessage removes a sent message from the unacknowledged list and sets its error flag if found, otherwise returns false -//func (g *Group) ErrorSentMessage(sig []byte, error string) bool { -// g.lock.Lock() -// defer g.lock.Unlock() -// -// return g.Timeline.SetSendError(sig, error) -//} - -//// GetMessage returns the message at index `index` if it exists. Otherwise returns false. -//// This routine also returns the length of the timeline -//// If go has an optional type this would return Option... -//func (g *Group) GetMessage(index int) (bool, Message, int) { -// g.lock.Lock() -// defer g.lock.Unlock() -// -// length := len(g.Timeline.Messages) -// -// if length > index { -// return true, g.Timeline.Messages[index], length -// } -// return false, Message{}, length -//} - -//// AddMessage takes a DecryptedGroupMessage and adds it to the Groups Timeline -//func (g *Group) AddMessage(message *groups.DecryptedGroupMessage, sig []byte) (*Message, int) { -// -// g.lock.Lock() -// defer g.lock.Unlock() -// -// timelineMessage := &Message{ -// Message: message.Text, -// Timestamp: time.Unix(int64(message.Timestamp), 0), -// Received: time.Now(), -// Signature: sig, -// PeerID: message.Onion, -// PreviousMessageSig: message.PreviousMessageSig, -// ReceivedByServer: true, -// Error: "", -// Acknowledged: true, -// } -// index := g.Timeline.Insert(timelineMessage) -// -// return timelineMessage, index -//} - -//// GetTimeline provides a safe copy of the timeline -//func (g *Group) GetTimeline() (timeline []Message) { -// g.lock.Lock() -// defer g.lock.Unlock() -// return g.Timeline.GetMessages() -//} - //EncryptMessage takes a message and encrypts the message under the group key. func (g *Group) EncryptMessage(message *groups.DecryptedGroupMessage) ([]byte, error) { var nonce [24]byte