Skip to content
Snippets Groups Projects
Commit c99fcead authored by Jono Wenger's avatar Jono Wenger
Browse files

Fix group chat timestamp receive

parent 834f9e36
No related branches found
No related tags found
1 merge request!67Release
...@@ -63,7 +63,8 @@ func NewGroupManager(client *Client, requestFunc GroupRequestFunc, ...@@ -63,7 +63,8 @@ func NewGroupManager(client *Client, requestFunc GroupRequestFunc,
// MakeGroup creates a new group and sends a group request to all members in the // MakeGroup creates a new group and sends a group request to all members in the
// group. The ID of the new group, the rounds the requests were sent on, and the // group. The ID of the new group, the rounds the requests were sent on, and the
// status of the send are contained in NewGroupReport. // status of the send are contained in NewGroupReport.
func (g *GroupChat) MakeGroup(membership *IdList, name, message []byte) (*NewGroupReport, error) { func (g *GroupChat) MakeGroup(membership *IdList, name, message []byte) (
*NewGroupReport, error) {
grp, rounds, status, err := g.m.MakeGroup(membership.list, name, message) grp, rounds, status, err := g.m.MakeGroup(membership.list, name, message)
return &NewGroupReport{&Group{grp}, rounds, status}, err return &NewGroupReport{&Group{grp}, rounds, status}, err
} }
......
...@@ -60,9 +60,9 @@ func (m Manager) receive(rawMsgs chan message.Receive, stop *stoppable.Single) { ...@@ -60,9 +60,9 @@ func (m Manager) receive(rawMsgs chan message.Receive, stop *stoppable.Single) {
SenderID: senderID, SenderID: senderID,
RecipientID: receiveMsg.RecipientID, RecipientID: receiveMsg.RecipientID,
EphemeralID: receiveMsg.EphemeralID, EphemeralID: receiveMsg.EphemeralID,
Timestamp: receiveMsg.Timestamp, Timestamp: timestamp,
RoundID: receiveMsg.RoundId, RoundID: receiveMsg.RoundId,
RoundTimestamp: timestamp, RoundTimestamp: receiveMsg.RoundTimestamp,
}) })
} }
} }
......
...@@ -42,7 +42,8 @@ func TestManager_receive(t *testing.T) { ...@@ -42,7 +42,8 @@ func TestManager_receive(t *testing.T) {
ID: group.MessageID{0, 1, 2, 3}, ID: group.MessageID{0, 1, 2, 3},
Payload: contents, Payload: contents,
SenderID: sender.ID, SenderID: sender.ID,
RoundTimestamp: timestamp.Local(), Timestamp: timestamp.Local(),
RoundTimestamp: timestamp,
} }
// Create cMix message and get public message // Create cMix message and get public message
...@@ -51,11 +52,11 @@ func TestManager_receive(t *testing.T) { ...@@ -51,11 +52,11 @@ func TestManager_receive(t *testing.T) {
t.Errorf("Failed to create new cMix message: %+v", err) t.Errorf("Failed to create new cMix message: %+v", err)
} }
internalMsg, _ := newInternalMsg(cMixMsg.ContentsSize() - publicMinLen) intlMsg, _ := newInternalMsg(cMixMsg.ContentsSize() - publicMinLen)
internalMsg.SetTimestamp(timestamp) intlMsg.SetTimestamp(timestamp)
internalMsg.SetSenderID(m.gs.GetUser().ID) intlMsg.SetSenderID(m.gs.GetUser().ID)
internalMsg.SetPayload(contents) intlMsg.SetPayload(contents)
expectedMsg.ID = group.NewMessageID(g.ID, internalMsg.Marshal()) expectedMsg.ID = group.NewMessageID(g.ID, intlMsg.Marshal())
receiveChan := make(chan message.Receive, 1) receiveChan := make(chan message.Receive, 1)
stop := stoppable.NewSingle("singleStoppable") stop := stoppable.NewSingle("singleStoppable")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment