message ack receice and reactions protobuf
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc
2026-03-06 11:59:47 +01:00
parent f6531e344e
commit d23ab73cf9
4 changed files with 204 additions and 72 deletions

View File

@@ -148,6 +148,16 @@ func ConsumeInboxFile(messageFilename string) ([]string, []string, string, error
return nil, nil, "ReadMessage: ProcessInboundUserMessage", err
}
// Check for received or processed already filled => it's an ack for one of our sent messages
if len(usermsg.Data) == 0 && usermsg.Status != nil && usermsg.Status.Uuid != "" &&
(usermsg.Status.Received != 0 || usermsg.Status.Processed != 0) {
password, _ := client.GetConfig().GetMemPass()
if ackErr := client.UpdateMessageAck(peer, usermsg.Status.Uuid, usermsg.Status.Received, usermsg.Status.Processed, password); ackErr != nil {
logger.Warn().Err(ackErr).Str("uuid", usermsg.Status.Uuid).Msg("ConsumeInboxFile: UpdateMessageAck")
}
continue
}
//fmt.Println("From:", usermsg.From)
//jsonUserMessage, _ := json.Marshal(usermsg)
//fmt.Println(string(jsonUserMessage))
@@ -202,7 +212,7 @@ func ConsumeInboxFile(messageFilename string) ([]string, []string, string, error
logger.Warn().Err(ackErr).Str("peer", peer.Uid).Msg("ConsumeInboxFile: sendDeliveryAck")
}
}
}
}
}
err = os.Remove(messageFilename)