fixed bug in article insertion
[knntp.git] / nntpmarkread.d
blob754660d071636f98f850fb8357f4403ed2b19112
1 /* DigitalMars NNTP reader
2 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
3 * Understanding is not required. Only obedience.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 module nntpmarkread;
20 import std.datetime;
22 import iv.cmdcon;
23 import iv.strex;
24 import iv.vfs;
25 import iv.vfs.io;
27 import nntp;
30 // ////////////////////////////////////////////////////////////////////////// //
31 void main (string[] args) {
32 if (args.length == 1) args ~= ["D", "digitalmars.D.learn", "digitalmars.D", "digitalmars.D.announce", "digitalmars.D.internals"];
34 foreach (string group; args[1..$]) {
35 writeln("=== GROUP: ", group, " ===");
37 auto abase = new ArticleBase(group);
38 abase.load();
39 scope(exit) delete abase;
41 foreach (ref a; abase.alist) {
42 if (a.flags&Article.Flag.Unread) {
43 a.flags &= ~Article.Flag.Unread;
44 a.updated = true;
48 abase.selfCheck();
49 abase.writeUpdates();