This commit is contained in:
Martin Rotter 2020-12-13 07:29:22 +01:00
parent ca73238f4f
commit d93674a196
4 changed files with 30 additions and 10 deletions

View file

@ -7,7 +7,7 @@ RSS Guard
[![GitHub issues](https://img.shields.io/github/issues/martinrotter/rssguard.svg?maxAge=360)](https://github.com/martinrotter/rssguard/issues)
[![License](https://img.shields.io/github/license/martinrotter/rssguard.svg?maxAge=360000)](https://github.com/martinrotter/rssguard/blob/master/LICENSE.md)
### [Downloads](https://github.com/martinrotter/rssguard/releases)
### [Downloads](https://github.com/martinrotter/rssguard/releases) | [Development builds](https://github.com/martinrotter/rssguard/releases/tag/devbuild) | [Documentation](https://github.com/martinrotter/rssguard/blob/master/resources/docs/Documentation.md)
RSS Guard is simple, light and easy-to-use RSS/ATOM feed aggregator developed using Qt framework which supports online feed synchronization with these services:
* [Tiny Tiny RSS](https://tt-rss.org),
@ -15,6 +15,4 @@ RSS Guard is simple, light and easy-to-use RSS/ATOM feed aggregator developed us
* [Nextcloud News](https://apps.nextcloud.com/apps/news),
* [Gmail API](https://developers.google.com/gmail/api).
Application icon was kindly contributed by Siddharth Yadav - @Siddharth_yd (Instagram), illustrationdesignsid@gmail.com (e-mail).
Development builds can be downloaded [here](https://github.com/martinrotter/rssguard/releases/tag/devbuild). Documentation is [here](https://github.com/martinrotter/rssguard/blob/master/resources/docs/Documentation.md).
Application icon was kindly contributed by Siddharth Yadav - @Siddharth_yd (Instagram), illustrationdesignsid@gmail.com (e-mail).

View file

@ -37,7 +37,7 @@ For example if you want to check if there is already another message with same a
## API reference
Here is the reference of methods and properties of some types available in your filtering scipts.
### `MessageObject`
### `MessageObject` class
| Property/method | Description |
|---|---|
@ -52,17 +52,37 @@ Here is the reference of methods and properties of some types available in your
| `Date created` | Date/time of the message. |
| `Boolean isRead` | Is message read? |
| `Boolean isImportant` | Is message important? |
| `Boolean isDeleted` | Is message placed in recycle bin? Available in RSS Guard 3.8.4+. |
| `Boolean isDuplicateWithAttribute(DuplicationAttributeCheck)` | Allows you to test if this particular message is already stored in RSS Guard's DB. |
| `Boolean assignLabel(String)` | Assigns label to this message. The passed `String` value is the `customId` property of `Label` type. See its API reference for relevant info. Available in RSS Guard 3.8.1+. |
| `Boolean deassignLabel(String)` | Removes label from this message. The passed `String` value is the `customId` property of `Label` type. See its API reference for relevant info. Available in RSS Guard 3.8.1+. |
| `Boolean alreadyStoredInDb()` | `READ-ONLY` Returns true if this message is already stored in DB. This function is the way to check if the filter is being run automatically for newly downloaded messages or manually for already existing messages. Available in RSS Guard 3.8.4+. |
### `Label`
### `Label` class
| Property/method | Description |
|---|---|
| `String title` | `READ-ONLY` Label title. |
| `String customId` | `READ-ONLY` Service-specific ID of this label. This ID is used as unique identifier for the label and is particularly useful if you want to (de)assign label to/from message. |
| `color color` | `READ-ONLY` Label color. Note that type `color` has its documentation [here](https://doc.qt.io/qt-5/qml-color.html). |
### `FilteringAction` enum
| Enumerant name | Integer value | Description |
|---|---|---|
| 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. |
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.
### `DuplicationAttributeCheck` enum
| Enumerant name | Integer value | Description |
|---|---|---|
| SameTitle | 1 | Check if message has same title as some another messages. |
| SameUrl | 2 | Check if message has same URL as some another messages. |
| SameAuthor | 4 | Check if message has same author as some another messages. |
| SameDateCreated | 8 | Check if message has same date of creation as some another messages. |
| AllFeedsSameAccount | 16 | Perform the check across all feeds from your account, not just "current" feed. |
## Examples
Accept only messages from "Bob" while also marking them important.
```js
@ -129,7 +149,9 @@ The dialog is accessible from menu `Messages -> Message filters` and is the cent
* assign filter to whatever feeds (across all accounts) you want,
* rename filters and write their `JavaScript`-based scripts,
* reformat source code of script with `clang-format` tool (which is preinstalled on Windows version of RSS Guard),
* debug your script against sample `MessageObject` instance.
* debug your script against sample `MessageObject` instance,
* debug your script agains list of real messages of some feed (available in RSS Guard 3.8.4+),
* execute message filters manually against feeds (available in RSS Guard 3.8.4+).
## Performance
Note that evaluations of JavaScript expressions are NOT that fast. They are much slower than native `C++` code, but well-optimized scripts usually take only several milliseconds to finish for each message.

View file

@ -199,6 +199,6 @@ QList<Label*> MessageObject::availableLabels() const {
return m_availableLabels;
}
bool MessageObject::alreadyStored() const {
bool MessageObject::alreadyStoredInDb() const {
return m_message->m_id > 0;
}

View file

@ -22,7 +22,7 @@ class MessageObject : public QObject {
Q_PROPERTY(bool isRead READ isRead WRITE setIsRead)
Q_PROPERTY(bool isImportant READ isImportant WRITE setIsImportant)
Q_PROPERTY(bool isDeleted READ isDeleted WRITE setIsDeleted)
Q_PROPERTY(bool alreadyStored READ alreadyStored)
Q_PROPERTY(bool alreadyStoredInDb READ alreadyStoredInDb)
public:
enum class FilteringAction {
@ -82,7 +82,7 @@ class MessageObject : public QObject {
QList<Label*> assignedLabels() const;
QList<Label*> availableLabels() const;
bool alreadyStored() const;
bool alreadyStoredInDb() const;
// Generic Message's properties bindings.
QString feedCustomId() const;