mirror of https://gitlab.com/bashrc2/epicyon
				
				
				
			Snake case
							parent
							
								
									2c88fb0f42
								
							
						
					
					
						commit
						fb9f938c2c
					
				
							
								
								
									
										6
									
								
								posts.py
								
								
								
								
							
							
						
						
									
										6
									
								
								posts.py
								
								
								
								
							|  | @ -42,7 +42,7 @@ from utils import get_base_content_from_post | |||
| from utils import remove_domain_port | ||||
| from utils import get_port_from_domain | ||||
| from utils import has_object_dict | ||||
| from utils import rejectPostId | ||||
| from utils import reject_post_id | ||||
| from utils import removeInvalidChars | ||||
| from utils import fileLastModified | ||||
| from utils import isPublicPost | ||||
|  | @ -4501,8 +4501,8 @@ def _rejectAnnounce(announceFilename: str, | |||
|                     announcePostId: str, recent_posts_cache: {}): | ||||
|     """Marks an announce as rejected | ||||
|     """ | ||||
|     rejectPostId(base_dir, nickname, domain, announcePostId, | ||||
|                  recent_posts_cache) | ||||
|     reject_post_id(base_dir, nickname, domain, announcePostId, | ||||
|                    recent_posts_cache) | ||||
| 
 | ||||
|     # reject the post referenced by the announce activity object | ||||
|     if not os.path.isfile(announceFilename + '.reject'): | ||||
|  |  | |||
							
								
								
									
										10
									
								
								utils.py
								
								
								
								
							
							
						
						
									
										10
									
								
								utils.py
								
								
								
								
							|  | @ -2554,8 +2554,8 @@ def camelCaseSplit(text: str) -> str: | |||
|     return resultStr.strip() | ||||
| 
 | ||||
| 
 | ||||
| def rejectPostId(base_dir: str, nickname: str, domain: str, | ||||
|                  post_id: str, recent_posts_cache: {}) -> None: | ||||
| def reject_post_id(base_dir: str, nickname: str, domain: str, | ||||
|                    post_id: str, recent_posts_cache: {}) -> None: | ||||
|     """ Marks the given post as rejected, | ||||
|     for example an announce which is too old | ||||
|     """ | ||||
|  | @ -2605,10 +2605,10 @@ def is_dm(post_json_object: {}) -> bool: | |||
|     for f in fields: | ||||
|         if not post_json_object['object'].get(f): | ||||
|             continue | ||||
|         for toAddress in post_json_object['object'][f]: | ||||
|             if toAddress.endswith('#Public'): | ||||
|         for to_address in post_json_object['object'][f]: | ||||
|             if to_address.endswith('#Public'): | ||||
|                 return False | ||||
|             if toAddress.endswith('followers'): | ||||
|             if to_address.endswith('followers'): | ||||
|                 return False | ||||
|     return True | ||||
| 
 | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ from utils import has_object_dict | |||
| from utils import updateAnnounceCollection | ||||
| from utils import is_pgp_encrypted | ||||
| from utils import is_dm | ||||
| from utils import rejectPostId | ||||
| from utils import reject_post_id | ||||
| from utils import isRecentPost | ||||
| from utils import get_config_param | ||||
| from utils import get_full_domain | ||||
|  | @ -1510,8 +1510,8 @@ def individualPostAsHtml(signing_priv_key_pem: str, | |||
|         if not postJsonAnnounce: | ||||
|             # if the announce could not be downloaded then mark it as rejected | ||||
|             announcedPostId = removeIdEnding(post_json_object['id']) | ||||
|             rejectPostId(base_dir, nickname, domain, announcedPostId, | ||||
|                          recent_posts_cache) | ||||
|             reject_post_id(base_dir, nickname, domain, announcedPostId, | ||||
|                            recent_posts_cache) | ||||
|             return '' | ||||
|         post_json_object = postJsonAnnounce | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue