mirror of
https://github.com/makayabou/asg-server.git
synced 2026-05-02 17:43:36 +02:00
build states before the struct literal
This commit is contained in:
parent
0aea0cbaf4
commit
ccf423ab61
@ -315,17 +315,17 @@ func (s *Service) recipientsStateToModel(input []smsgateway.RecipientState, hash
|
||||
}
|
||||
|
||||
func modelToMessageState(input Message) MessageStateOut {
|
||||
return MessageStateOut{
|
||||
DeviceID: input.DeviceID,
|
||||
IsHashed: input.IsHashed,
|
||||
IsEncrypted: input.IsEncrypted,
|
||||
|
||||
states := make(map[string]time.Time)
|
||||
states := make(map[string]time.Time)
|
||||
for _, s := range input.States {
|
||||
if !s.UpdatedAt.IsZero() {
|
||||
states[string(s.State)] = s.UpdatedAt
|
||||
}
|
||||
}
|
||||
return MessageStateOut{
|
||||
DeviceID: input.DeviceID,
|
||||
IsHashed: input.IsHashed,
|
||||
IsEncrypted: input.IsEncrypted,
|
||||
|
||||
MessageStateIn: MessageStateIn{
|
||||
ID: input.ExtID,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user