diff --git a/README_commandline.md b/README_commandline.md index 72a058ab0..a01428ca0 100644 --- a/README_commandline.md +++ b/README_commandline.md @@ -473,7 +473,7 @@ next Next page in the timeline prev Previous page in the timeline read [post number] Read a post from a timeline open [post number] Open web links within a timeline post -profile [post number] Show profile for the person who made the given post +profile [post number or handle] Show profile for the person who made the given post following [page number] Show accounts that you are following followers [page number] Show accounts that are following you approve [handle] Approve a follow request diff --git a/desktop_client.py b/desktop_client.py index d225243ab..766c6b9db 100644 --- a/desktop_client.py +++ b/desktop_client.py @@ -113,7 +113,7 @@ def _desktopHelp() -> None: 'Read a post from a timeline') print(indent + 'open [post number] ' + 'Open web links within a timeline post') - print(indent + 'profile [post number] ' + + print(indent + 'profile [post number or handle] ' + 'Show profile for the person who made the given post') print(indent + 'following [page number] ' + 'Show accounts that you are following') @@ -836,6 +836,24 @@ def _desktopShowProfile(session, nickname: str, domain: str, return actorJson +def _desktopShowProfileFromHandle(session, nickname: str, domain: str, + httpPrefix: str, baseDir: str, boxName: str, + handle: str, + systemLanguage: str, + screenreader: str, espeak, + translate: {}, yourActor: str, + postJsonObject: {}) -> {}: + """Shows the profile for a handle + Returns the actor json + """ + actorJson = getActorJson(handle, False, False, False, True) + + _desktopShowActor(baseDir, actorJson, translate, + systemLanguage, screenreader, espeak) + + return actorJson + + def _desktopGetBoxPostObject(boxJson: {}, index: int) -> {}: """Gets the post with the given index from the timeline """ @@ -1581,7 +1599,21 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str, else: postIndexStr = commandStr.split('profile ')[1] - if not actorJson and boxJson and postIndexStr.isdigit(): + if not postIndexStr.isdigit(): + profileHandle = postIndexStr + _desktopShowBox(indent, followRequestsJson, + yourActor, currTimeline, boxJson, + translate, + screenreader, systemLanguage, + espeak, pageNumber, + newRepliesExist, newDMsExist) + _desktopShowProfileFromHandle(session, nickname, domain, + httpPrefix, baseDir, + currTimeline, profileHandle, + systemLanguage, screenreader, + espeak, translate, yourActor, + None) + elif not actorJson and boxJson: _desktopShowBox(indent, followRequestsJson, yourActor, currTimeline, boxJson, translate,