forked from indymedia/epicyon
				
			List of urls
							parent
							
								
									146d1413c3
								
							
						
					
					
						commit
						b5349762b4
					
				
							
								
								
									
										20
									
								
								posts.py
								
								
								
								
							
							
						
						
									
										20
									
								
								posts.py
								
								
								
								
							|  | @ -547,11 +547,13 @@ def getPostsForBlockedDomains(baseDir: str, | ||||||
|             if isinstance(item['object']['inReplyTo'], str): |             if isinstance(item['object']['inReplyTo'], str): | ||||||
|                 postDomain, postPort = \ |                 postDomain, postPort = \ | ||||||
|                     getDomainFromActor(item['object']['inReplyTo']) |                     getDomainFromActor(item['object']['inReplyTo']) | ||||||
|                 if isBlockedDomain(baseDir, postDomain): |                 if isBlockedDomain(baseDir, postDomain) and \ | ||||||
|  |                    item['object'].get('url'): | ||||||
|  |                     url = item['object']['url'] | ||||||
|                     if not blockedPosts.get(postDomain): |                     if not blockedPosts.get(postDomain): | ||||||
|                         blockedPosts[postDomain] = [item] |                         blockedPosts[postDomain] = [url] | ||||||
|                     else: |                     else: | ||||||
|                         blockedPosts[postDomain].append(item) |                         blockedPosts[postDomain].append(url) | ||||||
| 
 | 
 | ||||||
|         if item['object'].get('tag'): |         if item['object'].get('tag'): | ||||||
|             for tagItem in item['object']['tag']: |             for tagItem in item['object']['tag']: | ||||||
|  | @ -560,11 +562,13 @@ def getPostsForBlockedDomains(baseDir: str, | ||||||
|                     if tagItem.get('href'): |                     if tagItem.get('href'): | ||||||
|                         postDomain, postPort = \ |                         postDomain, postPort = \ | ||||||
|                             getDomainFromActor(tagItem['href']) |                             getDomainFromActor(tagItem['href']) | ||||||
|                         if isBlockedDomain(baseDir, postDomain): |                         if isBlockedDomain(baseDir, postDomain) and \ | ||||||
|  |                            item['object'].get('url'): | ||||||
|  |                             url = item['object']['url'] | ||||||
|                             if not blockedPosts.get(postDomain): |                             if not blockedPosts.get(postDomain): | ||||||
|                                 blockedPosts[postDomain] = [item] |                                 blockedPosts[postDomain] = [url] | ||||||
|                             else: |                             else: | ||||||
|                                 blockedPosts[postDomain].append(item) |                                 blockedPosts[postDomain].append(url) | ||||||
|     return blockedPosts |     return blockedPosts | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -3456,10 +3460,10 @@ def getPublicPostInfo(session, baseDir: str, nickname: str, domain: str, | ||||||
|                                   debug, |                                   debug, | ||||||
|                                   projectVersion, httpPrefix, |                                   projectVersion, httpPrefix, | ||||||
|                                   domain) |                                   domain) | ||||||
|     for blockedDomain, postList in blockedPosts.items(): |     for blockedDomain, postUrlList in blockedPosts.items(): | ||||||
|         if not domainsInfo.get(blockedDomain): |         if not domainsInfo.get(blockedDomain): | ||||||
|             continue |             continue | ||||||
|         domainsInfo[blockedDomain] = postList.copy() |         domainsInfo[blockedDomain] += postUrlList | ||||||
| 
 | 
 | ||||||
|     return domainsInfo |     return domainsInfo | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -87,15 +87,12 @@ def htmlAccountInfo(cssCache: {}, translate: {}, | ||||||
|     infoForm += '<div class="accountInfoDomains">' |     infoForm += '<div class="accountInfoDomains">' | ||||||
|     usersPath = '/users/' + nickname + '/accountinfo' |     usersPath = '/users/' + nickname + '/accountinfo' | ||||||
|     ctr = 1 |     ctr = 1 | ||||||
|     for postDomain, blockedPosts in domainDict.items(): |     for postDomain, blockedPostUrls in domainDict.items(): | ||||||
|         infoForm += '<a href="' + \ |         infoForm += '<a href="' + \ | ||||||
|             httpPrefix + '://' + postDomain + '">' + postDomain + '</a> ' |             httpPrefix + '://' + postDomain + '">' + postDomain + '</a> ' | ||||||
|         if isBlockedDomain(baseDir, postDomain): |         if isBlockedDomain(baseDir, postDomain): | ||||||
|             blockedPostsLinks = '' |             blockedPostsLinks = '' | ||||||
|             for blockedPostJson in blockedPosts: |             for url in blockedPostUrls: | ||||||
|                 if not blockedPostJson['object'].get('url'): |  | ||||||
|                     continue |  | ||||||
|                 url = blockedPostJson['object']['url'] |  | ||||||
|                 blockedPostsLinks += \ |                 blockedPostsLinks += \ | ||||||
|                     '<a href="' + url + '">' + url + '</a><br>' |                     '<a href="' + url + '">' + url + '</a><br>' | ||||||
|             blockedPostsHtml = '' |             blockedPostsHtml = '' | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue