mirror of https://gitlab.com/bashrc2/epicyon
Use of blurhash is optional
parent
169ce16da3
commit
486619e05f
22
daemon.py
22
daemon.py
|
@ -3605,7 +3605,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.httpPrefix, \
|
self.server.httpPrefix, \
|
||||||
fields['message'],False,False,False, \
|
fields['message'],False,False,False, \
|
||||||
filename,attachmentMediaType, \
|
filename,attachmentMediaType, \
|
||||||
fields['imageDescription'],True, \
|
fields['imageDescription'], \
|
||||||
|
self.server.useBlurHash, \
|
||||||
fields['replyTo'],fields['replyTo'], \
|
fields['replyTo'],fields['replyTo'], \
|
||||||
fields['subject'], \
|
fields['subject'], \
|
||||||
fields['eventDate'],fields['eventTime'], \
|
fields['eventDate'],fields['eventTime'], \
|
||||||
|
@ -3630,7 +3631,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.httpPrefix, \
|
self.server.httpPrefix, \
|
||||||
fields['message'],False,False,False, \
|
fields['message'],False,False,False, \
|
||||||
filename,attachmentMediaType, \
|
filename,attachmentMediaType, \
|
||||||
fields['imageDescription'],True, \
|
fields['imageDescription'], \
|
||||||
|
self.server.useBlurHash, \
|
||||||
fields['replyTo'], fields['replyTo'], \
|
fields['replyTo'], fields['replyTo'], \
|
||||||
fields['subject'], \
|
fields['subject'], \
|
||||||
fields['eventDate'],fields['eventTime'], \
|
fields['eventDate'],fields['eventTime'], \
|
||||||
|
@ -3655,7 +3657,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.httpPrefix, \
|
self.server.httpPrefix, \
|
||||||
fields['message'],True,False,False, \
|
fields['message'],True,False,False, \
|
||||||
filename,attachmentMediaType, \
|
filename,attachmentMediaType, \
|
||||||
fields['imageDescription'],True, \
|
fields['imageDescription'], \
|
||||||
|
self.server.useBlurHash, \
|
||||||
fields['replyTo'], fields['replyTo'], \
|
fields['replyTo'], fields['replyTo'], \
|
||||||
fields['subject'], \
|
fields['subject'], \
|
||||||
fields['eventDate'],fields['eventTime'], \
|
fields['eventDate'],fields['eventTime'], \
|
||||||
|
@ -3682,7 +3685,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.httpPrefix, \
|
self.server.httpPrefix, \
|
||||||
fields['message'],True,False,False, \
|
fields['message'],True,False,False, \
|
||||||
filename,attachmentMediaType, \
|
filename,attachmentMediaType, \
|
||||||
fields['imageDescription'],True, \
|
fields['imageDescription'], \
|
||||||
|
self.server.useBlurHash, \
|
||||||
fields['replyTo'],fields['replyTo'], \
|
fields['replyTo'],fields['replyTo'], \
|
||||||
fields['subject'], \
|
fields['subject'], \
|
||||||
self.server.debug, \
|
self.server.debug, \
|
||||||
|
@ -3718,7 +3722,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
self.server.httpPrefix, \
|
self.server.httpPrefix, \
|
||||||
fields['message'],True,False,False, \
|
fields['message'],True,False,False, \
|
||||||
filename,attachmentMediaType, \
|
filename,attachmentMediaType, \
|
||||||
fields['imageDescription'],True, \
|
fields['imageDescription'], \
|
||||||
|
self.server.useBlurHash, \
|
||||||
self.server.debug,fields['subject'])
|
self.server.debug,fields['subject'])
|
||||||
if messageJson:
|
if messageJson:
|
||||||
self.postToNickname=nickname
|
self.postToNickname=nickname
|
||||||
|
@ -3746,7 +3751,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
fields['message'],qOptions, \
|
fields['message'],qOptions, \
|
||||||
False,False,False, \
|
False,False,False, \
|
||||||
filename,attachmentMediaType, \
|
filename,attachmentMediaType, \
|
||||||
fields['imageDescription'],True, \
|
fields['imageDescription'], \
|
||||||
|
self.server.useBlurHash, \
|
||||||
fields['subject'],int(fields['duration']))
|
fields['subject'],int(fields['duration']))
|
||||||
if messageJson:
|
if messageJson:
|
||||||
self.postToNickname=nickname
|
self.postToNickname=nickname
|
||||||
|
@ -5430,7 +5436,8 @@ def runDaemon(mediaInstance: bool,maxRecentPosts: int, \
|
||||||
useTor=False,maxReplies=64, \
|
useTor=False,maxReplies=64, \
|
||||||
domainMaxPostsPerDay=8640,accountMaxPostsPerDay=8640, \
|
domainMaxPostsPerDay=8640,accountMaxPostsPerDay=8640, \
|
||||||
allowDeletion=False,debug=False,unitTest=False, \
|
allowDeletion=False,debug=False,unitTest=False, \
|
||||||
instanceOnlySkillsSearch=False,sendThreads=[]) -> None:
|
instanceOnlySkillsSearch=False,sendThreads=[], \
|
||||||
|
useBlurHash=False) -> None:
|
||||||
if len(domain)==0:
|
if len(domain)==0:
|
||||||
domain='localhost'
|
domain='localhost'
|
||||||
if '.' not in domain:
|
if '.' not in domain:
|
||||||
|
@ -5444,6 +5451,7 @@ def runDaemon(mediaInstance: bool,maxRecentPosts: int, \
|
||||||
else:
|
else:
|
||||||
httpd = ThreadingHTTPServer(serverAddress, PubServer)
|
httpd = ThreadingHTTPServer(serverAddress, PubServer)
|
||||||
|
|
||||||
|
httpd.useBlurHash=useBlurHash
|
||||||
httpd.mediaInstance=mediaInstance
|
httpd.mediaInstance=mediaInstance
|
||||||
httpd.defaultTimeline='inbox'
|
httpd.defaultTimeline='inbox'
|
||||||
if mediaInstance:
|
if mediaInstance:
|
||||||
|
|
|
@ -1506,4 +1506,5 @@ runDaemon(args.mediainstance,args.maxRecentPosts, \
|
||||||
useTor,args.maxReplies, \
|
useTor,args.maxReplies, \
|
||||||
args.domainMaxPostsPerDay,args.accountMaxPostsPerDay, \
|
args.domainMaxPostsPerDay,args.accountMaxPostsPerDay, \
|
||||||
args.allowdeletion,debug,False, \
|
args.allowdeletion,debug,False, \
|
||||||
args.instanceOnlySkillsSearch)
|
args.instanceOnlySkillsSearch,[], \
|
||||||
|
args.blurhash)
|
||||||
|
|
7
tests.py
7
tests.py
|
@ -239,7 +239,7 @@ def createServerAlice(path: str,domain: str,port: int,federationList: [], \
|
||||||
noreply,nolike,nopics,noannounce,cw,ocapAlways, \
|
noreply,nolike,nopics,noannounce,cw,ocapAlways, \
|
||||||
useTor,maxReplies, \
|
useTor,maxReplies, \
|
||||||
domainMaxPostsPerDay,accountMaxPostsPerDay, \
|
domainMaxPostsPerDay,accountMaxPostsPerDay, \
|
||||||
allowDeletion,True,True,False,sendThreads)
|
allowDeletion,True,True,False,sendThreads,False)
|
||||||
|
|
||||||
def createServerBob(path: str,domain: str,port: int,federationList: [], \
|
def createServerBob(path: str,domain: str,port: int,federationList: [], \
|
||||||
hasFollows: bool,hasPosts :bool,ocapAlways :bool,sendThreads: []):
|
hasFollows: bool,hasPosts :bool,ocapAlways :bool,sendThreads: []):
|
||||||
|
@ -295,7 +295,7 @@ def createServerBob(path: str,domain: str,port: int,federationList: [], \
|
||||||
noreply,nolike,nopics,noannounce,cw,ocapAlways, \
|
noreply,nolike,nopics,noannounce,cw,ocapAlways, \
|
||||||
useTor,maxReplies, \
|
useTor,maxReplies, \
|
||||||
domainMaxPostsPerDay,accountMaxPostsPerDay, \
|
domainMaxPostsPerDay,accountMaxPostsPerDay, \
|
||||||
allowDeletion,True,True,False,sendThreads)
|
allowDeletion,True,True,False,sendThreads,False)
|
||||||
|
|
||||||
def createServerEve(path: str,domain: str,port: int,federationList: [], \
|
def createServerEve(path: str,domain: str,port: int,federationList: [], \
|
||||||
hasFollows: bool,hasPosts :bool,ocapAlways :bool,sendThreads: []):
|
hasFollows: bool,hasPosts :bool,ocapAlways :bool,sendThreads: []):
|
||||||
|
@ -329,7 +329,8 @@ def createServerEve(path: str,domain: str,port: int,federationList: [], \
|
||||||
"instanceId",False,path,domain,port,port, \
|
"instanceId",False,path,domain,port,port, \
|
||||||
httpPrefix,federationList,maxMentions,maxEmoji,False, \
|
httpPrefix,federationList,maxMentions,maxEmoji,False, \
|
||||||
noreply,nolike,nopics,noannounce,cw,ocapAlways, \
|
noreply,nolike,nopics,noannounce,cw,ocapAlways, \
|
||||||
useTor,maxReplies,allowDeletion,True,True,False,sendThreads)
|
useTor,maxReplies,allowDeletion,True,True,False, \
|
||||||
|
sendThreads,False)
|
||||||
|
|
||||||
def testPostMessageBetweenServers():
|
def testPostMessageBetweenServers():
|
||||||
print('Testing sending message from one server to the inbox of another')
|
print('Testing sending message from one server to the inbox of another')
|
||||||
|
|
Loading…
Reference in New Issue