Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[buteo-sync-plugins-social] Add knowncontacts plugin. Fixes JB#48443
This is new plugin that can sync contacts written to ini files. It ensures that the contacts are not synced to any cloud services.
- Loading branch information
Showing
11 changed files
with
791 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,7 @@ Makefile | |
*.qm | ||
*.moc | ||
*.obj | ||
/RPMS/ | ||
*.list | ||
*-client | ||
tests/tst_*/tst_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Knowncontacts Sync Plugin | ||
========================= | ||
This is a sync plugin for Buteo framework. It stores locally created contacts, | ||
such as email recipients that are not to be synced elsewhere and only ever | ||
syncs to the device side. | ||
|
||
In this case the "server" means QSettings files containing contacts. On sync | ||
this plugin reads the files and creates local contacts from the information. | ||
|
||
Contact file format | ||
------------------- | ||
A contact in QSettings file must have an id as group name and contact | ||
information as key value pairs. There are no requirements for the id but it | ||
must be consistent between syncs to avoid duplicating contact information. All | ||
keys are optional. A file may have as many contacts as needed. The file must | ||
end with file extension `ini` and they are stored in | ||
`~/.local/share/system/privileged/Contacts/knowncontacts`. | ||
|
||
```ini | ||
[john.doe.example] | ||
FirstName=John | ||
LastName=Doe | ||
EmailAddress=john@example.com | ||
``` | ||
|
||
Supported keys: | ||
- FirstName, LastName | ||
- EmailAddress | ||
- Phone, HomePhone, MobilePhone | ||
- Company, Title, Office |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<profile name="knowncontacts.Contacts" type="sync" > | ||
<key name="destinationtype" value="online"/> | ||
<key name="displayname" value="KnownContacts"/> | ||
<key name="enabled" value="true" /> | ||
<key name="hidden" value="true" /> | ||
<key name="use_accounts" value="true" /> | ||
|
||
<profile name="knowncontacts" type="client" > | ||
<key name="Sync Transport" value="HTTP" /> | ||
<key name="Sync Direction" value="two-way" /> | ||
<key name="conflictpolicy" value="server-wins" /> | ||
</profile> | ||
</profile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
TARGET = knowncontacts-client | ||
|
||
DEFINES += "CLASSNAME=KnownContactsPlugin" | ||
DEFINES += CLASSNAME_H=\\\"knowncontactsplugin.h\\\" | ||
knowncontacts_sync_profile.path = /etc/buteo/profiles/sync | ||
knowncontacts_sync_profile.files = knowncontacts.Contacts.xml | ||
knowncontacts_client_plugin_xml.path = /etc/buteo/profiles/client | ||
knowncontacts_client_plugin_xml.files = knowncontacts.xml | ||
|
||
HEADERS += \ | ||
knowncontactsplugin.h \ | ||
knowncontactssyncer.h | ||
|
||
SOURCES += \ | ||
knowncontactsplugin.cpp \ | ||
knowncontactssyncer.cpp | ||
|
||
OTHER_FILES = \ | ||
knowncontacts.Contacts.xml | ||
knowncontacts.xml | ||
|
||
QT -= gui | ||
QT += dbus | ||
|
||
CONFIG += link_pkgconfig c++14 | ||
PKGCONFIG += buteosyncfw5 Qt5Contacts qtcontacts-sqlite-qt5-extensions | ||
|
||
QMAKE_CXXFLAGS = -Wall \ | ||
-g \ | ||
-Wno-cast-align \ | ||
-O2 -finline-functions | ||
|
||
TEMPLATE = app | ||
target.path = /usr/lib/buteo-plugins-qt5/oopp | ||
DEFINES += CLIENT_PLUGIN | ||
INCLUDE_DIR = $$system(pkg-config --cflags buteosyncfw5|cut -f2 -d'I') | ||
|
||
HEADERS += $$INCLUDE_DIR/ButeoPluginIfaceAdaptor.h \ | ||
$$INCLUDE_DIR/PluginCbImpl.h \ | ||
$$INCLUDE_DIR/PluginServiceObj.h | ||
|
||
SOURCES += $$INCLUDE_DIR/ButeoPluginIfaceAdaptor.cpp \ | ||
$$INCLUDE_DIR/PluginCbImpl.cpp \ | ||
$$INCLUDE_DIR/PluginServiceObj.cpp \ | ||
$$INCLUDE_DIR/plugin_main.cpp | ||
|
||
INSTALLS += target \ | ||
knowncontacts_sync_profile \ | ||
knowncontacts_client_plugin_xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<profile name="knowncontacts" type="client" > | ||
<key name="Sync Transport" value="HTTP" /> | ||
<key name="Sync Direction" value="two-way" /> | ||
<key name="conflictpolicy" value="server-wins" /> | ||
</profile> |
Oops, something went wrong.