mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-30 05:19:57 +00:00
Protect against syncing client state tiddlers to the server
The default sync filter omits $:/state/, but users can customise it
This commit is contained in:
parent
ce79a4add8
commit
131a5abeb8
@ -14,6 +14,7 @@ A sync adaptor module for synchronising with MultiWikiServer-compatible servers
|
|||||||
|
|
||||||
var CONFIG_HOST_TIDDLER = "$:/config/multiwikiclient/host",
|
var CONFIG_HOST_TIDDLER = "$:/config/multiwikiclient/host",
|
||||||
DEFAULT_HOST_TIDDLER = "$protocol$//$host$/",
|
DEFAULT_HOST_TIDDLER = "$protocol$//$host$/",
|
||||||
|
MWC_STATE_TIDDLER_PREFIX = "$:/state/multiwikiclient/",
|
||||||
BAG_STATE_TIDDLER = "$:/state/multiwikiclient/tiddlers/bag",
|
BAG_STATE_TIDDLER = "$:/state/multiwikiclient/tiddlers/bag",
|
||||||
REVISION_STATE_TIDDLER = "$:/state/multiwikiclient/tiddlers/revision",
|
REVISION_STATE_TIDDLER = "$:/state/multiwikiclient/tiddlers/revision",
|
||||||
CONNECTION_STATE_TIDDLER = "$:/state/multiwikiclient/connection",
|
CONNECTION_STATE_TIDDLER = "$:/state/multiwikiclient/connection",
|
||||||
@ -252,7 +253,7 @@ Save a tiddler and invoke the callback with (err,adaptorInfo,revision)
|
|||||||
*/
|
*/
|
||||||
MultiWikiClientAdaptor.prototype.saveTiddler = function(tiddler,callback,options) {
|
MultiWikiClientAdaptor.prototype.saveTiddler = function(tiddler,callback,options) {
|
||||||
var self = this;
|
var self = this;
|
||||||
if(this.isReadOnly) {
|
if(this.isReadOnly || tiddler.fields.title.substr(0,MWC_STATE_TIDDLER_PREFIX.length) === MWC_STATE_TIDDLER_PREFIX) {
|
||||||
return callback(null);
|
return callback(null);
|
||||||
}
|
}
|
||||||
$tw.utils.httpRequest({
|
$tw.utils.httpRequest({
|
||||||
|
Loading…
Reference in New Issue
Block a user