forked from indymedia/epicyon
Update message option
parent
8ab84efbbf
commit
53d68cd10d
37
epicyon.py
37
epicyon.py
|
@ -24,7 +24,7 @@ from posts import createPublicPost
|
|||
from posts import deleteAllPosts
|
||||
from posts import createOutbox
|
||||
from posts import archivePosts
|
||||
from posts import sendPost
|
||||
from posts import sendPostViaServer
|
||||
from posts import getPublicPostsOfPerson
|
||||
from posts import getUserUrl
|
||||
from posts import archivePosts
|
||||
|
@ -214,8 +214,8 @@ if args.tests:
|
|||
|
||||
if args.testsnetwork:
|
||||
print('Network Tests')
|
||||
#testPostMessageBetweenServers()
|
||||
#testFollowBetweenServers()
|
||||
testPostMessageBetweenServers()
|
||||
testFollowBetweenServers()
|
||||
testClientToServer()
|
||||
sys.exit()
|
||||
|
||||
|
@ -285,12 +285,22 @@ useTor=args.tor
|
|||
if domain.endswith('.onion'):
|
||||
useTor=True
|
||||
|
||||
if args.message and nickname:
|
||||
if args.message:
|
||||
if not nickname:
|
||||
print('Specify a nickname with the --nickname option')
|
||||
sys.exit()
|
||||
|
||||
if not args.password:
|
||||
print('Specify a password with the --password option')
|
||||
sys.exit()
|
||||
|
||||
if not os.path.isdir(baseDir+'/accounts/'+nickname+'@'+domain):
|
||||
print(nickname+' is not an account on the system. use --addaccount if necessary.')
|
||||
sys.exit()
|
||||
session = createSession(domain,port,useTor)
|
||||
if args.sendto:
|
||||
if not args.sendto:
|
||||
print('Specify an account to sent to: --sendto [nickname@domain]')
|
||||
sys.exit()
|
||||
if '@' not in args.sendto:
|
||||
print('syntax: --sendto [nickname@domain]')
|
||||
sys.exit()
|
||||
|
@ -314,15 +324,16 @@ if args.message and nickname:
|
|||
subject=args.subject
|
||||
attach=args.attach
|
||||
replyTo=args.replyTo
|
||||
followersOnly=False
|
||||
print('Sending post to '+args.sendto)
|
||||
sendResult = \
|
||||
sendPost(session,baseDir,nickname,domain,port, \
|
||||
toNickname,toDomain,toPort,ccUrl,httpPrefix, \
|
||||
sendMessage,followersOnly,True,clientToServer, \
|
||||
attach,attachedImageDescription, \
|
||||
useBlurhash,federationList,sendThreads, \
|
||||
postLog,cachedWebfingers,personCache, \
|
||||
replyTo,replyTo,subject)
|
||||
|
||||
sendPostViaServer(session,nickname,args.password, \
|
||||
domain,port, \
|
||||
toNickname,toDomain,toPort,ccUrl, \
|
||||
httpPrefix,sendMessage,followersOnly, \
|
||||
attach,attachedImageDescription,useBlurhash, \
|
||||
cachedWebfingers,personCache, \
|
||||
args.debug,replyTo,replyTo,subject)
|
||||
for i in range(10):
|
||||
# TODO detect send success/fail
|
||||
time.sleep(1)
|
||||
|
|
Loading…
Reference in New Issue