From 03a43f64f144c730f3546d0be1ed5ddf8da7db40 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 6 Jul 2019 22:58:56 +0100 Subject: [PATCH] Fix posts --- epicyon.py | 4 ++-- posts.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epicyon.py b/epicyon.py index b57c500e..b4a93f1f 100644 --- a/epicyon.py +++ b/epicyon.py @@ -134,7 +134,7 @@ if args.posts: sys.exit() if args.postsraw: - if '@' not in args.posts: + if '@' not in args.postsraw: print('Syntax: --postsraw nickname@domain') sys.exit() nickname=args.postsraw.split('@')[0] @@ -344,7 +344,7 @@ if args.testdata: followerOfPerson(baseDir,nickname,domain,'admin',domain,federationList,True) createPublicPost(baseDir,nickname,domain,port,httpPrefix,"like, this is totally just a test, man",False,True,False,capsList) createPublicPost(baseDir,nickname,domain,port,httpPrefix,"Zoiks!!!",False,True,False,capsList) - createPublicPost(baseDir,nickname,domain,port,httpPrefix,"Hey scoob we need more milkshakes",False,True,False,capsList) + createPublicPost(baseDir,nickname,domain,port,httpPrefix,"Hey scoob we need like a hundred more milkshakes",False,True,False,capsList) createPublicPost(baseDir,nickname,domain,port,httpPrefix,"Getting kinda spooky around here",False,True,False,capsList) createPublicPost(baseDir,nickname,domain,port,httpPrefix,"And they would have gotten away with it too if it wasn't for those pesky hackers",False,True,False,capsList) createPublicPost(baseDir,nickname,domain,port,httpPrefix,"man, these centralized sites are, like, the worst!",False,True,False,capsList) diff --git a/posts.py b/posts.py index d970f52d..54b2a25c 100644 --- a/posts.py +++ b/posts.py @@ -227,7 +227,7 @@ def getPosts(session,outboxUrl: str,maxPosts: int,maxMentions: int, \ if item['object']['conversation']: # no conversations originated in non-permitted domains if urlPermitted(item['object']['conversation'], \ - federationList,"objects:read"): + federationList,capsList,"objects:read"): conversation = item['object']['conversation'] attachment = [] @@ -812,6 +812,7 @@ def getPublicPostsOfPerson(nickname: str,domain: str, \ personCache={} cachedWebfingers={} federationList=[] + capsList=[] httpPrefix='https' handle=httpPrefix+"://"+domain+"/@"+nickname @@ -828,6 +829,6 @@ def getPublicPostsOfPerson(nickname: str,domain: str, \ maxEmoji=10 maxAttachments=5 userPosts = getPosts(session,personUrl,30,maxMentions,maxEmoji, \ - maxAttachments,federationList,personCache, \ - raw,simple) + maxAttachments,federationList,capsList, \ + personCache,raw,simple) #print(str(userPosts))