Skip to content

Commit

Permalink
[sociald] Initial VK support including VK Posts sync adaptor. Contrib…
Browse files Browse the repository at this point in the history
…utes to JB#19270

This commit adds VK as a supported social network in sociald, and
adds a posts sync adaptor.

Contributes to JB#19270
  • Loading branch information
Bea Lam authored and Antti Seppälä committed Oct 12, 2015
1 parent e5c363b commit 63031f8
Show file tree
Hide file tree
Showing 16 changed files with 988 additions and 3 deletions.
30 changes: 28 additions & 2 deletions rpm/sociald.spec
Expand Up @@ -315,8 +315,6 @@ rm -f /home/nemo/.cache/msyncd/sync/twitter.Posts.xml
systemctl-user try-restart msyncd.service || :




%package onedrive-signon
Summary: Provides signon credentials refreshing with OneDrive
License: LGPLv2.1
Expand All @@ -343,6 +341,34 @@ rm -f /home/nemo/.cache/msyncd/sync/onedrive.Signon.xml
systemctl-user try-restart msyncd.service || :


%package vk-posts
Summary: Provides post synchronisation with VK
License: LGPLv2.1
Group: System/Libraries
BuildRequires: pkgconfig(Qt5Contacts)
BuildRequires: pkgconfig(qtcontacts-sqlite-qt5-extensions)
BuildRequires: qt5-qttools-linguist
Requires: %{name} = %{version}-%{release}

%description vk-posts
Provides post synchronisation with VK

%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:
/usr/lib/buteo-plugins-qt5/oopp/vk-posts-client
#in-process-plugin form:
#/usr/lib/buteo-plugins-qt5/libvk-posts-client.so
%config %{_sysconfdir}/buteo/profiles/client/vk-posts.xml
%config %{_sysconfdir}/buteo/profiles/sync/vk.Posts.xml

%pre vk-posts
rm -f /home/nemo/.cache/msyncd/sync/client/vk-posts.xml
rm -f /home/nemo/.cache/msyncd/sync/vk.Posts.xml

%post vk-posts
systemctl-user restart msyncd.service || :

%package dropbox-images
Summary: Provides image synchronisation with Dropbox
Expand Down
1 change: 1 addition & 0 deletions src/sociald/socialdplugin.cpp
Expand Up @@ -99,6 +99,7 @@ bool SocialdPlugin::startSync()
//startSyncParams << "facebook.Posts";
startSyncParams << "twitter.Notifications";
startSyncParams << "twitter.Posts";
startSyncParams << "vk.Posts";
}

foreach (const QString &param, startSyncParams) {
Expand Down
3 changes: 2 additions & 1 deletion src/src.pro
Expand Up @@ -5,4 +5,5 @@ SUBDIRS = \
facebook \
twitter \
onedrive \
dropbox
dropbox \
vk
3 changes: 3 additions & 0 deletions src/vk/vk-common.pri
@@ -0,0 +1,3 @@
INCLUDEPATH += $$PWD
SOURCES += $$PWD/vkdatatypesyncadaptor.cpp
HEADERS += $$PWD/vkdatatypesyncadaptor.h
5 changes: 5 additions & 0 deletions src/vk/vk-posts/vk-posts.pri
@@ -0,0 +1,5 @@
CONFIG += link_pkgconfig meegotouchevents-qt5
PKGCONFIG += nemonotifications-qt5 Qt5Contacts qtcontacts-sqlite-qt5-extensions
SOURCES += $$PWD/vkpostsyncadaptor.cpp
HEADERS += $$PWD/vkpostsyncadaptor.h
INCLUDEPATH += $$PWD
30 changes: 30 additions & 0 deletions src/vk/vk-posts/vk-posts.pro
@@ -0,0 +1,30 @@
TARGET = vk-posts-client
VERSION = 0.0.1

DEFINES += "CLASSNAME=VKPostsPlugin"
DEFINES += CLASSNAME_H=\\\"vkpostsplugin.h\\\"
DEFINES += SOCIALD_USE_QTPIM
include($$PWD/../../common.pri)
include($$PWD/../vk-common.pri)
include($$PWD/vk-posts.pri)

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

INSTALLS += \
target \
vk_posts_sync_profile \
vk_posts_client_plugin_xml \
vk_posts_notification_xml
4 changes: 4 additions & 0 deletions src/vk/vk-posts/vk-posts.xml
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<profile name="vk-posts" type="client" >
<field name="Sync Direction" />
</profile>
15 changes: 15 additions & 0 deletions src/vk/vk-posts/vk.Posts.xml
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<profile name="vk.Posts" type="sync" >
<key name="category" value="eventfeed" />
<key name="enabled" value="false" />
<key name="use_accounts" value="false" />
<key name="destinationtype" value="online" />
<key name="hidden" value="true" />
<key name="displayname" value="VK Posts"/>

<schedule enabled="true" interval="30" days="1,2,3,4,5,6,7" syncconfiguredtime="" time="" />

<profile name="vk-posts" type="client" >
<key name="Sync Direction" value="from-remote" />
</profile>
</profile>
44 changes: 44 additions & 0 deletions src/vk/vk-posts/vkpostsplugin.cpp
@@ -0,0 +1,44 @@
/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Chris Adams <chris.adams@jolla.com>
**
****************************************************************************/

#include "constants_p.h"
#include <qtcontacts-extensions_impl.h>
#include <qcontactoriginmetadata_impl.h>

#include "vkpostsplugin.h"
#include "vkpostsyncadaptor.h"
#include "socialnetworksyncadaptor.h"

extern "C" VKPostsPlugin* createPlugin(const QString& pluginName,
const Buteo::SyncProfile& profile,
Buteo::PluginCbInterface *callbackInterface)
{
return new VKPostsPlugin(pluginName, profile, callbackInterface);
}

extern "C" void destroyPlugin(VKPostsPlugin* plugin)
{
delete plugin;
}

VKPostsPlugin::VKPostsPlugin(const QString& pluginName,
const Buteo::SyncProfile& profile,
Buteo::PluginCbInterface *callbackInterface)
: SocialdButeoPlugin(pluginName, profile, callbackInterface,
QStringLiteral("vk"),
SocialNetworkSyncAdaptor::dataTypeName(SocialNetworkSyncAdaptor::Posts))
{
}

VKPostsPlugin::~VKPostsPlugin()
{
}

SocialNetworkSyncAdaptor *VKPostsPlugin::createSocialNetworkSyncAdaptor()
{
return new VKPostSyncAdaptor(this);
}
33 changes: 33 additions & 0 deletions src/vk/vk-posts/vkpostsplugin.h
@@ -0,0 +1,33 @@
/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Chris Adams <chris.adams@jolla.com>
**
****************************************************************************/

#ifndef VKPOSTSPLUGIN_H
#define VKPOSTSPLUGIN_H

#include "socialdbuteoplugin.h"

class VKPostsPlugin : public SocialdButeoPlugin
{
Q_OBJECT

public:
VKPostsPlugin(const QString& pluginName,
const Buteo::SyncProfile& profile,
Buteo::PluginCbInterface *cbInterface);
~VKPostsPlugin();

protected:
SocialNetworkSyncAdaptor *createSocialNetworkSyncAdaptor();
};

extern "C" VKPostsPlugin* createPlugin(const QString& pluginName,
const Buteo::SyncProfile& profile,
Buteo::PluginCbInterface *cbInterface);

extern "C" void destroyPlugin(VKPostsPlugin* client);

#endif // VKPOSTSPLUGIN_H

0 comments on commit 63031f8

Please sign in to comment.