X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/d005ef04cfaa26943e6dd33807d741577ffb232a..48ecca21dde5b1c8a3f34bad60512503292c7141:/hotline/transaction_handlers.go?ds=sidebyside diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 813d25c..7864e19 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -808,7 +808,7 @@ func HandleUpdateUser(cc *ClientConn, t *Transaction) (res []Transaction, err er } newAccess := accessBitmap{} - copy(newAccess[:], getField(FieldUserAccess, &subFields).Data[:]) + copy(newAccess[:], getField(FieldUserAccess, &subFields).Data) // Prevent account from creating new account with greater permission for i := 0; i < 64; i++ { @@ -846,7 +846,7 @@ func HandleNewUser(cc *ClientConn, t *Transaction) (res []Transaction, err error } newAccess := accessBitmap{} - copy(newAccess[:], t.GetField(FieldUserAccess).Data[:]) + copy(newAccess[:], t.GetField(FieldUserAccess).Data) // Prevent account from creating new account with greater permission for i := 0; i < 64; i++ { @@ -1015,7 +1015,7 @@ func HandleTranOldPostNews(cc *ClientConn, t *Transaction) (res []Transaction, e } newsPost := fmt.Sprintf(newsTemplate+"\r", cc.UserName, time.Now().Format(newsDateTemplate), t.GetField(FieldData).Data) - newsPost = strings.Replace(newsPost, "\n", "\r", -1) + newsPost = strings.ReplaceAll(newsPost, "\n", "\r") // update news in memory cc.Server.FlatNews = append([]byte(newsPost), cc.Server.FlatNews...) @@ -1605,7 +1605,6 @@ func HandleUploadFile(cc *ClientConn, t *Transaction) (res []Transaction, err er // client has requested to resume a partially transferred file if transferOptions != nil { - fileInfo, err := cc.Server.FS.Stat(fullFilePath + incompleteFileSuffix) if err != nil { return res, err