This commit is contained in:
watsonb8 committed 2023-09-04 18:43:32 -05:00
1 parent 84a017281f
commit 9f65ad172c
3 files changed
+8 -4

No files matched your search

+2 -2
View File
@@ -43,12 +43,12 @@ func (mq *MessageQuery) New() *Message {
const (
getAllMessagesSelect = `
SELECT chat_gmid, chat_receiver, gmid, mxid, sender, timestamp, sent
FROM messages
FROM message
`
getAllMessagesQuery = getAllMessagesSelect + `
WHERE chat_gmid=$1 AND chat_receiver=$2
`
getByGMIDQuery = getAllMessagesQuery + "AND jid=$3"
getByGMIDQuery = getAllMessagesQuery + "AND gmid=$3"
getByMXIDQuery = getAllMessagesSelect + "WHERE mxid=$1"
getLastMessageInChatQuery = getAllMessagesQuery + `
AND timestamp<=$3 AND sent=true