3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-11 14:39:31 +01:00

Merge pull request #1372 from slingamn/sequence

implement the new chathistory fail code INVALID_TARGET
This commit is contained in:
Shivaram Lingamneni 2020-11-04 07:58:22 -08:00 committed by GitHub
commit 507a11a693
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -556,9 +556,7 @@ func chathistoryHandler(server *Server, client *Client, msg ircmsg.IrcMessage, r
} else if err == utils.ErrInvalidParams { } else if err == utils.ErrInvalidParams {
rb.Add(nil, server.name, "FAIL", "CHATHISTORY", "INVALID_PARAMS", msg.Params[0], client.t("Invalid parameters")) rb.Add(nil, server.name, "FAIL", "CHATHISTORY", "INVALID_PARAMS", msg.Params[0], client.t("Invalid parameters"))
} else if sequence == nil { } else if sequence == nil {
// send an empty batch as per the spec rb.Add(nil, server.name, "FAIL", "CHATHISTORY", "INVALID_TARGET", utils.SafeErrorParam(target), client.t("Messages could not be retrieved"))
batchID := rb.StartNestedHistoryBatch(utils.SafeErrorParam(target))
rb.EndNestedBatch(batchID)
} else if err != nil { } else if err != nil {
rb.Add(nil, server.name, "FAIL", "CHATHISTORY", "MESSAGE_ERROR", msg.Params[0], client.t("Messages could not be retrieved")) rb.Add(nil, server.name, "FAIL", "CHATHISTORY", "MESSAGE_ERROR", msg.Params[0], client.t("Messages could not be retrieved"))
} else { } else {

@ -1 +1 @@
Subproject commit 512b4bd74d685aa7ff978668d2c6a124416cebd2 Subproject commit b43e1278057113041ba51ced58571a2ad8dacb5c