From 16a6fa28960e15b0bcae8274b9b84851223caa4d Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Thu, 27 Apr 2017 04:01:58 +0400 Subject: [PATCH] Shows error when loading timeline for suspended users. Fixes #125 --- doc/changelog.md | 4 ++++ src/controller/mainController.py | 3 +++ src/wxUI/commonMessageDialogs.py | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/changelog.md b/doc/changelog.md index 0f1e19d5..e96140c9 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -2,6 +2,10 @@ ## changes in this version +* TWBlue will show an error when trying to open a timeline for a suspended user. ([#125](https://github.com/manuelcortez/TWBlue/issues/125)) + +## Changes in version 0.90 + * Fixed a bug in long tweet parsing that was making TWBlue to disconnect the streaming API. ([#103](https://github.com/manuelcortez/TWBlue/issues/103)) * Now OCR will work in images from retweets. It fixes a bug where TWBlue was detecting images but couldn't apply OCR on them. ([#105](https://github.com/manuelcortez/TWBlue/issues/105)) * TWBlue won't try to load tweets already deleted, made with Twishort. Before, if someone posted a long tweet but deleted it in the Twishort's site, TWBlue was trying to load the tweet and it was causing problems in all the client. ([#113](https://github.com/manuelcortez/TWBlue/issues/113)) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 71ff6b6a..4135048b 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -792,6 +792,9 @@ class Controller(object): if dlg.get_response() == widgetUtils.OK: usr = utils.if_user_exists(buff.session.twitter.twitter, dlg.get_user()) if usr != None: + if usr == dlg.get_user(): + commonMessageDialogs.suspended_user() + return if usr["protected"] == True: if usr["following"] == False: commonMessageDialogs.no_following() diff --git a/src/wxUI/commonMessageDialogs.py b/src/wxUI/commonMessageDialogs.py index 86465aab..b643a3e6 100644 --- a/src/wxUI/commonMessageDialogs.py +++ b/src/wxUI/commonMessageDialogs.py @@ -76,4 +76,7 @@ def unauthorized(): return wx.MessageDialog(None, _(u"You have been blocked from viewing this content"), _(u"Error"), wx.OK).ShowModal() def blocked_timeline(): - return wx.MessageDialog(None, _(u"You have been blocked from viewing someone's content. In order to avoid conflicts with the full session, TWBlue will remove the affected timeline."), _(u"Error"), wx.OK).ShowModal() \ No newline at end of file + return wx.MessageDialog(None, _(u"You have been blocked from viewing someone's content. In order to avoid conflicts with the full session, TWBlue will remove the affected timeline."), _(u"Error"), wx.OK).ShowModal() + +def suspended_user(): + return wx.MessageDialog(None, _(u"TWBlue cannot load this timeline because the user has been suspended from Twitter."), _(u"Error"), wx.OK).ShowModal() \ No newline at end of file