X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2FSQL%2FPostgreSQL%2Fselect_messagesRange_filtered.sql;fp=src%2Fcore%2FSQL%2FPostgreSQL%2Fselect_messagesRange_filtered.sql;h=087f6112d1945dca0d6a465dd910fc56e6ac7c3d;hp=6030e532e10ef7b31857cb9d1e5aeba53dffd07c;hb=68b12b0b035c460c7bab93959004bd83c0b160f2;hpb=76883c546324b1fb80f465421d4e3c7732505852 diff --git a/src/core/SQL/PostgreSQL/select_messagesRange_filtered.sql b/src/core/SQL/PostgreSQL/select_messagesRange_filtered.sql index 6030e532..087f6112 100644 --- a/src/core/SQL/PostgreSQL/select_messagesRange_filtered.sql +++ b/src/core/SQL/PostgreSQL/select_messagesRange_filtered.sql @@ -1,10 +1,10 @@ -SELECT messageid, time, type, flags, sender, senderprefixes, realname, avatarurl, message +SELECT messageid, time, type, flags, sender, senderprefixes, realname, avatarurl, message FROM backlog JOIN sender ON backlog.senderid = sender.senderid WHERE backlog.messageid >= :first AND backlog.messageid < :last AND bufferid = :buffer - AND backlog.type & :type != 0 - AND (:flags = 0 OR backlog.flags & :flags != 0) + AND (:type <= 0 OR backlog.type & :type != 0) + AND (:flags <= 0 OR backlog.flags & :flags != 0) ORDER BY messageid DESC LIMIT :limit