From c83f7c8d9428045a51f623e0365ae99de179f4e5 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Thu, 5 Dec 2019 16:28:01 -0600 Subject: [PATCH] Displaying articles from the attachments list in wall posts --- changelog.md | 1 + src/presenters/displayPosts/basePost.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/changelog.md b/changelog.md index 6055273..fe0a84f 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ * Socializer will ask for confirmation before closing the application. * In all audio buffers, there is a new item in the context menu that allows downloading of the audio directly from the buffer. If there are multiple audios selected, socializer will ask for a folder where all audios should be placed. When downloading multiple audios, socializer will name those automatically by following the template "song title - artist". +* Added displaying of articles as attachments in wall posts. When opened, Socializer will open the article in the web browser. ### bugfixes diff --git a/src/presenters/displayPosts/basePost.py b/src/presenters/displayPosts/basePost.py index 93bda99..d2a84e3 100644 --- a/src/presenters/displayPosts/basePost.py +++ b/src/presenters/displayPosts/basePost.py @@ -350,6 +350,9 @@ class displayPostPresenter(base.basePresenter): webbrowser.open_new_tab(url) elif attachment["type"] == "poll": a = poll.displayPollPresenter(session=self.session, poll=attachment, interactor=interactors.displayPollInteractor(), view=views.displayPoll()) + elif attachment["type"] == "article": + output.speak(_("Opening Article in web browser..."), True) + webbrowser.open_new_tab(attachment["article"]["url"]) else: log.debug("Unhandled attachment: %r" % (attachment,))