Outgoing media posts also go to the media timeline

main
Bob Mottram 2021-03-06 21:32:27 +00:00
parent fb096f5d92
commit 2e552bb17c
3 changed files with 22 additions and 3 deletions

View File

@ -1115,7 +1115,9 @@ class PubServer(BaseHTTPRequestHandler):
print('Posting to nickname ' + postToNickname)
self.postToNickname = postToNickname
return postMessageToOutbox(messageJson, self.postToNickname,
return postMessageToOutbox(self.server.session,
self.server.translate,
messageJson, self.postToNickname,
self.server, self.server.baseDir,
self.server.httpPrefix,
self.server.domain,

View File

@ -10,6 +10,7 @@ import os
from shutil import copyfile
from session import createSession
from auth import createPassword
from posts import isImageMedia
from posts import outboxMessageCreateWrap
from posts import savePostToBox
from posts import sendToFollowersThread
@ -41,7 +42,8 @@ from shares import outboxShareUpload
from shares import outboxUndoShareUpload
def postMessageToOutbox(messageJson: {}, postToNickname: str,
def postMessageToOutbox(session, translate: {},
messageJson: {}, postToNickname: str,
server, baseDir: str, httpPrefix: str,
domain: str, domainFull: str,
onionDomain: str, i2pDomain: str, port: int,
@ -262,6 +264,19 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str,
for boxNameIndex in indexes:
if not boxNameIndex:
continue
# should this also go to the media timeline?
if boxNameIndex == 'inbox':
if isImageMedia(session, baseDir, httpPrefix,
postToNickname, domain,
messageJson,
translate, YTReplacementDomain,
allowLocalNetworkAccess,
recentPostsCache):
inboxUpdateIndex('tlmedia', baseDir,
postToNickname + '@' + domain,
savedFilename, debug)
if boxNameIndex == 'inbox' and outboxName == 'tlblogs':
continue
# avoid duplicates of the message if already going

View File

@ -85,7 +85,9 @@ def _updatePostSchedule(baseDir: str, handle: str, httpd,
if nickname:
httpd.postToNickname = nickname
if not postMessageToOutbox(postJsonObject, nickname,
if not postMessageToOutbox(httpd.session,
httpd.translate,
postJsonObject, nickname,
httpd, baseDir,
httpd.httpPrefix,
httpd.domain,