From 1d22fb9b11c5c560cff2c2fb73ec3a845963643d Mon Sep 17 00:00:00 2001 From: Mihai Parparita Date: Fri, 2 Jan 2015 09:46:15 -0800 Subject: [PATCH 1/7] Fix crash when mailing a URL in the original story view. [OriginalStoryViewController doOpenActionSheet] calls showSendTo with a nil text parameter, but [NBActivityItemProvider activityViewController: itemForActivityType:] returns a dictionary with the text as a value, and dictionary literals can't use nil values. Use an empty string instead. Appears to be a regression from 1002403e81087e16695589e7ad1b322856252d40. --- clients/ios/Classes/NBActivityItemProvider.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/ios/Classes/NBActivityItemProvider.m b/clients/ios/Classes/NBActivityItemProvider.m index 735ebe409..c4da51d19 100644 --- a/clients/ios/Classes/NBActivityItemProvider.m +++ b/clients/ios/Classes/NBActivityItemProvider.m @@ -30,7 +30,7 @@ -(id)activityViewController:(UIActivityViewController *)activityViewController itemForActivityType:(NSString *)activityType { if ([activityType isEqualToString:UIActivityTypeMail] || [activityType isEqualToString:@"com.evernote.iPhone.Evernote.EvernoteShare"]) { - return @{@"body": text, @"subject": title}; + return @{@"body": text ?: @"", @"subject": title}; } else if ([activityType isEqualToString:UIActivityTypePostToTwitter] || [activityType isEqualToString:UIActivityTypePostToFacebook] || [activityType isEqualToString:UIActivityTypePostToWeibo]) { From aad4c1e7dee264c559f49035c5fd1ff1b0b69f4b Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 5 Jan 2015 14:41:24 -0800 Subject: [PATCH 2/7] Syncing offline status text with ios. --- clients/android/NewsBlur/AndroidManifest.xml | 4 ++-- .../src/com/newsblur/service/NBSyncService.java | 14 +++++++------- .../src/com/newsblur/util/AppConstants.java | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/clients/android/NewsBlur/AndroidManifest.xml b/clients/android/NewsBlur/AndroidManifest.xml index 8220cd6a7..2762db95c 100644 --- a/clients/android/NewsBlur/AndroidManifest.xml +++ b/clients/android/NewsBlur/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="81" + android:versionName="4.0.3b1" > Date: Mon, 5 Jan 2015 16:04:47 -0800 Subject: [PATCH 3/7] Bumping Android to 4.1.0b1. --- clients/android/NewsBlur/AndroidManifest.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/android/NewsBlur/AndroidManifest.xml b/clients/android/NewsBlur/AndroidManifest.xml index 2762db95c..ee24c8700 100644 --- a/clients/android/NewsBlur/AndroidManifest.xml +++ b/clients/android/NewsBlur/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="82" + android:versionName="4.1.0b1" > Date: Mon, 5 Jan 2015 16:06:48 -0800 Subject: [PATCH 4/7] Checking premium status on paypal sync. --- apps/profile/models.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/profile/models.py b/apps/profile/models.py index b2da55220..4798dc873 100644 --- a/apps/profile/models.py +++ b/apps/profile/models.py @@ -219,7 +219,7 @@ class Profile(models.Model): self.user.save() self.send_new_user_queue_email() - def setup_premium_history(self, alt_email=None): + def setup_premium_history(self, alt_email=None, check_premium=False): paypal_payments = [] stripe_payments = [] existing_history = PaymentHistory.objects.filter(user=self.user, @@ -282,6 +282,9 @@ class Profile(models.Model): logging.user(self.user, "~BY~SN~FWFound ~SB%s paypal~SN and ~SB%s stripe~SN payments (~SB%s payments expire: ~SN~FB%s~FW)" % ( len(paypal_payments), len(stripe_payments), len(payment_history), self.premium_expire)) + if check_premium and self.premium_expire > datetime.datetime.now() and not self.is_premium: + self.activate_premium() + def refund_premium(self, partial=False): refunded = False @@ -723,7 +726,7 @@ def paypal_payment_history_sync(sender, **kwargs): user = User.objects.get(email__iexact=ipn_obj.payer_email) logging.user(user, "~BC~SB~FBPaypal subscription payment") try: - user.profile.setup_premium_history() + user.profile.setup_premium_history(check_premium=True) except: return {"code": -1, "message": "User doesn't exist."} payment_was_successful.connect(paypal_payment_history_sync) @@ -737,7 +740,7 @@ def paypal_payment_was_flagged(sender, **kwargs): user = User.objects.get(email__iexact=ipn_obj.payer_email) logging.user(user, "~BC~SB~FBPaypal subscription payment flagged") try: - user.profile.setup_premium_history() + user.profile.setup_premium_history(check_premium=True) except: return {"code": -1, "message": "User doesn't exist."} payment_was_flagged.connect(paypal_payment_was_flagged) @@ -750,7 +753,7 @@ def paypal_recurring_payment_history_sync(sender, **kwargs): user = User.objects.get(email__iexact=ipn_obj.payer_email) logging.user(user, "~BC~SB~FBPaypal subscription recurring payment") try: - user.profile.setup_premium_history() + user.profile.setup_premium_history(check_premium=True) except: return {"code": -1, "message": "User doesn't exist."} recurring_payment.connect(paypal_recurring_payment_history_sync) @@ -770,7 +773,7 @@ def stripe_payment_history_sync(sender, full_json, **kwargs): try: profile = Profile.objects.get(stripe_id=stripe_id) logging.user(profile.user, "~BC~SB~FBStripe subscription payment") - profile.setup_premium_history() + profile.setup_premium_history(check_premium=True) except Profile.DoesNotExist: return {"code": -1, "message": "User doesn't exist."} zebra_webhook_charge_succeeded.connect(stripe_payment_history_sync) From da1c3e31edd90fa6d030d81d69ed6360d6f81f11 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 5 Jan 2015 16:38:20 -0800 Subject: [PATCH 5/7] Updating elasticsearch to 0.90.13. --- fabfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fabfile.py b/fabfile.py index c92af41d6..a0bfc5fca 100644 --- a/fabfile.py +++ b/fabfile.py @@ -1023,7 +1023,7 @@ def setup_original_page_server(): sudo('supervisorctl reload') def setup_elasticsearch(): - ES_VERSION = "0.90.0" + ES_VERSION = "0.90.13" sudo('apt-get update') sudo('apt-get install openjdk-7-jre -y') @@ -1032,7 +1032,7 @@ def setup_elasticsearch(): with cd(os.path.join(env.VENDOR_PATH, 'elasticsearch-%s' % ES_VERSION)): run('wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-%s.deb' % ES_VERSION) sudo('dpkg -i elasticsearch-%s.deb' % ES_VERSION) - sudo('/usr/share/elasticsearch/bin/plugin -install mobz/elasticsearch-head' % ES_VERSION) + sudo('/usr/share/elasticsearch/bin/plugin -install mobz/elasticsearch-head') def setup_db_search(): put('config/supervisor_celeryd_search_indexer.conf', '/etc/supervisor/conf.d/celeryd_search_indexer.conf', use_sudo=True) From b8a38beed09956f77ebbfdbec1f662f78926d4ee Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 5 Jan 2015 16:39:33 -0800 Subject: [PATCH 6/7] Handling missing social subs caused by cached subs on android. --- apps/reader/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/reader/views.py b/apps/reader/views.py index 4781c95a8..ec67ceb9e 100644 --- a/apps/reader/views.py +++ b/apps/reader/views.py @@ -1519,7 +1519,12 @@ def mark_feed_as_read(request): for feed_id in feed_ids: if 'social:' in feed_id: user_id = int(feed_id.replace('social:', '')) - sub = MSocialSubscription.objects.get(user_id=request.user.pk, subscription_user_id=user_id) + try: + sub = MSocialSubscription.objects.get(user_id=request.user.pk, + subscription_user_id=user_id) + except MSocialSubscription.DoesNotExist: + logging.user(request, "~FRCouldn't find socialsub: %s" % user_id) + continue if not multiple: sub_user = User.objects.get(pk=sub.subscription_user_id) logging.user(request, "~FMMarking social feed as read: ~SB%s" % (sub_user.username,)) From 9e1e4976192b39b4b0312309a7707a73186409db Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Mon, 5 Jan 2015 16:59:46 -0800 Subject: [PATCH 7/7] Handling error when user's twitter connection doesn't work. --- apps/social/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/social/models.py b/apps/social/models.py index 6209ee7eb..c6e7d62ea 100644 --- a/apps/social/models.py +++ b/apps/social/models.py @@ -2613,7 +2613,7 @@ class MSocialServices(mongo.Document): try: api = self.twitter_api() me = api.me() - except tweepy.TweepError, e: + except (tweepy.TweepError, TypeError), e: logging.user(user, "~FRException (%s): ~FCsetting to blank profile photo" % e) self.twitter_picture_url = None self.set_photo("nothing")