removes anonymous channel from being used as the default channel for anonymous comments

This commit is contained in:
Oleg Silkin 2019-05-31 15:55:48 -04:00
parent 9765b3de2e
commit f405076e37
3 changed files with 6 additions and 12 deletions

View file

@ -8,10 +8,6 @@
"ERROR_LOG": "error.log",
"LOG": "server.log"
},
"ANONYMOUS": {
"CHANNEL_ID": "9cb713f01bf247a0e03170b5ed00d5161340c486",
"CHANNEL_NAME": "@Anonymous"
},
"LOGGING_FORMAT": "%(asctime)s - %(levelname)s - %(module)s - %(funcName)s - %(message)s",
"HOST": "localhost",
"PORT": 5921,

View file

@ -37,11 +37,11 @@ CREATE INDEX IF NOT EXISTS COMMENT_CLAIM_INDEX ON COMMENT (LbryClaimId);
-- VIEWS
-- DROP VIEW IF EXISTS COMMENTS_ON_CLAIMS;
DROP VIEW IF EXISTS COMMENTS_ON_CLAIMS;
CREATE VIEW IF NOT EXISTS COMMENTS_ON_CLAIMS (comment_id, claim_id, timestamp, channel_name, channel_id, channel_url, signature, parent_id, comment) AS
SELECT C.CommentId, C.LbryClaimId, C.Timestamp, CHAN.Name, CHAN.ClaimId, 'lbry://' || CHAN.Name || '#' || CHAN.ClaimId, C.Signature, C.ParentId, C.Body
FROM CHANNEL AS CHAN
INNER JOIN COMMENT C on CHAN.ClaimId = C.ChannelId
FROM COMMENT AS C
LEFT OUTER JOIN CHANNEL CHAN on C.ChannelId = CHAN.ClaimId
ORDER BY C.Timestamp;
@ -56,5 +56,5 @@ CREATE VIEW IF NOT EXISTS COMMENT_REPLIES (Author, CommentBody, ParentAuthor, Pa
ORDER BY OG.Timestamp;
-- this is the default channel for anyone who wants to publish anonymously
INSERT INTO CHANNEL
VALUES ('9cb713f01bf247a0e03170b5ed00d5161340c486', '@Anonymous');
-- INSERT INTO CHANNEL
-- VALUES ('9cb713f01bf247a0e03170b5ed00d5161340c486', '@Anonymous');

View file

@ -7,8 +7,6 @@ import typing
import math
import nacl.hash
from src.settings import config
logger = logging.getLogger(__name__)
@ -133,7 +131,7 @@ def create_comment(conn: sqlite3.Connection, comment: str, claim_id: str, **kwar
logger.exception('Received invalid input')
raise TypeError('Invalid params given to input validation')
else:
channel_id = config['ANONYMOUS']['CHANNEL_ID']
channel_id = None
try:
comment_id = _insert_comment(
conn=conn, comment=comment, claim_id=claim_id, channel_id=channel_id, **kwargs