From 3569945d75b27345940837d2cbcee2ca061396d1 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong (cubxxw)" <3293172751nss@gmail.com> Date: Tue, 12 Mar 2024 17:14:36 +0800 Subject: [PATCH] feat: make lint format --- internal/api/msg.go | 7 ++----- internal/msgtransfer/online_history_msg_handler.go | 9 ++++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/internal/api/msg.go b/internal/api/msg.go index d38c14d4e..ad5001459 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -215,25 +215,22 @@ func (m *MessageApi) SendMessage(c *gin.Context) { // Set the receiver ID in the message data. sendMsgReq.MsgData.RecvID = req.RecvID - // Declare a variable to store the message sending status. - var status int - // Attempt to send the message using the client. respPb, err := m.Client.SendMsg(c, sendMsgReq) if err != nil { // Set the status to failed and respond with an error if sending fails. - status = constant.MsgSendFailed apiresp.GinError(c, err) return } // Set the status to successful if the message is sent. - status = constant.MsgSendSuccessed + var status int = constant.MsgSendSuccessed // Attempt to update the message sending status in the system. _, err = m.Client.SetSendMsgStatus(c, &msg.SetSendMsgStatusReq{ Status: int32(status), }) + if err != nil { // Log the error if updating the status fails. apiresp.GinError(c, err) diff --git a/internal/msgtransfer/online_history_msg_handler.go b/internal/msgtransfer/online_history_msg_handler.go index b81bd12b8..50fc93369 100644 --- a/internal/msgtransfer/online_history_msg_handler.go +++ b/internal/msgtransfer/online_history_msg_handler.go @@ -184,12 +184,11 @@ func (och *OnlineHistoryRedisConsumerHandler) getPushStorageMsgList( options2 := msgprocessor.Options(msg.Options) if options2.IsHistory() { return true - } else { - // if !(!options2.IsSenderSync() && conversationID == msg.MsgData.SendID) { - // return false - // } - return false } + // if !(!options2.IsSenderSync() && conversationID == msg.MsgData.SendID) { + // return false + // } + return false } for _, v := range totalMsgs { options := msgprocessor.Options(v.message.Options)