Set timestamp on group chat invitation
This commit is contained in:
parent
92032c7158
commit
71f66f6806
|
@ -381,11 +381,16 @@ func CreateProfileChat(pubkey string, timesource common.TimeSource) *Chat {
|
|||
}
|
||||
|
||||
func CreateGroupChat(timesource common.TimeSource) Chat {
|
||||
timestamp := timesource.GetCurrentTime()
|
||||
synced := uint32(timestamp / 1000)
|
||||
|
||||
return Chat{
|
||||
Active: true,
|
||||
Color: chatColors[rand.Intn(len(chatColors))], // nolint: gosec
|
||||
Timestamp: int64(timesource.GetCurrentTime()),
|
||||
ChatType: ChatTypePrivateGroupChat,
|
||||
Active: true,
|
||||
Color: chatColors[rand.Intn(len(chatColors))], // nolint: gosec
|
||||
Timestamp: int64(timestamp),
|
||||
SyncedTo: synced,
|
||||
SyncedFrom: synced,
|
||||
ChatType: ChatTypePrivateGroupChat,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -128,9 +128,6 @@ func (m *MessageHandler) HandleMembershipUpdate(messageState *ReceivedMessageSta
|
|||
// unless is coming from us or a contact
|
||||
isActive := messageState.CurrentMessageState.Contact.IsAdded() || messageState.CurrentMessageState.Contact.ID == ourKey
|
||||
newChat.Active = isActive
|
||||
timestamp := uint32(newChat.Timestamp / 1000)
|
||||
newChat.SyncedTo = timestamp
|
||||
newChat.SyncedFrom = timestamp
|
||||
chat = &newChat
|
||||
} else {
|
||||
existingGroup, err := newProtocolGroupFromChat(chat)
|
||||
|
|
|
@ -1185,11 +1185,6 @@ func (m *Messenger) CreateGroupChatWithMembers(ctx context.Context, name string,
|
|||
return nil, err
|
||||
}
|
||||
|
||||
timestamp := uint32(chat.Timestamp / 1000)
|
||||
|
||||
chat.SyncedTo = timestamp
|
||||
chat.SyncedFrom = timestamp
|
||||
|
||||
m.allChats.Store(chat.ID, &chat)
|
||||
|
||||
_, err = m.dispatchMessage(ctx, common.RawMessage{
|
||||
|
|
Loading…
Reference in New Issue