Skip to content

Commit

Permalink
[buteo-sync-plugins-social] Update notification configuration. JB#50448
Browse files Browse the repository at this point in the history
Notification previews are now shown by default, so explicitly disable
them as per existing behavior.
  • Loading branch information
Bea Lam authored and adenexter committed Oct 14, 2020
1 parent 03e1981 commit 2ce9f20
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -300,6 +300,8 @@ void TwitterNotificationSyncAdaptor::finishedMentionsHandler()
notification->setBody(qtTrId("qtn_social_notifications_twitter_n_mentions_include_n", notification->itemCount()));
openUrlArgs << QLatin1String("https://mobile.twitter.com/i/connect");
}
notification->clearPreviewSummary();
notification->clearPreviewBody();
notification->setRemoteAction(OPEN_BROWSER_ACTION(openUrlArgs));
notification->publish();
if (notification->replacesId() == 0) {
Expand Down Expand Up @@ -397,6 +399,8 @@ void TwitterNotificationSyncAdaptor::finishedRetweetsHandler()
notification->setBody(qtTrId("qtn_social_notifications_twitter_m_n_retweets_include_n", delta));
openUrlArgs << QLatin1String("https://mobile.twitter.com/i/connect");
}
notification->clearPreviewSummary();
notification->clearPreviewBody();
notification->setRemoteAction(OPEN_BROWSER_ACTION(openUrlArgs));
notification->publish();
if (notification->replacesId() == 0) {
Expand Down Expand Up @@ -506,6 +510,9 @@ void TwitterNotificationSyncAdaptor::finishedFollowersHandler()
//: The number of new followers (n) the user has on Twitter. Include n. e.g. "You" + "have 5 new followers".
//% "have %n new followers"
notification->setBody(qtTrId("qtn_social_notifications_n_followers_include_n", notification->itemCount()));
notification->clearPreviewSummary();
notification->clearPreviewBody();

QStringList openUrlArgs;
openUrlArgs << QLatin1String("https://mobile.twitter.com/i/connect");
notification->setRemoteAction(OPEN_BROWSER_ACTION(openUrlArgs));
Expand Down Expand Up @@ -550,13 +557,17 @@ void TwitterNotificationSyncAdaptor::finishedUserShowHandler()
if (ok && (response.contains("name") || response.contains("screen_name"))) {
QString name = response.value("name").toString();
QString screenName = response.value("screen_name").toString();

Notification *notification = createNotification(accountId, Retweet);
notification->setItemCount(1);
notification->setTimestamp(QDateTime::currentDateTimeUtc());
notification->setSummary(name.isEmpty() ? screenName : name);
//: Text telling the user that another user has followed them, e.g.: "John Smith" + "followed you".
//% "followed you"
notification->setBody(qtTrId("qtn_social_notifications_twitter_followed_you"));
notification->clearPreviewSummary();
notification->clearPreviewBody();

QStringList openUrlArgs;
openUrlArgs << QLatin1String("https://mobile.twitter.com/i/connect");
notification->setRemoteAction(OPEN_BROWSER_ACTION(openUrlArgs));
Expand Down

0 comments on commit 2ce9f20

Please sign in to comment.