mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-01 02:48:05 +01:00
enable all js extensions
This commit is contained in:
parent
6fcb96f36c
commit
279256c27d
@ -73,7 +73,7 @@ Here is the reference of methods and properties of some types available in your
|
||||
|---|---|---|
|
||||
| `Accept` | 1 | Message is accepted and will be added to DB or updated in DB. |
|
||||
| `Ignore` | 2 | Message is ignored and will be **NOT** added to DB or updated in DB, but is not purged from DB if already exists. |
|
||||
| `Purge` | 4 | Existing message is purged from the DB completely. |
|
||||
| `Purge` | 4 | Existing message is purged from the DB completely. Behavior is the same as `Ignore` when there is new incoming message. |
|
||||
|
||||
Note that `MessageObject` attributes which can be synchronized back to service are synchronized even if you return `Purge` or `Ignore`. In other words: even if you filter ignores the message you can still tweak its properties which will get synchronized back to your server.
|
||||
|
||||
|
@ -52,9 +52,10 @@ void MessageFilter::setScript(const QString& script) {
|
||||
}
|
||||
|
||||
void MessageFilter::initializeFilteringEngine(QJSEngine& engine, MessageObject* message_wrapper) {
|
||||
engine.installExtensions(QJSEngine::Extension::ConsoleExtension);
|
||||
engine.installExtensions(QJSEngine::Extension::AllExtensions);
|
||||
engine.globalObject().setProperty(QSL("MSG_ACCEPT"), int(MessageObject::FilteringAction::Accept));
|
||||
engine.globalObject().setProperty(QSL("MSG_IGNORE"), int(MessageObject::FilteringAction::Ignore));
|
||||
engine.globalObject().setProperty(QSL("MSG_PURGE"), int(MessageObject::FilteringAction::Purge));
|
||||
|
||||
// Register the wrapper.
|
||||
auto js_object = engine.newQObject(message_wrapper);
|
||||
|
Loading…
Reference in New Issue
Block a user