Skip to content

Commit

Permalink
Mark what was backported to 68.7
Browse files Browse the repository at this point in the history
  • Loading branch information
darktrojan committed Apr 9, 2020
1 parent e03d858 commit 06e46fd
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 14 deletions.
26 changes: 23 additions & 3 deletions messages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Returns a `Promise`_ fulfilled with:

- :ref:`messages.MessageList`

.. note::

The permission ``accountsRead`` is required to use ``list``.

.. _messages.continueList:

continueList(messageListId)
Expand Down Expand Up @@ -80,6 +84,21 @@ Returns a `Promise`_ fulfilled with:

- :ref:`messages.MessagePart`

.. _messages.getRaw:

getRaw(messageId)
-----------------

*Added in Thunderbird 68.7*

Returns the unmodified source of a message.

- ``messageId`` (integer)

Returns a `Promise`_ fulfilled with:

- string

.. _messages.query:

query(queryInfo)
Expand All @@ -94,7 +113,7 @@ Gets all messages that have the specified properties, or all messages if no prop
- [``author``] (string) Returns only messages with this value matching the author.
- [``body``] (string) Returns only messages with this value in the body of the mail.
- [``flagged``] (boolean) Returns only flagged (or unflagged if false) messages.
- [``folder``] (:ref:`folders.MailFolder`) Returns only messages from the specified folder.
- [``folder``] (:ref:`folders.MailFolder`) Returns only messages from the specified folder. The ``accountsRead`` permission is required.
- [``fromDate``] (`Date <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date>`_) Returns only messages with a date after this value.
- [``fromMe``] (boolean) Returns only messages with the author matching any configured identity.
- [``fullText``] (string) Returns only messages with this value somewhere in the mail (subject, body or author).
Expand All @@ -119,6 +138,7 @@ Marks or unmarks a message as read, flagged, or tagged.
- ``newProperties`` (object)

- [``flagged``] (boolean) Marks the message as flagged or unflagged.
- [``junk``] (boolean) Marks the message as junk or not junk. *Added in Thunderbird 68.7*
- [``read``] (boolean) Marks the message as read or unread.
- [``tags``] (array of string) Sets the tags on the message. For a list of available tags, call the listTags method.

Expand All @@ -134,7 +154,7 @@ Moves messages to a specified folder.

.. note::

The permission ``messagesMove`` is required to use ``move``.
The permissions ``accountsRead`` and ``messagesMove`` are required to use ``move``.

.. _messages.copy:

Expand All @@ -148,7 +168,7 @@ Copies messages to a specified folder.

.. note::

The permission ``messagesMove`` is required to use ``copy``.
The permissions ``accountsRead`` and ``messagesMove`` are required to use ``copy``.

.. _messages.delete:

Expand Down
20 changes: 20 additions & 0 deletions overlay/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
"$ref": "MessagePart"
}
},
{
"name": "getRaw",
"added": "68.7",
"returns": {
"type": "string"
}
},
{
"name": "query",
"added": "68.2",
Expand All @@ -41,6 +48,19 @@
"$ref": "MessageTag"
}
}
},
{
"name": "update",
"parameters": [
{
"name": "newProperties",
"properties": {
"junk": {
"added": "68.7"
}
}
}
]
}
],
"types": [
Expand Down
37 changes: 26 additions & 11 deletions update-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def link_ref(ref):


def format_addition(obj):
if "changed" in obj:
return "*Changed in Thunderbird %s*" % obj["changed"]
if "backported" in obj:
return "*Added in Thunderbird %s, backported to %s*" % (obj["added"], obj["backported"])
return "*Added in Thunderbird %s*" % obj["added"]
Expand Down Expand Up @@ -124,7 +126,7 @@ def format_member(name, value):
if "description" in value:
parts.append(replace_code(value["description"]))

if "added" in value:
if "added" in value or "changed" in value:
parts.append(format_addition(value))

return " ".join(parts)
Expand Down Expand Up @@ -194,19 +196,32 @@ def format_permissions(obj):

lines = []
name = obj.get("namespace", obj.get("name"))
for permission in obj["permissions"]:
if len(obj["permissions"]) == 1:
permission = obj["permissions"][0]
if permission.startswith("manifest:"):
permission = permission[9:]
text = " A manifest entry named ``%s`` is required to use ``%s``."
text = " A manifest entry named ``%s`` is required to use ``%s``." % (permission, name)
else:
text = " The permission ``%s`` is required to use ``%s``."
lines.extend([
"",
".. note::",
"",
text % (permission, name),
"",
])
text = " The permission ``%s`` is required to use ``%s``." % (permission, name)
else:
permissions = ""
for i in range(0, len(obj["permissions"])):
permission = obj["permissions"][i]
if i > 0:
if i + 1 == len(obj["permissions"]):
permissions += " and "
else:
permissions += ", "
permissions += "``%s``" % permission
text = " The permissions %s are required to use ``%s``." % (permissions, name)

lines.extend([
"",
".. note::",
"",
text,
"",
])
return lines


Expand Down

0 comments on commit 06e46fd

Please sign in to comment.