Fossil SCM
Do not filter out the chat-robot messages from /chat search, per feedback.
Commit
b5281f4e6127551e52abd5b7b5867ad1cbc0e0b775b18d4ee3aa018f1326d21e
Parent
21d9ea4adeb3a28…
1 file changed
+2
-12
+2
-12
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -753,30 +753,20 @@ | ||
| 753 | 753 | } |
| 754 | 754 | chat_create_tables(); |
| 755 | 755 | cgi_set_content_type("application/json"); |
| 756 | 756 | |
| 757 | 757 | if( zQuery[0] ){ |
| 758 | - char *zChatRobot = db_get("chat-timeline-user", 0); | |
| 759 | 758 | iMax = db_int64(0, "SELECT max(msgid) FROM chat"); |
| 760 | 759 | iMin = db_int64(0, "SELECT min(msgid) FROM chat"); |
| 761 | 760 | blob_append_sql(&sql, |
| 762 | 761 | "SELECT * FROM (" |
| 763 | 762 | "SELECT c.msgid, datetime(c.mtime), c.xfrom, " |
| 764 | 763 | " highlight(chatfts1, 0, '<span class=\"match\">', '</span>'), " |
| 765 | 764 | " octet_length(c.file), c.fname, c.fmime, c.mdel, c.lmtime" |
| 766 | - " FROM chatfts1(%Q) f, chat c WHERE f.rowid=c.msgid ", | |
| 767 | - zQuery | |
| 768 | - ); | |
| 769 | - if( zChatRobot!=0 ){ | |
| 770 | - if( zChatRobot[0]!=0 ){ | |
| 771 | - blob_append_sql(&sql, "AND c.xfrom IS NOT %Q ", zChatRobot); | |
| 772 | - } | |
| 773 | - fossil_free( zChatRobot ); | |
| 774 | - } | |
| 775 | - blob_append_sql(&sql, | |
| 765 | + " FROM chatfts1(%Q) f, chat c WHERE f.rowid=c.msgid " | |
| 776 | 766 | " ORDER BY f.rowid DESC LIMIT %d" |
| 777 | - ") ORDER BY 1 ASC", nLimit | |
| 767 | + ") ORDER BY 1 ASC", zQuery, nLimit | |
| 778 | 768 | ); |
| 779 | 769 | }else{ |
| 780 | 770 | blob_append_sql(&sql, |
| 781 | 771 | "SELECT msgid, datetime(mtime), xfrom, " |
| 782 | 772 | " xmsg, octet_length(file), fname, fmime, mdel, lmtime" |
| 783 | 773 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -753,30 +753,20 @@ | |
| 753 | } |
| 754 | chat_create_tables(); |
| 755 | cgi_set_content_type("application/json"); |
| 756 | |
| 757 | if( zQuery[0] ){ |
| 758 | char *zChatRobot = db_get("chat-timeline-user", 0); |
| 759 | iMax = db_int64(0, "SELECT max(msgid) FROM chat"); |
| 760 | iMin = db_int64(0, "SELECT min(msgid) FROM chat"); |
| 761 | blob_append_sql(&sql, |
| 762 | "SELECT * FROM (" |
| 763 | "SELECT c.msgid, datetime(c.mtime), c.xfrom, " |
| 764 | " highlight(chatfts1, 0, '<span class=\"match\">', '</span>'), " |
| 765 | " octet_length(c.file), c.fname, c.fmime, c.mdel, c.lmtime" |
| 766 | " FROM chatfts1(%Q) f, chat c WHERE f.rowid=c.msgid ", |
| 767 | zQuery |
| 768 | ); |
| 769 | if( zChatRobot!=0 ){ |
| 770 | if( zChatRobot[0]!=0 ){ |
| 771 | blob_append_sql(&sql, "AND c.xfrom IS NOT %Q ", zChatRobot); |
| 772 | } |
| 773 | fossil_free( zChatRobot ); |
| 774 | } |
| 775 | blob_append_sql(&sql, |
| 776 | " ORDER BY f.rowid DESC LIMIT %d" |
| 777 | ") ORDER BY 1 ASC", nLimit |
| 778 | ); |
| 779 | }else{ |
| 780 | blob_append_sql(&sql, |
| 781 | "SELECT msgid, datetime(mtime), xfrom, " |
| 782 | " xmsg, octet_length(file), fname, fmime, mdel, lmtime" |
| 783 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -753,30 +753,20 @@ | |
| 753 | } |
| 754 | chat_create_tables(); |
| 755 | cgi_set_content_type("application/json"); |
| 756 | |
| 757 | if( zQuery[0] ){ |
| 758 | iMax = db_int64(0, "SELECT max(msgid) FROM chat"); |
| 759 | iMin = db_int64(0, "SELECT min(msgid) FROM chat"); |
| 760 | blob_append_sql(&sql, |
| 761 | "SELECT * FROM (" |
| 762 | "SELECT c.msgid, datetime(c.mtime), c.xfrom, " |
| 763 | " highlight(chatfts1, 0, '<span class=\"match\">', '</span>'), " |
| 764 | " octet_length(c.file), c.fname, c.fmime, c.mdel, c.lmtime" |
| 765 | " FROM chatfts1(%Q) f, chat c WHERE f.rowid=c.msgid " |
| 766 | " ORDER BY f.rowid DESC LIMIT %d" |
| 767 | ") ORDER BY 1 ASC", zQuery, nLimit |
| 768 | ); |
| 769 | }else{ |
| 770 | blob_append_sql(&sql, |
| 771 | "SELECT msgid, datetime(mtime), xfrom, " |
| 772 | " xmsg, octet_length(file), fname, fmime, mdel, lmtime" |
| 773 |