mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
5254142511
commit
a16202afbe
|
@ -8,7 +8,7 @@ __status__ = "Production"
|
|||
__module_group__ = "ActivityPub"
|
||||
|
||||
import os
|
||||
from utils import hasObjectStringObject
|
||||
from utils import has_object_string_object
|
||||
from utils import has_users_path
|
||||
from utils import get_full_domain
|
||||
from utils import urlPermitted
|
||||
|
@ -90,7 +90,7 @@ def _accept_follow(base_dir: str, domain: str, message_json: {},
|
|||
print('DEBUG: no actor in Follow activity')
|
||||
return
|
||||
# no, this isn't a mistake
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return
|
||||
if not message_json.get('to'):
|
||||
if debug:
|
||||
|
|
|
@ -7,7 +7,7 @@ __email__ = "bob@libreserver.org"
|
|||
__status__ = "Production"
|
||||
__module_group__ = "ActivityPub"
|
||||
|
||||
from utils import hasObjectStringObject
|
||||
from utils import has_object_string_object
|
||||
from utils import hasGroupType
|
||||
from utils import removeDomainPort
|
||||
from utils import removeIdEnding
|
||||
|
@ -402,7 +402,7 @@ def outboxUndoAnnounce(recentPostsCache: {},
|
|||
if debug:
|
||||
print('DEBUG: not a undo announce')
|
||||
return
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return
|
||||
if debug:
|
||||
print('DEBUG: c2s undo announce request arrived in outbox')
|
||||
|
|
|
@ -12,7 +12,7 @@ import json
|
|||
import time
|
||||
from datetime import datetime
|
||||
from utils import hasObjectString
|
||||
from utils import hasObjectStringObject
|
||||
from utils import has_object_string_object
|
||||
from utils import hasObjectStringType
|
||||
from utils import removeDomainPort
|
||||
from utils import has_object_dict
|
||||
|
@ -483,7 +483,7 @@ def outboxUndoBlock(base_dir: str, http_prefix: str,
|
|||
if debug:
|
||||
print('DEBUG: not an undo block')
|
||||
return
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return
|
||||
if debug:
|
||||
print('DEBUG: c2s undo block request arrived in outbox')
|
||||
|
|
|
@ -9,7 +9,7 @@ __module_group__ = "ActivityPub"
|
|||
|
||||
from pprint import pprint
|
||||
import os
|
||||
from utils import hasObjectStringObject
|
||||
from utils import has_object_string_object
|
||||
from utils import hasObjectStringType
|
||||
from utils import removeDomainPort
|
||||
from utils import has_users_path
|
||||
|
@ -1390,7 +1390,7 @@ def outboxUndoFollow(base_dir: str, message_json: {}, debug: bool) -> None:
|
|||
if not message_json['object']['type'] == 'Follow':
|
||||
if not message_json['object']['type'] == 'Join':
|
||||
return
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return
|
||||
if not message_json['object'].get('actor'):
|
||||
return
|
||||
|
|
10
inbox.py
10
inbox.py
|
@ -24,7 +24,7 @@ from utils import invalidCiphertext
|
|||
from utils import removeHtml
|
||||
from utils import fileLastModified
|
||||
from utils import hasObjectString
|
||||
from utils import hasObjectStringObject
|
||||
from utils import has_object_string_object
|
||||
from utils import getReplyIntervalHours
|
||||
from utils import canReplyTo
|
||||
from utils import get_user_paths
|
||||
|
@ -813,7 +813,7 @@ def _receiveUndo(session, base_dir: str, http_prefix: str,
|
|||
return False
|
||||
if not hasObjectStringType(message_json, debug):
|
||||
return False
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return False
|
||||
if message_json['object']['type'] == 'Follow' or \
|
||||
message_json['object']['type'] == 'Join':
|
||||
|
@ -1141,7 +1141,7 @@ def _receiveUndoLike(recentPostsCache: {},
|
|||
return False
|
||||
if message_json['object']['type'] != 'Like':
|
||||
return False
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return False
|
||||
if not has_users_path(message_json['actor']):
|
||||
if debug:
|
||||
|
@ -1402,7 +1402,7 @@ def _receiveUndoReaction(recentPostsCache: {},
|
|||
return False
|
||||
if message_json['object']['type'] != 'EmojiReact':
|
||||
return False
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return False
|
||||
if not message_json['object'].get('content'):
|
||||
if debug:
|
||||
|
@ -2044,7 +2044,7 @@ def _receiveUndoAnnounce(recentPostsCache: {},
|
|||
return False
|
||||
if not has_object_dict(message_json):
|
||||
return False
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return False
|
||||
if message_json['object']['type'] != 'Announce':
|
||||
return False
|
||||
|
|
4
like.py
4
like.py
|
@ -10,7 +10,7 @@ __module_group__ = "ActivityPub"
|
|||
import os
|
||||
from pprint import pprint
|
||||
from utils import hasObjectString
|
||||
from utils import hasObjectStringObject
|
||||
from utils import has_object_string_object
|
||||
from utils import hasObjectStringType
|
||||
from utils import removeDomainPort
|
||||
from utils import has_object_dict
|
||||
|
@ -390,7 +390,7 @@ def outboxUndoLike(recentPostsCache: {},
|
|||
if debug:
|
||||
print('DEBUG: not a undo like')
|
||||
return
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return
|
||||
if debug:
|
||||
print('DEBUG: c2s undo like request arrived in outbox')
|
||||
|
|
|
@ -12,7 +12,7 @@ import re
|
|||
import urllib.parse
|
||||
from pprint import pprint
|
||||
from utils import hasObjectString
|
||||
from utils import hasObjectStringObject
|
||||
from utils import has_object_string_object
|
||||
from utils import hasObjectStringType
|
||||
from utils import removeDomainPort
|
||||
from utils import has_object_dict
|
||||
|
@ -418,7 +418,7 @@ def outboxUndoReaction(recentPostsCache: {},
|
|||
return
|
||||
if not isinstance(message_json['object']['content'], str):
|
||||
return
|
||||
if not hasObjectStringObject(message_json, debug):
|
||||
if not has_object_string_object(message_json, debug):
|
||||
return
|
||||
if debug:
|
||||
print('DEBUG: c2s undo reaction request arrived in outbox')
|
||||
|
|
2
utils.py
2
utils.py
|
@ -3194,7 +3194,7 @@ def hasObjectStringType(post_json_object: {}, debug: bool) -> bool:
|
|||
return False
|
||||
|
||||
|
||||
def hasObjectStringObject(post_json_object: {}, debug: bool) -> bool:
|
||||
def has_object_string_object(post_json_object: {}, debug: bool) -> bool:
|
||||
"""Does the given post have an object string field within an object dict?
|
||||
"""
|
||||
if not has_object_dict(post_json_object):
|
||||
|
|
Loading…
Reference in New Issue