More Deletions
continuous-integration/drone/push Build is pending
Details
continuous-integration/drone/push Build is pending
Details
This commit is contained in:
parent
0614d31366
commit
2caaa7eb87
|
@ -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<Message>...
|
||||
//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
|
||||
|
|
Loading…
Reference in New Issue