mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Fix posts
							parent
							
								
									efb713f4de
								
							
						
					
					
						commit
						03a43f64f1
					
				| 
						 | 
				
			
			@ -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)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										7
									
								
								posts.py
								
								
								
								
							
							
						
						
									
										7
									
								
								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))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue