diff --git a/daemon.py b/daemon.py index f714c2f4e..2743344d4 100644 --- a/daemon.py +++ b/daemon.py @@ -18474,7 +18474,7 @@ def runDaemon(content_license_url: str, port: int = 80, proxy_port: int = 80, http_prefix: str = 'https', fed_list: [] = [], - max_mentions: int = 10, maxEmoji: int = 10, + max_mentions: int = 10, max_emoji: int = 10, secureMode: bool = False, proxyType: str = None, maxReplies: int = 64, domainMaxPostsPerDay: int = 8640, @@ -18931,7 +18931,7 @@ def runDaemon(content_license_url: str, domainMaxPostsPerDay, accountMaxPostsPerDay, allowDeletion, debug, - max_mentions, maxEmoji, + max_mentions, max_emoji, httpd.translate, unitTest, httpd.yt_replace_domain, httpd.twitter_replacement_domain, diff --git a/epicyon.py b/epicyon.py index 794b32617..3805322d4 100644 --- a/epicyon.py +++ b/epicyon.py @@ -561,7 +561,7 @@ parser.add_argument('--maxreplies', dest='maxReplies', type=int, default=64, parser.add_argument('--max_mentions', '--hellthread', dest='max_mentions', type=int, default=10, help='Maximum number of mentions within a post') -parser.add_argument('--maxEmoji', '--maxemoji', dest='maxEmoji', +parser.add_argument('--max_emoji', '--maxemoji', dest='max_emoji', type=int, default=10, help='Maximum number of emoji within a post') parser.add_argument('--role', dest='role', type=str, default=None, @@ -3252,7 +3252,7 @@ if __name__ == "__main__": args.twitter_replacement_domain, port, proxy_port, http_prefix, federationList, args.max_mentions, - args.maxEmoji, args.secureMode, + args.max_emoji, args.secureMode, proxyType, args.maxReplies, args.domainMaxPostsPerDay, args.accountMaxPostsPerDay, diff --git a/inbox.py b/inbox.py index ddbc56f0e..6cbef4890 100644 --- a/inbox.py +++ b/inbox.py @@ -2185,7 +2185,7 @@ def _estimateNumberOfEmoji(content: str) -> int: def _validPostContent(base_dir: str, nickname: str, domain: str, - messageJson: {}, max_mentions: int, maxEmoji: int, + messageJson: {}, max_mentions: int, max_emoji: int, allow_local_network_access: bool, debug: bool, systemLanguage: str, http_prefix: str, domainFull: str, @@ -2244,7 +2244,7 @@ def _validPostContent(base_dir: str, nickname: str, domain: str, print('REJECT HELLTHREAD: Too many mentions in post - ' + contentStr) return False - if _estimateNumberOfEmoji(contentStr) > maxEmoji: + if _estimateNumberOfEmoji(contentStr) > max_emoji: if messageJson['object'].get('id'): print('REJECT EMOJI OVERLOAD: ' + messageJson['object']['id']) print('REJECT EMOJI OVERLOAD: Too many emoji in post - ' + @@ -3186,7 +3186,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int, federationList: [], debug: bool, queueFilename: str, destinationFilename: str, maxReplies: int, allowDeletion: bool, - max_mentions: int, maxEmoji: int, translate: {}, + max_mentions: int, max_emoji: int, translate: {}, unitTest: bool, yt_replace_domain: str, twitter_replacement_domain: str, @@ -3415,7 +3415,7 @@ def _inboxAfterInitial(recentPostsCache: {}, max_recent_posts: int, jsonObj = None domainFull = getFullDomain(domain, port) if _validPostContent(base_dir, nickname, domain, - postJsonObject, max_mentions, maxEmoji, + postJsonObject, max_mentions, max_emoji, allow_local_network_access, debug, systemLanguage, http_prefix, domainFull, personCache): @@ -4071,7 +4071,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int, domainMaxPostsPerDay: int, accountMaxPostsPerDay: int, allowDeletion: bool, debug: bool, max_mentions: int, - maxEmoji: int, translate: {}, unitTest: bool, + max_emoji: int, translate: {}, unitTest: bool, yt_replace_domain: str, twitter_replacement_domain: str, show_published_date_only: bool, @@ -4501,7 +4501,7 @@ def runInboxQueue(recentPostsCache: {}, max_recent_posts: int, debug, queueFilename, destination, maxReplies, allowDeletion, - max_mentions, maxEmoji, + max_mentions, max_emoji, translate, unitTest, yt_replace_domain, twitter_replacement_domain, diff --git a/posts.py b/posts.py index ce22e5455..7021345c4 100644 --- a/posts.py +++ b/posts.py @@ -525,7 +525,7 @@ def isCreateInsideAnnounce(item: {}) -> bool: def _getPosts(session, outboxUrl: str, maxPosts: int, max_mentions: int, - maxEmoji: int, maxAttachments: int, + max_emoji: int, maxAttachments: int, federationList: [], personCache: {}, raw: bool, simple: bool, debug: bool, @@ -627,7 +627,7 @@ def _getPosts(session, outboxUrl: str, maxPosts: int, if debug: print('max mentions reached') continue - if len(emoji) > maxEmoji: + if len(emoji) > max_emoji: if debug: print('max emojis reached') continue @@ -744,7 +744,7 @@ def _updateWordFrequency(content: str, wordFrequency: {}) -> None: def getPostDomains(session, outboxUrl: str, maxPosts: int, max_mentions: int, - maxEmoji: int, maxAttachments: int, + max_emoji: int, maxAttachments: int, federationList: [], personCache: {}, debug: bool, @@ -811,7 +811,7 @@ def getPostDomains(session, outboxUrl: str, maxPosts: int, def _getPostsForBlockedDomains(base_dir: str, session, outboxUrl: str, maxPosts: int, max_mentions: int, - maxEmoji: int, maxAttachments: int, + max_emoji: int, maxAttachments: int, federationList: [], personCache: {}, debug: bool, @@ -4114,9 +4114,9 @@ def getPublicPostsOfPerson(base_dir: str, nickname: str, domain: str, return max_mentions = 10 - maxEmoji = 10 + max_emoji = 10 maxAttachments = 5 - _getPosts(session, personUrl, 30, max_mentions, maxEmoji, + _getPosts(session, personUrl, 30, max_mentions, max_emoji, maxAttachments, federationList, personCache, raw, simple, debug, project_version, http_prefix, originDomain, systemLanguage, @@ -4162,10 +4162,10 @@ def getPublicPostDomains(session, base_dir: str, nickname: str, domain: str, nickname, domain, 'outbox', 92522) max_mentions = 99 - maxEmoji = 99 + max_emoji = 99 maxAttachments = 5 postDomains = \ - getPostDomains(session, personUrl, 64, max_mentions, maxEmoji, + getPostDomains(session, personUrl, 64, max_mentions, max_emoji, maxAttachments, federationList, personCache, debug, project_version, http_prefix, domain, @@ -4258,11 +4258,11 @@ def getPublicPostInfo(session, base_dir: str, nickname: str, domain: str, nickname, domain, 'outbox', 13863) max_mentions = 99 - maxEmoji = 99 + max_emoji = 99 maxAttachments = 5 maxPosts = 64 postDomains = \ - getPostDomains(session, personUrl, maxPosts, max_mentions, maxEmoji, + getPostDomains(session, personUrl, maxPosts, max_mentions, max_emoji, maxAttachments, federationList, personCache, debug, project_version, http_prefix, domain, @@ -4276,7 +4276,7 @@ def getPublicPostInfo(session, base_dir: str, nickname: str, domain: str, blockedPosts = \ _getPostsForBlockedDomains(base_dir, session, personUrl, maxPosts, max_mentions, - maxEmoji, maxAttachments, + max_emoji, maxAttachments, federationList, personCache, debug, diff --git a/socnet.py b/socnet.py index 1b12156f0..b5280a6db 100644 --- a/socnet.py +++ b/socnet.py @@ -35,7 +35,7 @@ def instancesGraph(base_dir: str, handles: str, cachedWebfingers = {} federationList = [] max_mentions = 99 - maxEmoji = 99 + max_emoji = 99 maxAttachments = 5 personHandles = handles.split(',') @@ -74,7 +74,7 @@ def instancesGraph(base_dir: str, handles: str, 27261) wordFrequency = {} postDomains = \ - getPostDomains(session, personUrl, 64, max_mentions, maxEmoji, + getPostDomains(session, personUrl, 64, max_mentions, max_emoji, maxAttachments, federationList, personCache, debug, project_version, http_prefix, domain, diff --git a/tests.py b/tests.py index 89345664d..65f2c2ec5 100644 --- a/tests.py +++ b/tests.py @@ -776,7 +776,7 @@ def createServerAlice(path: str, domain: str, port: int, global testServerAliceRunning testServerAliceRunning = True max_mentions = 10 - maxEmoji = 10 + max_emoji = 10 onion_domain = None i2p_domain = None allow_local_network_access = True @@ -815,7 +815,7 @@ def createServerAlice(path: str, domain: str, port: int, 5, True, True, 'en', __version__, "instance_id", False, path, domain, onion_domain, i2p_domain, None, None, port, port, - http_prefix, federationList, max_mentions, maxEmoji, False, + http_prefix, federationList, max_mentions, max_emoji, False, proxyType, maxReplies, domainMaxPostsPerDay, accountMaxPostsPerDay, allowDeletion, True, True, False, sendThreads, @@ -918,7 +918,7 @@ def createServerBob(path: str, domain: str, port: int, global testServerBobRunning testServerBobRunning = True max_mentions = 10 - maxEmoji = 10 + max_emoji = 10 onion_domain = None i2p_domain = None allow_local_network_access = True @@ -957,7 +957,7 @@ def createServerBob(path: str, domain: str, port: int, 5, True, True, 'en', __version__, "instance_id", False, path, domain, onion_domain, i2p_domain, None, None, port, port, - http_prefix, federationList, max_mentions, maxEmoji, False, + http_prefix, federationList, max_mentions, max_emoji, False, proxyType, maxReplies, domainMaxPostsPerDay, accountMaxPostsPerDay, allowDeletion, True, True, False, sendThreads, @@ -987,7 +987,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [], global testServerEveRunning testServerEveRunning = True max_mentions = 10 - maxEmoji = 10 + max_emoji = 10 onion_domain = None i2p_domain = None allow_local_network_access = True @@ -1027,7 +1027,7 @@ def createServerEve(path: str, domain: str, port: int, federationList: [], 5, True, True, 'en', __version__, "instance_id", False, path, domain, onion_domain, i2p_domain, None, None, port, port, - http_prefix, federationList, max_mentions, maxEmoji, False, + http_prefix, federationList, max_mentions, max_emoji, False, proxyType, maxReplies, allowDeletion, True, True, False, sendThreads, False) @@ -1059,7 +1059,7 @@ def createServerGroup(path: str, domain: str, port: int, global testServerGroupRunning testServerGroupRunning = True max_mentions = 10 - maxEmoji = 10 + max_emoji = 10 onion_domain = None i2p_domain = None allow_local_network_access = True @@ -1099,7 +1099,7 @@ def createServerGroup(path: str, domain: str, port: int, 5, True, True, 'en', __version__, "instance_id", False, path, domain, onion_domain, i2p_domain, None, None, port, port, - http_prefix, federationList, max_mentions, maxEmoji, False, + http_prefix, federationList, max_mentions, max_emoji, False, proxyType, maxReplies, domainMaxPostsPerDay, accountMaxPostsPerDay, allowDeletion, True, True, False, sendThreads,