Refresh timeline after mute

main
Bob Mottram 2021-03-21 13:17:59 +00:00
parent 4ad6eaa016
commit 032ebe2a8c
4 changed files with 33 additions and 6 deletions

View File

@ -418,7 +418,7 @@ def sendBookmarkViaServer(baseDir: str, session,
'Authorization': authHeader
}
postResult = postJson(session, newBookmarkJson, [], inboxUrl,
headers, 30, True)
headers, 3, True)
if not postResult:
if debug:
print('WARN: POST bookmark failed for c2s to ' + inboxUrl)
@ -502,7 +502,7 @@ def sendUndoBookmarkViaServer(baseDir: str, session,
'Authorization': authHeader
}
postResult = postJson(session, newBookmarkJson, [], inboxUrl,
headers, 30, True)
headers, 3, True)
if not postResult:
if debug:
print('WARN: POST unbookmark failed for c2s to ' + inboxUrl)

View File

@ -1241,6 +1241,17 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str,
httpPrefix, postJsonObject['id'],
cachedWebfingers, personCache,
False, __version__)
boxJson = c2sBoxJson(baseDir, session,
nickname, password,
domain, port, httpPrefix,
currTimeline, pageNumber,
debug)
if boxJson:
_desktopShowBox(currTimeline, boxJson,
screenreader, systemLanguage,
espeak, pageNumber,
newRepliesExist, newDMsExist)
print('')
elif (commandStr == 'mute' or
commandStr == 'ignore' or
@ -1269,6 +1280,16 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str,
httpPrefix, postJsonObject['id'],
cachedWebfingers, personCache,
False, __version__)
boxJson = c2sBoxJson(baseDir, session,
nickname, password,
domain, port, httpPrefix,
currTimeline, pageNumber,
debug)
if boxJson:
_desktopShowBox(currTimeline, boxJson,
screenreader, systemLanguage,
espeak, pageNumber,
newRepliesExist, newDMsExist)
print('')
elif (commandStr == 'undo bookmark' or
commandStr == 'remove bookmark' or

View File

@ -4199,8 +4199,8 @@ def sendMuteViaServer(baseDir: str, session,
'Authorization': authHeader
}
postResult = postJson(session, newMuteJson, [], inboxUrl,
headers, 30, True)
if not postResult:
headers, 3, True)
if postResult is None:
print('WARN: mute unable to post')
if debug:
@ -4280,8 +4280,8 @@ def sendUndoMuteViaServer(baseDir: str, session,
'Authorization': authHeader
}
postResult = postJson(session, undoMuteJson, [], inboxUrl,
headers, 30, True)
if not postResult:
headers, 3, True)
if postResult is None:
print('WARN: undo mute unable to post')
if debug:

View File

@ -152,6 +152,12 @@ def postJson(session, postJsonObject: {}, federationList: [],
session.post(url=inboxUrl,
data=json.dumps(postJsonObject),
headers=headers, timeout=timeoutSec)
except requests.Timeout as e:
if not quiet:
print('ERROR: postJson timeout ' + inboxUrl + ' ' +
json.dumps(postJsonObject) + ' ' + str(headers))
print(e)
return ''
except requests.exceptions.RequestException as e:
if not quiet:
print('ERROR: postJson requests failed ' + inboxUrl + ' ' +