diff --git a/db/newsgroup.sql b/db/newsgroup.sql index 8170522..29023d0 100644 --- a/db/newsgroup.sql +++ b/db/newsgroup.sql @@ -6,7 +6,7 @@ create table newsgroup ( created_by TEXT NOT NULL, name TEXT NOT NULL, description TEXT NOT NULL, - active BOOLEAN NOT NULL DEFAULT FALSE + writable BOOLEAN NOT NULL DEFAULT FALSE ); create table message ( diff --git a/lib/nntp/tiny/newsgroup.py b/lib/nntp/tiny/newsgroup.py index 4c2c700..2fd9fb6 100644 --- a/lib/nntp/tiny/newsgroup.py +++ b/lib/nntp/tiny/newsgroup.py @@ -7,7 +7,7 @@ class Newsgroup(DatabaseTable): key = 'id' columns = ( 'id', 'created_on', 'created_by', 'name', 'description', - 'active' + 'writable' ) @staticmethod @@ -18,7 +18,7 @@ class Newsgroup(DatabaseTable): newsgroup.created_by = row['created_by'] newsgroup.name = row['name'] newsgroup.description = row['description'] - newsgroup.active = row['active'] + newsgroup.writable = row['writable'] return newsgroup @@ -28,5 +28,5 @@ class Newsgroup(DatabaseTable): self.created_by, self.name, self.description, - self.active + self.writable ) diff --git a/lib/nntp/tiny/session.py b/lib/nntp/tiny/session.py index 1b35429..8193db8 100644 --- a/lib/nntp/tiny/session.py +++ b/lib/nntp/tiny/session.py @@ -233,7 +233,7 @@ class Session(): 'min': row[1], 'max': row[2], 'name': newsgroup.name, - 'perms': 'y' if newsgroup.active else 'n' + 'perms': 'y' if newsgroup.writable else 'n' } def _cmd_listgroup(self, *args): @@ -709,7 +709,7 @@ class Session(): for name in names: newsgroup = self.server.newsgroups.get(name) - if newsgroup is None or not newsgroup.active: + if newsgroup is None or not newsgroup.writable: return ResponseCode.NNTP_POST_PROHIBITED newsgroups.append(self.server.newsgroups[name])