mirror of https://gitlab.com/bashrc2/epicyon
Mute/unmute commands
parent
4c2d4eb049
commit
93ece7036c
|
|
@ -458,6 +458,8 @@ like Like the last post
|
||||||
unlike Unlike the last post
|
unlike Unlike the last post
|
||||||
bookmark Bookmark the last post
|
bookmark Bookmark the last post
|
||||||
unbookmark Unbookmark the last post
|
unbookmark Unbookmark the last post
|
||||||
|
mute Mute the last post
|
||||||
|
unmute Unmute the last post
|
||||||
reply Reply to the last post
|
reply Reply to the last post
|
||||||
post Create a new post
|
post Create a new post
|
||||||
post to [handle] Create a new direct message
|
post to [handle] Create a new direct message
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@ from like import sendLikeViaServer
|
||||||
from like import sendUndoLikeViaServer
|
from like import sendUndoLikeViaServer
|
||||||
from follow import sendFollowRequestViaServer
|
from follow import sendFollowRequestViaServer
|
||||||
from follow import sendUnfollowRequestViaServer
|
from follow import sendUnfollowRequestViaServer
|
||||||
|
from posts import sendMuteViaServer
|
||||||
|
from posts import sendUndoMuteViaServer
|
||||||
from posts import sendPostViaServer
|
from posts import sendPostViaServer
|
||||||
from posts import c2sBoxJson
|
from posts import c2sBoxJson
|
||||||
from posts import downloadAnnounce
|
from posts import downloadAnnounce
|
||||||
|
|
@ -69,9 +71,13 @@ def _desktopHelp() -> None:
|
||||||
print(indent + 'unlike ' +
|
print(indent + 'unlike ' +
|
||||||
'Unlike the last post')
|
'Unlike the last post')
|
||||||
print(indent + 'bookmark ' +
|
print(indent + 'bookmark ' +
|
||||||
'bookmark the last post')
|
'Bookmark the last post')
|
||||||
print(indent + 'unbookmark ' +
|
print(indent + 'unbookmark ' +
|
||||||
'Unbookmark the last post')
|
'Unbookmark the last post')
|
||||||
|
print(indent + 'mute ' +
|
||||||
|
'Mute the last post')
|
||||||
|
print(indent + 'unmute ' +
|
||||||
|
'Unmute the last post')
|
||||||
print(indent + 'reply ' +
|
print(indent + 'reply ' +
|
||||||
'Reply to the last post')
|
'Reply to the last post')
|
||||||
print(indent + 'post ' +
|
print(indent + 'post ' +
|
||||||
|
|
@ -1199,6 +1205,71 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
cachedWebfingers, personCache,
|
cachedWebfingers, personCache,
|
||||||
False, __version__)
|
False, __version__)
|
||||||
print('')
|
print('')
|
||||||
|
elif (commandStr == 'undo mute' or
|
||||||
|
commandStr == 'undo ignore' or
|
||||||
|
commandStr == 'remove mute' or
|
||||||
|
commandStr == 'rm mute' or
|
||||||
|
commandStr == 'unmute' or
|
||||||
|
commandStr == 'unignore' or
|
||||||
|
commandStr == 'mute undo' or
|
||||||
|
commandStr.startswith('undo mute ') or
|
||||||
|
commandStr.startswith('undo ignore ') or
|
||||||
|
commandStr.startswith('remove mute ') or
|
||||||
|
commandStr.startswith('remove ignore ') or
|
||||||
|
commandStr.startswith('unignore ') or
|
||||||
|
commandStr.startswith('unmute ')):
|
||||||
|
currIndex = 0
|
||||||
|
if ' ' in commandStr:
|
||||||
|
postIndex = commandStr.split(' ')[-1].strip()
|
||||||
|
if postIndex.isdigit():
|
||||||
|
currIndex = int(postIndex)
|
||||||
|
if currIndex > 0 and boxJson:
|
||||||
|
postJsonObject = \
|
||||||
|
_desktopGetBoxPostObject(boxJson, currIndex)
|
||||||
|
if postJsonObject:
|
||||||
|
if postJsonObject.get('id'):
|
||||||
|
muteActor = postJsonObject['object']['attributedTo']
|
||||||
|
sayStr = 'Unmuting post by ' + \
|
||||||
|
getNicknameFromActor(muteActor)
|
||||||
|
_sayCommand(sayStr, sayStr,
|
||||||
|
screenreader,
|
||||||
|
systemLanguage, espeak)
|
||||||
|
sessionMute = createSession(proxyType)
|
||||||
|
sendUndoMuteViaServer(baseDir, sessionMute,
|
||||||
|
nickname, password,
|
||||||
|
domain, port,
|
||||||
|
httpPrefix, postJsonObject['id'],
|
||||||
|
cachedWebfingers, personCache,
|
||||||
|
False, __version__)
|
||||||
|
print('')
|
||||||
|
elif (commandStr == 'mute' or
|
||||||
|
commandStr == 'ignore' or
|
||||||
|
commandStr.startswith('mute ') or
|
||||||
|
commandStr.startswith('ignore ')):
|
||||||
|
currIndex = 0
|
||||||
|
if ' ' in commandStr:
|
||||||
|
postIndex = commandStr.split(' ')[-1].strip()
|
||||||
|
if postIndex.isdigit():
|
||||||
|
currIndex = int(postIndex)
|
||||||
|
if currIndex > 0 and boxJson:
|
||||||
|
postJsonObject = \
|
||||||
|
_desktopGetBoxPostObject(boxJson, currIndex)
|
||||||
|
if postJsonObject:
|
||||||
|
if postJsonObject.get('id'):
|
||||||
|
muteActor = postJsonObject['object']['attributedTo']
|
||||||
|
sayStr = 'Muting post by ' + \
|
||||||
|
getNicknameFromActor(muteActor)
|
||||||
|
_sayCommand(sayStr, sayStr,
|
||||||
|
screenreader,
|
||||||
|
systemLanguage, espeak)
|
||||||
|
sessionMute = createSession(proxyType)
|
||||||
|
sendMuteViaServer(baseDir, sessionMute,
|
||||||
|
nickname, password,
|
||||||
|
domain, port,
|
||||||
|
httpPrefix, postJsonObject['id'],
|
||||||
|
cachedWebfingers, personCache,
|
||||||
|
False, __version__)
|
||||||
|
print('')
|
||||||
elif (commandStr == 'undo bookmark' or
|
elif (commandStr == 'undo bookmark' or
|
||||||
commandStr == 'remove bookmark' or
|
commandStr == 'remove bookmark' or
|
||||||
commandStr == 'rm bookmark' or
|
commandStr == 'rm bookmark' or
|
||||||
|
|
@ -1224,14 +1295,14 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
_desktopGetBoxPostObject(boxJson, currIndex)
|
_desktopGetBoxPostObject(boxJson, currIndex)
|
||||||
if postJsonObject:
|
if postJsonObject:
|
||||||
if postJsonObject.get('id'):
|
if postJsonObject.get('id'):
|
||||||
likeActor = postJsonObject['object']['attributedTo']
|
bmActor = postJsonObject['object']['attributedTo']
|
||||||
sayStr = 'Unbookmarking post by ' + \
|
sayStr = 'Unbookmarking post by ' + \
|
||||||
getNicknameFromActor(likeActor)
|
getNicknameFromActor(bmActor)
|
||||||
_sayCommand(sayStr, sayStr,
|
_sayCommand(sayStr, sayStr,
|
||||||
screenreader,
|
screenreader,
|
||||||
systemLanguage, espeak)
|
systemLanguage, espeak)
|
||||||
sessionLike = createSession(proxyType)
|
sessionbm = createSession(proxyType)
|
||||||
sendUndoBookmarkViaServer(baseDir, sessionLike,
|
sendUndoBookmarkViaServer(baseDir, sessionbm,
|
||||||
nickname, password,
|
nickname, password,
|
||||||
domain, port, httpPrefix,
|
domain, port, httpPrefix,
|
||||||
postJsonObject['id'],
|
postJsonObject['id'],
|
||||||
|
|
@ -1253,14 +1324,14 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str,
|
||||||
_desktopGetBoxPostObject(boxJson, currIndex)
|
_desktopGetBoxPostObject(boxJson, currIndex)
|
||||||
if postJsonObject:
|
if postJsonObject:
|
||||||
if postJsonObject.get('id'):
|
if postJsonObject.get('id'):
|
||||||
likeActor = postJsonObject['object']['attributedTo']
|
bmActor = postJsonObject['object']['attributedTo']
|
||||||
sayStr = 'Bookmarking post by ' + \
|
sayStr = 'Bookmarking post by ' + \
|
||||||
getNicknameFromActor(likeActor)
|
getNicknameFromActor(bmActor)
|
||||||
_sayCommand(sayStr, sayStr,
|
_sayCommand(sayStr, sayStr,
|
||||||
screenreader,
|
screenreader,
|
||||||
systemLanguage, espeak)
|
systemLanguage, espeak)
|
||||||
sessionLike = createSession(proxyType)
|
sessionbm = createSession(proxyType)
|
||||||
sendBookmarkViaServer(baseDir, sessionLike,
|
sendBookmarkViaServer(baseDir, sessionbm,
|
||||||
nickname, password,
|
nickname, password,
|
||||||
domain, port, httpPrefix,
|
domain, port, httpPrefix,
|
||||||
postJsonObject['id'],
|
postJsonObject['id'],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue