This commit is contained in:
Andrea Maria Piana 2020-11-05 17:07:24 +01:00 committed by flexsurfer
parent 6f207def2b
commit 8966d81199
2 changed files with 3 additions and 4 deletions

View File

@ -467,7 +467,7 @@ func (db sqlitePersistence) MessagesByIDs(ids []string) ([]*common.Message, erro
func (db sqlitePersistence) MessageByChatID(chatID string, currCursor string, limit int) ([]*common.Message, string, error) {
cursorWhere := ""
if currCursor != "" {
cursorWhere = "AND cursor <= ?"
cursorWhere = "AND cursor <= ?" //nolint: goconst
}
allFields := db.tableUserMessagesAllFieldsJoin()
args := []interface{}{chatID}
@ -536,7 +536,7 @@ func (db sqlitePersistence) MessageByChatID(chatID string, currCursor string, li
func (db sqlitePersistence) MessageByChatIDs(chatIDs []string, currCursor string, limit int) ([]*common.Message, string, error) {
cursorWhere := ""
if currCursor != "" {
cursorWhere = "AND cursor <= ?"
cursorWhere = "AND cursor <= ?" //nolint: goconst
}
allFields := db.tableUserMessagesAllFieldsJoin()
args := make([]interface{}, len(chatIDs))

View File

@ -2600,9 +2600,8 @@ func (m *Messenger) MessageByChatID(chatID, cursor string, limit int) ([]*common
}
}
return m.persistence.MessageByChatIDs(chatIDs, cursor, limit)
} else {
return m.persistence.MessageByChatID(chatID, cursor, limit)
}
return m.persistence.MessageByChatID(chatID, cursor, limit)
}
func (m *Messenger) SaveMessages(messages []*common.Message) error {