Navigation Menu

Skip to content

Commit

Permalink
Merge branch 'zero_retweets' into 'master'
Browse files Browse the repository at this point in the history
[buteo-sync-plugins-social] Protect against 0 retweets. Fixes JB#34730

Testing so far: it compiles. But seems simple enough.

@chriadam 

See merge request !16
  • Loading branch information
pvuorela committed May 16, 2016
2 parents 7c16e9d + 5edaac7 commit 21e115e
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -350,10 +350,13 @@ void TwitterNotificationSyncAdaptor::finishedRetweetsHandler()
selfUserScreenName = tweet.value(QLatin1String("user")).toObject().value(QLatin1String("screen_name")).toString();
QString retweetId = tweet.value(QLatin1String("id_str")).toString();
int retweetsCount = tweet.value(QLatin1String("retweet_count")).toInt();
retweetCounts.insert(retweetId, retweetsCount);
if (!dbRetweetCounts.contains(retweetId) || dbRetweetCounts.value(retweetId) < retweetsCount) {
delta += retweetsCount - dbRetweetCounts.value(retweetId);
newlyRetweetedTweets.append(retweetId);

if (retweetsCount > 0) {
retweetCounts.insert(retweetId, retweetsCount);
if (!dbRetweetCounts.contains(retweetId) || dbRetweetCounts.value(retweetId) < retweetsCount) {
delta += retweetsCount - dbRetweetCounts.value(retweetId);
newlyRetweetedTweets.append(retweetId);
}
}
}

Expand Down

0 comments on commit 21e115e

Please sign in to comment.