3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 11:59:40 +01:00

Merge pull request #1813 from slingamn/message_error

CHATHISTORY with nonexistent msgid should send empty batch
This commit is contained in:
Shivaram Lingamneni 2021-11-02 20:59:02 -04:00 committed by GitHub
commit 7e93770540
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1043,14 +1043,22 @@ func (s *mySQLHistorySequence) Between(start, end history.Selector, limit int) (
if start.Msgid != "" {
startTime, _, _, err = s.mysql.lookupMsgid(ctx, start.Msgid, false)
if err != nil {
return nil, err
if err == sql.ErrNoRows {
return nil, nil
} else {
return nil, err
}
}
}
endTime := end.Time
if end.Msgid != "" {
endTime, _, _, err = s.mysql.lookupMsgid(ctx, end.Msgid, false)
if err != nil {
return nil, err
if err == sql.ErrNoRows {
return nil, nil
} else {
return nil, err
}
}
}