Commit add5e49b authored by blam's avatar blam

Merge branch 'notifications' into 'master'

Notifications

See merge request mer-core/buteo-sync-plugins-social!62
parents 41608ae9 9cf71ef9
......@@ -258,9 +258,6 @@ Requires: %{name} = %{version}-%{release}
#%%{_libdir}/buteo-plugins-qt5/libtwitter-notifications-client.so
%config %{_sysconfdir}/buteo/profiles/client/twitter-notifications.xml
%config %{_sysconfdir}/buteo/profiles/sync/twitter.Notifications.xml
%{_datadir}/lipstick/notificationcategories/x-nemo.social.twitter.mention.conf
%{_datadir}/lipstick/notificationcategories/x-nemo.social.twitter.retweet.conf
%{_datadir}/lipstick/notificationcategories/x-nemo.social.twitter.follower.conf
%{_datadir}/translations/lipstick-jolla-home-twitter-notif_eng_en.qm
%pre twitter-notifications
......@@ -292,7 +289,6 @@ Requires: %{name} = %{version}-%{release}
#%%{_libdir}/buteo-plugins-qt5/libtwitter-posts-client.so
%config %{_sysconfdir}/buteo/profiles/client/twitter-posts.xml
%config %{_sysconfdir}/buteo/profiles/sync/twitter.Posts.xml
%{_datadir}/lipstick/notificationcategories/x-nemo.social.twitter.tweet.conf
%pre twitter-posts
USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n")
......@@ -345,7 +341,6 @@ Requires: %{name} = %{version}-%{release}
%{summary}.
%files vk-posts
%{_datadir}/lipstick/notificationcategories/x-nemo.social.vk.statuspost.conf
#%{_datadir}/translations/lipstick-jolla-home-vk_eng_en.qm
#out-of-process-plugin form:
%{_libdir}/buteo-plugins-qt5/oopp/vk-posts-client
......@@ -517,7 +512,6 @@ Requires: %{name} = %{version}-%{release}
#%%{_libdir}/buteo-plugins-qt5/libvk-notifications-client.so
%config %{_sysconfdir}/buteo/profiles/client/vk-notifications.xml
%config %{_sysconfdir}/buteo/profiles/sync/vk.Notifications.xml
%{_datadir}/lipstick/notificationcategories/x-nemo.social.vk.notification.conf
%pre vk-notifications
USERS=$(getent group users | cut -d ":" -f 4 | tr "," "\n")
......
......@@ -10,19 +10,13 @@ twitter_notifications_sync_profile.path = /etc/buteo/profiles/sync
twitter_notifications_sync_profile.files = $$PWD/twitter.Notifications.xml
twitter_notifications_client_plugin_xml.path = /etc/buteo/profiles/client
twitter_notifications_client_plugin_xml.files = $$PWD/twitter-notifications.xml
twitter_notifications_notification_xml.path = /usr/share/lipstick/notificationcategories/
twitter_notifications_notification_xml.files = \
$$PWD/x-nemo.social.twitter.mention.conf \
$$PWD/x-nemo.social.twitter.retweet.conf \
$$PWD/x-nemo.social.twitter.follower.conf
HEADERS += twitternotificationsplugin.h
SOURCES += twitternotificationsplugin.cpp
OTHER_FILES += \
twitter_notifications_sync_profile.files \
twitter_notifications_client_plugin_xml.files \
twitter_notifications_notification_xml.files
twitter_notifications_client_plugin_xml.files
# translations
TWITTER_TS_FILE = $$OUT_PWD/lipstick-jolla-home-twitter-notif.ts
......@@ -52,6 +46,5 @@ INSTALLS += \
target \
twitter_notifications_sync_profile \
twitter_notifications_client_plugin_xml \
twitter_notifications_notification_xml \
twitter_ts_install \
twitter_engineering_english_install
......@@ -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) {
......@@ -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) {
......@@ -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));
......@@ -550,6 +557,7 @@ 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());
......@@ -557,6 +565,9 @@ void TwitterNotificationSyncAdaptor::finishedUserShowHandler()
//: 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));
......@@ -583,7 +594,9 @@ Notification *TwitterNotificationSyncAdaptor::createNotification(int accountId,
notification = new Notification(this);
//% "Twitter"
notification->setAppName(qtTrId("qtn_social_notifications_twitter"));
notification->setAppIcon("icon-lock-twitter");
notification->setHintValue("x-nemo.sociald.account-id", accountId);
notification->setHintValue("x-nemo-feedback", "social");
if (ntype == TwitterNotificationSyncAdaptor::Mention) {
notification->setCategory(QLatin1String("x-nemo.social.twitter.mention"));
} else if (ntype == TwitterNotificationSyncAdaptor::Retweet) {
......
appIcon=icon-lock-twitter
x-nemo-icon=icon-lock-twitter
x-nemo-preview-icon=icon-lock-twitter
x-nemo-feedback=social
x-nemo-priority=60
appIcon=icon-lock-twitter
x-nemo-icon=icon-lock-twitter
x-nemo-preview-icon=icon-lock-twitter
x-nemo-feedback=social
x-nemo-priority=60
appIcon=icon-lock-twitter
x-nemo-icon=icon-lock-twitter
x-nemo-preview-icon=icon-lock-twitter
x-nemo-feedback=social
x-nemo-priority=60
......@@ -10,19 +10,15 @@ twitter_posts_sync_profile.path = /etc/buteo/profiles/sync
twitter_posts_sync_profile.files = $$PWD/twitter.Posts.xml
twitter_posts_client_plugin_xml.path = /etc/buteo/profiles/client
twitter_posts_client_plugin_xml.files = $$PWD/twitter-posts.xml
twitter_posts_notification_xml.path = /usr/share/lipstick/notificationcategories/
twitter_posts_notification_xml.files = $$PWD/x-nemo.social.twitter.tweet.conf
HEADERS += twitterpostsplugin.h
SOURCES += twitterpostsplugin.cpp
OTHER_FILES += \
twitter_posts_sync_profile.files \
twitter_posts_client_plugin_xml.files \
twitter_posts_notification_xml.files
twitter_posts_client_plugin_xml.files
INSTALLS += \
target \
twitter_posts_sync_profile \
twitter_posts_client_plugin_xml \
twitter_posts_notification_xml
twitter_posts_client_plugin_xml
appIcon=icon-lock-twitter
x-nemo-icon=icon-lock-twitter
x-nemo-preview-icon=icon-lock-twitter
x-nemo-feedback=social
x-nemo-priority=60
......@@ -10,19 +10,15 @@ vk_notifications_sync_profile.path = /etc/buteo/profiles/sync
vk_notifications_sync_profile.files = $$PWD/vk.Notifications.xml
vk_notifications_client_plugin_xml.path = /etc/buteo/profiles/client
vk_notifications_client_plugin_xml.files = $$PWD/vk-notifications.xml
vk_notifications_notification_xml.path = /usr/share/lipstick/notificationcategories/
vk_notifications_notification_xml.files = $$PWD/x-nemo.social.vk.notification.conf
HEADERS += vknotificationsplugin.h
SOURCES += vknotificationsplugin.cpp
OTHER_FILES += \
vk.Notifications.xml \
vk-notifications.xml \
x-nemo.social.vk.notification.conf
vk-notifications.xml
INSTALLS += \
target \
vk_notifications_sync_profile \
vk_notifications_client_plugin_xml \
vk_notifications_notification_xml
vk_notifications_client_plugin_xml
x-nemo-icon=icon-lock-vk
x-nemo-preview-icon=icon-lock-vk
x-nemo-feedback=social
genericTextId=qtn_social_notifications_new_vk
genericTextCatalogue=sociald
priority=60
lowPowerModeIconId=icon-lock-vk
statusAreaIconId=icon-lock-vk
......@@ -13,19 +13,15 @@ vk_posts_sync_profile.path = /etc/buteo/profiles/sync
vk_posts_sync_profile.files = $$PWD/vk.Posts.xml
vk_posts_client_plugin_xml.path = /etc/buteo/profiles/client
vk_posts_client_plugin_xml.files = $$PWD/vk-posts.xml
vk_posts_notification_xml.path = /usr/share/lipstick/notificationcategories/
vk_posts_notification_xml.files = $$PWD/x-nemo.social.vk.statuspost.conf
HEADERS += vkpostsplugin.h
SOURCES += vkpostsplugin.cpp
OTHER_FILES += \
vk.Posts.xml \
vk-posts.xml \
x-nemo.social.vk.statuspost.conf
vk-posts.xml
INSTALLS += \
target \
vk_posts_sync_profile \
vk_posts_client_plugin_xml \
vk_posts_notification_xml
vk_posts_client_plugin_xml
x-nemo-icon=icon-lock-vk
x-nemo-preview-icon=icon-lock-vk
x-nemo-feedback=social
genericTextCatalogue=sociald
priority=60
lowPowerModeIconId=icon-lock-vk
statusAreaIconId=icon-lock-vk
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment