Skip to content

Commit

Permalink
[buteo-sync-plugins-social] Update VK contacts plugin to work with la…
Browse files Browse the repository at this point in the history
…test QtPim. JB#50552

- Implement the TwoWayContactSyncAdaptor interface
- Remove OOB usage (no longer necessary to store data out-of-band
- No longer needs to determine contact deltas when syncing. This is
done by TwoWayContactSyncAdaptor instead.
- Fix avatar download url
- Use a VK collection specific to the account, instead of a sync target
- Remove old clean-up code path for stale contact avatars
  • Loading branch information
Bea Lam committed Sep 25, 2020
1 parent b2395eb commit 910123a
Show file tree
Hide file tree
Showing 4 changed files with 302 additions and 670 deletions.
1 change: 0 additions & 1 deletion rpm/sociald.spec
Expand Up @@ -341,7 +341,6 @@ Requires: %{name} = %{version}-%{release}
%{summary}.

%files vk-posts
#%{_datadir}/translations/lipstick-jolla-home-vk_eng_en.qm
#out-of-process-plugin form:
%{_libdir}/buteo-plugins-qt5/oopp/vk-posts-client
#in-process-plugin form:
Expand Down
12 changes: 2 additions & 10 deletions src/vk/vk-contacts/vkcontactimagedownloader.cpp
Expand Up @@ -7,13 +7,10 @@

#include "vkcontactimagedownloader.h"

#include <QUrl>
#include <QUrlQuery>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkAccessManager>

static const char *IMAGE_DOWNLOADER_TOKEN_KEY = "token";
static const char *IMAGE_DOWNLOADER_IDENTIFIER_KEY = "identifier";

VKContactImageDownloader::VKContactImageDownloader()
Expand All @@ -31,14 +28,9 @@ QNetworkReply * VKContactImageDownloader::createReply(const QString &url,
{
Q_D(AbstractImageDownloader);

// XXX TODO: this might not be needed.
QString accessToken = metadata.value(IMAGE_DOWNLOADER_TOKEN_KEY).toString();
QUrl requestUrl(url);
QUrlQuery urlQuery;
urlQuery.addQueryItem("access_token", accessToken);
requestUrl.setQuery(urlQuery);
Q_UNUSED(metadata)

QNetworkRequest request(requestUrl);
QNetworkRequest request(url);
return d->networkAccessManager->get(request);
}

Expand Down

0 comments on commit 910123a

Please sign in to comment.