diff options
26 files changed, 1274 insertions, 110 deletions
@@ -77,439 +77,670 @@ <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0004.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.11.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0009.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0012.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0013.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0016.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.7</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>The XEP is deprecated, we might remove support for it at some point.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0020.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.6</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0027.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.4</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0030.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.5rc3</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0033.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0045.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>partial</xmpp:status> + <xmpp:version>1.34.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0047.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0048.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>The XEP is deprecated, we might remove support for it at some point.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0049.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0050.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.3.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0054.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0059.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0060.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>partial</xmpp:status> + <xmpp:version>1.19.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0065.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.8.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0066.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.5</xmpp:version> + <xmpp:since>1.0</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0070.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0.1</xmpp:version> + <xmpp:since>1.2</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0071.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.5.4</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>This XEP is deprecated, but we have no plan to remove support for it.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0077.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.4</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0078.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.5</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>This XEP is obsolete, we are considering removing support for it.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0079.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0080.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.9</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0082.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0084.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1.4</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0085.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0086.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>The XEP is deprecated, we might remove support for it at some point.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0091.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.4</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>This XEP is obsolete, we are considering removing support for it.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0092.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0095.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>The XEP is deprecated, we might remove support for it at some point.</xmpp:note> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0096.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.3</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>The XEP is deprecated, we might remove support for it at some point.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0106.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0107.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0108.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.3</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0115.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.5.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0118.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.3.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0122.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0.2</xmpp:version> + <xmpp:since>1.1</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0128.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0131.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0133.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0138.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.0</xmpp:version> + <xmpp:since>1.1</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0152.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0153.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0163.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0172.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0184.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.4.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0186.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.14.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0191.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.3</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0196.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.3</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0198.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.6</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0199.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.0.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0202.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0203.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>2.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0221.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0222.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0223.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0224.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0231.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0235.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.7</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0242.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>This XEP is obsolete, we are considering removing support for it.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0249.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0256.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1</xmpp:version> + <xmpp:since>1.2</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0257.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.3</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0258.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0270.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>This XEP is obsolete, we are considering removing support for it.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0279.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0280.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.13.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0297.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0300.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0.0</xmpp:version> + <xmpp:since>1.3.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0302.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.1</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>This XEP is obsolete, we are considering removing support for it.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0308.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.2.0</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0313.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.7.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0319.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0.2</xmpp:version> + <xmpp:since>1.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0323.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.6</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>This XEP has been retracted, we are considering removing support for it.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0325.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.5</xmpp:version> + <xmpp:since>1.0</xmpp:since> + <xmpp:note>This XEP has been retracted, we are considering removing support for it.</xmpp:note> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0332.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.5.1</xmpp:version> + <xmpp:since>1.1</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0333.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.4</xmpp:version> + <xmpp:since>1.2</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0334.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.3.0</xmpp:version> + <xmpp:since>1.2</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0335.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.1.1</xmpp:version> + <xmpp:since>1.5.0</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0352.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>1.0.0</xmpp:version> + <xmpp:since>1.2</xmpp:since> </xmpp:SupportedXep> </implements> <implements> @@ -522,6 +753,14 @@ </implements> <implements> <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0359.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.6.1</xmpp:version> + <xmpp:since>NEXT</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0363.html"/> <xmpp:status>complete</xmpp:status> <xmpp:version>1.0.0</xmpp:version> @@ -531,54 +770,213 @@ <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0369.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>partial</xmpp:status> + <xmpp:version>0.14.6</xmpp:version> + <xmpp:since>NEXT</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0377.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.2</xmpp:version> + <xmpp:since>NEXT</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0380.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.3.0</xmpp:version> + <xmpp:since>1.3.0</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0394.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.2.1</xmpp:version> + <xmpp:since>1.3.0</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0403.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>partial</xmpp:status> + <xmpp:version>0.3.2</xmpp:version> + <xmpp:since>NEXT</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0404.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>partial</xmpp:status> + <xmpp:version>0.3.1</xmpp:version> + <xmpp:since>NEXT</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0405.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>partial</xmpp:status> + <xmpp:version>0.5.1</xmpp:version> + <xmpp:since>NEXT</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0421.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.1.0</xmpp:version> + <xmpp:since>NEXT</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0422.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.2.0</xmpp:version> + <xmpp:since>NEXT</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0424.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.3.0</xmpp:version> + <xmpp:since>NEXT</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0425.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.2.1</xmpp:version> + <xmpp:since>NEXT</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0428.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.1.1</xmpp:version> + <xmpp:since>NEXT</xmpp:since> + </xmpp:SupportedXep> + </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0439.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.1.0</xmpp:version> + <xmpp:since>NEXT</xmpp:since> </xmpp:SupportedXep> </implements> <implements> <xmpp:SupportedXep> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0444.html"/> - <xmpp:status>unknown</xmpp:status> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.1.0</xmpp:version> + <xmpp:since>NEXT</xmpp:since> </xmpp:SupportedXep> </implements> - <!-- Figure out releases. <release> <Version> - <revision>0.5</revision> - <created>2010-02-01</created> - <file-release rdf:resource="https://dev.louiz.org/attachments/29/poezio-0.5.tar.bz2"/> + <revision>1.0</revision> + <created>2015-07-31</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/e7/cc/d102dee9d4cf93e24ffcf6c43c3b50e2615c2ee4514e5fd160d96b9fe536/slixmpp-1.0.post5.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.1</revision> + <created>2015-10-02</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/2a/8a/cb032a938bf245decc88aec2f2e03401802766a1a97f9daf3bf7fee5b07f/slixmpp-1.1.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.2</revision> + <created>2016-10-02</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/c2/9f/1ac5304ab1801b08c20b07ee658583abdce9b7ae47ea3faf0d062e86221b/slixmpp-1.2.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.2.1</revision> + <created>2016-10-05</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/73/7e/072aca82a2f8e25a93ce8755553f36e82975e950f23a69dc10164a23f32f/slixmpp-1.2.1.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.2.2</revision> + <created>2016-11-21</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/8f/96/19c610e3b42baa140572bb3c79723902ae608bec8d3f0fa3cb187a5c12ba/slixmpp-1.2.2.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.2.3</revision> + <created>2016-12-07</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/91/af/4018e1fda624af97d4e8fb37ff2cf2744926c126285488c55a5ad1f755da/slixmpp-1.2.3.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.2.4</revision> + <created>2017-01-30</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/49/bb/092f0c07d6f7ac6922ceea57155c24561af7ee0736c15e7f833ab916c06e/slixmpp-1.2.4.post1.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.3.0</revision> + <created>2017-11-28</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/84/df/c0972daaca550d98b313e0029dc7158b1b10e120f510917a3d34b5b5f102/slixmpp-1.3.0.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.4.0</revision> + <created>2018-08-12</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/0a/50/76a06d929668252244a1cef515c48c21403a72988c20cab2f74ef0b4ecbd/slixmpp-1.4.0.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.4.1</revision> + <created>2018-10-28</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/c6/d3/ed986188026843e0b98de816ab8f4d91a61865db8d4a9162f10596f5431e/slixmpp-1.4.1.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.4.2</revision> + <created>2019-01-31</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/69/8f/1fa625d035af93bd3dd72589e33e3ff1954bdd37546bedc9246d048b0c93/slixmpp-1.4.2.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.5.0</revision> + <created>2020-05-01</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/35/6c/cda25435be70821def0013c3d41761ea42c11a0c4e33b8cbca0206a21381/slixmpp-1.5.0.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.5.1</revision> + <created>2020-05-02</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/2c/37/fbc95dd3632cbdb0d6dcc44e9df51b195fc7793e6beb2059f697dd458dd2/slixmpp-1.5.1.tar.gz"/> + </Version> + </release> + <release> + <Version> + <revision>1.5.2</revision> + <created>2020-05-23</created> + <file-release rdf:resource="https://files.pythonhosted.org/packages/ce/f1/b7cb0ba0b2f9950d3bd8e4d256502c39ac731136e1744c926f67e2c21131/slixmpp-1.5.2.tar.gz"/> </Version> </release> - --> </Project> </rdf:RDF> diff --git a/slixmpp/plugins/__init__.py b/slixmpp/plugins/__init__.py index f948ead6..f37fdcfb 100644 --- a/slixmpp/plugins/__init__.py +++ b/slixmpp/plugins/__init__.py @@ -16,14 +16,14 @@ __all__ = [ 'xep_0009', # Jabber-RPC 'xep_0012', # Last Activity 'xep_0013', # Flexible Offline Message Retrieval - 'xep_0016', # Privacy Lists +# 'xep_0016', # Privacy Lists. Don’t automatically load 'xep_0020', # Feature Negotiation 'xep_0027', # Current Jabber OpenPGP Usage 'xep_0030', # Service Discovery 'xep_0033', # Extended Stanza Addresses 'xep_0045', # Multi-User Chat (Client) 'xep_0047', # In-Band Bytestreams - 'xep_0048', # Bookmarks +# 'xep_0048', # Legacy Bookmarks. Don’t automatically load 'xep_0049', # Private XML Storage 'xep_0050', # Ad-hoc Commands 'xep_0054', # vcard-temp @@ -31,17 +31,20 @@ __all__ = [ 'xep_0060', # Pubsub (Client) 'xep_0065', # SOCKS5 Bytestreams 'xep_0066', # Out of Band Data + 'xep_0070', # Verifying HTTP Requests via XMPP 'xep_0071', # XHTML-IM 'xep_0077', # In-Band Registration -# 'xep_0078', # Non-SASL auth. Don't automatically load +# 'xep_0078', # Non-SASL auth. Don’t automatically load 'xep_0079', # Advanced Message Processing 'xep_0080', # User Location 'xep_0082', # XMPP Date and Time Profiles 'xep_0084', # User Avatar 'xep_0085', # Chat State Notifications 'xep_0086', # Legacy Error Codes - 'xep_0091', # Legacy Delayed Delivery +# 'xep_0091', # Legacy Delayed Delivery. Don’t automatically load 'xep_0092', # Software Version +# 'xep_0095', # Legacy Stream Initiation. Don’t automatically load +# 'xep_0096', # Legacy SI File Transfer. Don’t automatically load 'xep_0106', # JID Escaping 'xep_0107', # User Mood 'xep_0108', # User Activity @@ -51,6 +54,7 @@ __all__ = [ 'xep_0128', # Extended Service Discovery 'xep_0131', # Standard Headers and Internet Metadata 'xep_0133', # Service Administration +# 'xep_0138', # Stream Compression. Broken atm 'xep_0152', # Reachability Addresses 'xep_0153', # vCard-Based Avatars 'xep_0163', # Personal Eventing Protocol @@ -69,29 +73,42 @@ __all__ = [ 'xep_0224', # Attention 'xep_0231', # Bits of Binary 'xep_0235', # OAuth Over XMPP - 'xep_0242', # XMPP Client Compliance 2009 +# 'xep_0242', # XMPP Client Compliance 2009. Don’t automatically load 'xep_0249', # Direct MUC Invitations 'xep_0256', # Last Activity in Presence 'xep_0257', # Client Certificate Management for SASL EXTERNAL 'xep_0258', # Security Labels in XMPP - 'xep_0270', # XMPP Compliance Suites 2010 +# 'xep_0270', # XMPP Compliance Suites 2010. Don’t automatically load 'xep_0279', # Server IP Check 'xep_0280', # Message Carbons 'xep_0297', # Stanza Forwarding - 'xep_0302', # XMPP Compliance Suites 2012 + 'xep_0300', # Use of Cryptographic Hash Functions in XMPP +# 'xep_0302', # XMPP Compliance Suites 2012. Don’t automatically load 'xep_0308', # Last Message Correction 'xep_0313', # Message Archive Management 'xep_0319', # Last User Interaction in Presence - 'xep_0323', # IoT Systems Sensor Data - 'xep_0325', # IoT Systems Control +# 'xep_0323', # IoT Systems Sensor Data. Don’t automatically load +# 'xep_0325', # IoT Systems Control. Don’t automatically load 'xep_0332', # HTTP Over XMPP Transport + 'xep_0333', # Chat Markers + 'xep_0334', # Message Processing Hints + 'xep_0335', # JSON Containers + 'xep_0352', # Client State Indication 'xep_0353', # Jingle Message Initiation + 'xep_0359', # Unique and Stable Stanza IDs 'xep_0363', # HTTP File Upload 'xep_0369', # MIX-CORE 'xep_0377', # Spam reporting + 'xep_0380', # Explicit Message Encryption + 'xep_0394', # Message Markup 'xep_0403', # MIX-Presence 'xep_0404', # MIX-Anon 'xep_0405', # MIX-PAM 'xep_0421', # Anonymous unique occupant identifiers for MUCs + 'xep_0422', # Message Fastening + 'xep_0424', # Message Retraction + 'xep_0425', # Message Moderation + 'xep_0428', # Message Fallback + 'xep_0439', # Quick Response 'xep_0444', # Message Reactions ] diff --git a/slixmpp/plugins/xep_0300/hash.py b/slixmpp/plugins/xep_0300/hash.py index 6095671d..75252d0c 100644 --- a/slixmpp/plugins/xep_0300/hash.py +++ b/slixmpp/plugins/xep_0300/hash.py @@ -39,25 +39,22 @@ class XEP_0300(BasePlugin): 'sha-1': hashlib.sha1, 'sha-256': hashlib.sha256, 'sha-512': hashlib.sha512, - 'sha3-256': lambda: hashlib.sha3_256(), - 'sha3-512': lambda: hashlib.sha3_512(), + 'sha3-256': hashlib.sha3_256, + 'sha3-512': hashlib.sha3_512, 'BLAKE2b256': lambda: hashlib.blake2b(digest_size=32), 'BLAKE2b512': lambda: hashlib.blake2b(digest_size=64), } + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.enabled_hashes = [] + def plugin_init(self): namespace = 'urn:xmpp:hash-function-text-names:%s' - self.enabled_hashes = [] + self.enabled_hashes.clear() for algo in self._hashlib_function: if getattr(self, 'enable_' + algo, False): - # XXX: this is a hack for Python 3.5 or below, which - # don’t support sha3 or blake2b… - try: - self._hashlib_function[algo]() - except AttributeError: - log.warn('Algorithm %s unavailable, disabling.', algo) - else: - self.enabled_hashes.append(namespace % algo) + self.enabled_hashes.append(namespace % algo) def session_bind(self, jid): self.xmpp['xep_0030'].add_feature(Hash.namespace) @@ -68,6 +65,7 @@ class XEP_0300(BasePlugin): def plugin_end(self): for namespace in self.enabled_hashes: self.xmpp['xep_0030'].del_feature(namespace) + self.enabled_hashes.clear() self.xmpp['xep_0030'].del_feature(feature=Hash.namespace) diff --git a/slixmpp/plugins/xep_0352/csi.py b/slixmpp/plugins/xep_0352/csi.py index 93295b84..21bfe371 100644 --- a/slixmpp/plugins/xep_0352/csi.py +++ b/slixmpp/plugins/xep_0352/csi.py @@ -8,6 +8,7 @@ import logging +from slixmpp import ClientXMPP from slixmpp.stanza import StreamFeatures from slixmpp.xmlstream import register_stanza_plugin from slixmpp.plugins.base import BasePlugin @@ -40,17 +41,19 @@ class XEP_0352(BasePlugin): self.xmpp.register_stanza(stanza.Active) self.xmpp.register_stanza(stanza.Inactive) - self.xmpp.register_feature('csi', - self._handle_csi_feature, - restart=False, - order=self.order) + if isinstance(self.xmpp, ClientXMPP): + self.xmpp.register_feature('csi', + self._handle_csi_feature, + restart=False, + order=self.order) def plugin_end(self): if self.xmpp.is_component: return - self.xmpp.unregister_feature('csi', self.order) + if isinstance(self.xmpp, ClientXMPP): + self.xmpp.unregister_feature('csi', self.order) self.xmpp.remove_stanza(stanza.Active) self.xmpp.remove_stanza(stanza.Inactive) diff --git a/slixmpp/plugins/xep_0359/__init__.py b/slixmpp/plugins/xep_0359/__init__.py new file mode 100644 index 00000000..dd01ea1e --- /dev/null +++ b/slixmpp/plugins/xep_0359/__init__.py @@ -0,0 +1,13 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" + +from slixmpp.plugins.base import register_plugin +from slixmpp.plugins.xep_0359.stanza import * +from slixmpp.plugins.xep_0359.stanzaid import XEP_0359 + +register_plugin(XEP_0359) diff --git a/slixmpp/plugins/xep_0359/stanza.py b/slixmpp/plugins/xep_0359/stanza.py new file mode 100644 index 00000000..db8e9fff --- /dev/null +++ b/slixmpp/plugins/xep_0359/stanza.py @@ -0,0 +1,35 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permissio +""" + +from slixmpp.stanza import Message +from slixmpp.xmlstream import ( + ElementBase, + register_stanza_plugin, +) + + +NS = 'urn:xmpp:sid:0' + + +class StanzaID(ElementBase): + namespace = NS + name = 'stanza-id' + plugin_attrib = 'stanza_id' + interfaces = {'id', 'by'} + + +class OriginID(ElementBase): + namespace = NS + name = 'origin-id' + plugin_attrib = 'origin_id' + interfaces = {'id'} + + +def register_plugins(): + register_stanza_plugin(Message, StanzaID) + register_stanza_plugin(Message, OriginID) diff --git a/slixmpp/plugins/xep_0359/stanzaid.py b/slixmpp/plugins/xep_0359/stanzaid.py new file mode 100644 index 00000000..2235e74b --- /dev/null +++ b/slixmpp/plugins/xep_0359/stanzaid.py @@ -0,0 +1,22 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" +from slixmpp.plugins import BasePlugin +from slixmpp.plugins.xep_0359 import stanza + + +class XEP_0359(BasePlugin): + '''XEP-0359: Unique and Stable Stanza IDs''' + + name = 'xep_0359' + description = 'Unique and Stable Stanza IDs' + dependencies = set() + stanza = stanza + namespace = stanza.NS + + def plugin_init(self) -> None: + stanza.register_plugins() diff --git a/slixmpp/plugins/xep_0422/__init__.py b/slixmpp/plugins/xep_0422/__init__.py new file mode 100644 index 00000000..9a1575c1 --- /dev/null +++ b/slixmpp/plugins/xep_0422/__init__.py @@ -0,0 +1,13 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" + +from slixmpp.plugins.base import register_plugin +from slixmpp.plugins.xep_0422.stanza import * +from slixmpp.plugins.xep_0422.fastening import XEP_0422 + +register_plugin(XEP_0422) diff --git a/slixmpp/plugins/xep_0422/fastening.py b/slixmpp/plugins/xep_0422/fastening.py new file mode 100644 index 00000000..68560e16 --- /dev/null +++ b/slixmpp/plugins/xep_0422/fastening.py @@ -0,0 +1,28 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" +from slixmpp.plugins import BasePlugin +from slixmpp.plugins.xep_0422 import stanza + + +class XEP_0422(BasePlugin): + '''XEP-0422: Message Fastening''' + + name = 'xep_0422' + description = 'Message Fastening' + dependencies = {'xep_0030'} + stanza = stanza + namespace = stanza.NS + + def plugin_init(self) -> None: + stanza.register_plugins() + + def session_bind(self, jid): + self.xmpp.plugin['xep_0030'].add_feature(feature=stanza.NS) + + def plugin_end(self): + self.xmpp.plugin['xep_0030'].del_feature(feature=stanza.NS) diff --git a/slixmpp/plugins/xep_0422/stanza.py b/slixmpp/plugins/xep_0422/stanza.py new file mode 100644 index 00000000..a739809e --- /dev/null +++ b/slixmpp/plugins/xep_0422/stanza.py @@ -0,0 +1,42 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permissio +""" + +from slixmpp.stanza import Message +from slixmpp.xmlstream import ( + ElementBase, + register_stanza_plugin, +) + + +NS = 'urn:xmpp:fasten:0' + + +class ApplyTo(ElementBase): + namespace = NS + name = 'apply-to' + plugin_attrib = 'apply_to' + interfaces = {'id', 'shell'} + + def set_shell(self, value: bool): + if value: + self.xml.attrib['shell'] = str(value).lower() + else: + if 'shell' in self.xml.attrib: + del self.xml.attrib['shell'] + + +class External(ElementBase): + namespace = NS + name = 'external' + plugin_attrib = 'external' + interfaces = {'name'} + + +def register_plugins(): + register_stanza_plugin(Message, ApplyTo) + register_stanza_plugin(ApplyTo, External) diff --git a/slixmpp/plugins/xep_0424/__init__.py b/slixmpp/plugins/xep_0424/__init__.py new file mode 100644 index 00000000..0e5dfce1 --- /dev/null +++ b/slixmpp/plugins/xep_0424/__init__.py @@ -0,0 +1,13 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" + +from slixmpp.plugins.base import register_plugin +from slixmpp.plugins.xep_0424.stanza import * +from slixmpp.plugins.xep_0424.retraction import XEP_0424 + +register_plugin(XEP_0424) diff --git a/slixmpp/plugins/xep_0424/retraction.py b/slixmpp/plugins/xep_0424/retraction.py new file mode 100644 index 00000000..5425a61f --- /dev/null +++ b/slixmpp/plugins/xep_0424/retraction.py @@ -0,0 +1,62 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" +from typing import Optional + +from slixmpp import JID, Message +from slixmpp.exceptions import IqError, IqTimeout +from slixmpp.plugins import BasePlugin +from slixmpp.plugins.xep_0424 import stanza + + +DEFAULT_FALLBACK = ( + 'This person attempted to retract a previous message, but your client ' + 'does not support it.' +) + + +class XEP_0424(BasePlugin): + '''XEP-0424: Message Retraction''' + + name = 'xep_0424' + description = 'Message Retraction' + dependencies = {'xep_0422', 'xep_0030', 'xep_0359', 'xep_0428', 'xep_0334'} + stanza = stanza + namespace = stanza.NS + + def plugin_init(self) -> None: + stanza.register_plugins() + + def session_bind(self, jid): + self.xmpp.plugin['xep_0030'].add_feature(feature=stanza.NS) + + def plugin_end(self): + self.xmpp.plugin['xep_0030'].del_feature(feature=stanza.NS) + + def send_retraction(self, mto: JID, id: str, mtype: str = 'chat', + include_fallback: bool = True, + fallback_text: Optional[str] = None, *, + mfrom: Optional[JID] = None): + """ + Send a message retraction + :param JID mto: The JID to retract the message from + :param str id: Message ID to retract + :param str mtype: Message type + :param bool include_fallback: Whether to include a fallback body + :param Optional[str] fallback_text: The contet of the fallback + body. None will set the default value. + """ + if fallback_text is None: + fallback_text = DEFAULT_FALLBACK + msg = self.xmpp.make_message(mto=mto, mtype=mtype, mfrom=mfrom) + if include_fallback: + msg['body'] = fallback_text + msg.enable('fallback') + msg['apply_to']['id'] = id + msg['apply_to'].enable('retract') + msg.enable('store') + msg.send() diff --git a/slixmpp/plugins/xep_0424/stanza.py b/slixmpp/plugins/xep_0424/stanza.py new file mode 100644 index 00000000..c55af08c --- /dev/null +++ b/slixmpp/plugins/xep_0424/stanza.py @@ -0,0 +1,38 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permissio +""" + +from slixmpp.stanza import Message +from slixmpp.xmlstream import ( + ElementBase, + register_stanza_plugin, +) +from slixmpp.plugins.xep_0422.stanza import ApplyTo +from slixmpp.plugins.xep_0359 import OriginID + + +NS = 'urn:xmpp:message-retract:0' + + +class Retract(ElementBase): + namespace = NS + name = 'retract' + plugin_attrib = 'retract' + + +class Retracted(ElementBase): + namespace = NS + name = 'retracted' + plugin_attrib = 'retracted' + interfaces = {'stamp'} + + +def register_plugins(): + register_stanza_plugin(ApplyTo, Retract) + register_stanza_plugin(Message, Retracted) + + register_stanza_plugin(Retracted, OriginID) diff --git a/slixmpp/plugins/xep_0425/__init__.py b/slixmpp/plugins/xep_0425/__init__.py new file mode 100644 index 00000000..2effe361 --- /dev/null +++ b/slixmpp/plugins/xep_0425/__init__.py @@ -0,0 +1,13 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" + +from slixmpp.plugins.base import register_plugin +from slixmpp.plugins.xep_0425.stanza import * +from slixmpp.plugins.xep_0425.moderation import XEP_0425 + +register_plugin(XEP_0425) diff --git a/slixmpp/plugins/xep_0425/moderation.py b/slixmpp/plugins/xep_0425/moderation.py new file mode 100644 index 00000000..e840d80d --- /dev/null +++ b/slixmpp/plugins/xep_0425/moderation.py @@ -0,0 +1,39 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" +from typing import Optional + +from slixmpp import JID, Message +from slixmpp.exceptions import IqError, IqTimeout +from slixmpp.plugins import BasePlugin +from slixmpp.plugins.xep_0425 import stanza + + +class XEP_0425(BasePlugin): + '''XEP-0425: Message Moderation''' + + name = 'xep_0425' + description = 'Message Moderation' + dependencies = {'xep_0424', 'xep_0421'} + stanza = stanza + namespace = stanza.NS + + def plugin_init(self) -> None: + stanza.register_plugins() + + def session_bind(self, jid): + self.xmpp.plugin['xep_0030'].add_feature(feature=stanza.NS) + + def plugin_end(self): + self.xmpp.plugin['xep_0030'].del_feature(feature=stanza.NS) + + async def moderate(self, room: JID, id: str, reason: str = '', *, + ifrom: Optional[JID] = None, **iqkwargs): + iq = self.xmpp.make_iq_set(ito=room.bare, ifrom=ifrom) + iq['apply_to']['id'] = id + iq['apply_to']['moderate']['reason'] = reason + await iq.send(**iqkwargs) diff --git a/slixmpp/plugins/xep_0425/stanza.py b/slixmpp/plugins/xep_0425/stanza.py new file mode 100644 index 00000000..9b756953 --- /dev/null +++ b/slixmpp/plugins/xep_0425/stanza.py @@ -0,0 +1,46 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permissio +""" + +from slixmpp.stanza import Message, Iq +from slixmpp.xmlstream import ( + ElementBase, + register_stanza_plugin, +) +from slixmpp.plugins.xep_0422.stanza import ApplyTo +from slixmpp.plugins.xep_0421.stanza import OccupantId +from slixmpp.plugins.xep_0424.stanza import Retract, Retracted + + +NS = 'urn:xmpp:message-moderate:0' + + +class Moderate(ElementBase): + namespace = NS + name = 'moderate' + plugin_attrib = 'moderate' + interfaces = {'reason'} + sub_interfaces = {'reason'} + + +class Moderated(ElementBase): + namespace = NS + name = 'moderated' + plugin_attrib = 'moderated' + interfaces = {'reason', 'by'} + sub_interfaces = {'reason'} + + +def register_plugins(): + register_stanza_plugin(Iq, ApplyTo) + register_stanza_plugin(ApplyTo, Moderate) + register_stanza_plugin(Moderate, Retract) + + register_stanza_plugin(Message, Moderated) + register_stanza_plugin(ApplyTo, Moderated) + register_stanza_plugin(Moderated, Retracted) + register_stanza_plugin(Moderated, OccupantId) diff --git a/slixmpp/plugins/xep_0428/__init__.py b/slixmpp/plugins/xep_0428/__init__.py new file mode 100644 index 00000000..864f4ed3 --- /dev/null +++ b/slixmpp/plugins/xep_0428/__init__.py @@ -0,0 +1,13 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" + +from slixmpp.plugins.base import register_plugin +from slixmpp.plugins.xep_0428.stanza import * +from slixmpp.plugins.xep_0428.fallback import XEP_0428 + +register_plugin(XEP_0428) diff --git a/slixmpp/plugins/xep_0428/fallback.py b/slixmpp/plugins/xep_0428/fallback.py new file mode 100644 index 00000000..61e913e3 --- /dev/null +++ b/slixmpp/plugins/xep_0428/fallback.py @@ -0,0 +1,22 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" +from slixmpp.plugins import BasePlugin +from slixmpp.plugins.xep_0428 import stanza + + +class XEP_0428(BasePlugin): + '''XEP-0428: Fallback Indication''' + + name = 'xep_0428' + description = 'Fallback Indication' + dependencies = set() + stanza = stanza + namespace = stanza.NS + + def plugin_init(self) -> None: + stanza.register_plugins() diff --git a/slixmpp/plugins/xep_0428/stanza.py b/slixmpp/plugins/xep_0428/stanza.py new file mode 100644 index 00000000..41df80d0 --- /dev/null +++ b/slixmpp/plugins/xep_0428/stanza.py @@ -0,0 +1,26 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permissio +""" + +from slixmpp.stanza import Message +from slixmpp.xmlstream import ( + ElementBase, + register_stanza_plugin, +) + + +NS = 'urn:xmpp:fallback:0' + + +class Fallback(ElementBase): + namespace = NS + name = 'fallback' + plugin_attrib = 'fallback' + + +def register_plugins(): + register_stanza_plugin(Message, Fallback) diff --git a/slixmpp/plugins/xep_0439/__init__.py b/slixmpp/plugins/xep_0439/__init__.py new file mode 100644 index 00000000..6fa46cb4 --- /dev/null +++ b/slixmpp/plugins/xep_0439/__init__.py @@ -0,0 +1,13 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" + +from slixmpp.plugins.base import register_plugin +from slixmpp.plugins.xep_0439.stanza import * +from slixmpp.plugins.xep_0439.quickresponse import XEP_0439 + +register_plugin(XEP_0439) diff --git a/slixmpp/plugins/xep_0439/quickresponse.py b/slixmpp/plugins/xep_0439/quickresponse.py new file mode 100644 index 00000000..74e299d6 --- /dev/null +++ b/slixmpp/plugins/xep_0439/quickresponse.py @@ -0,0 +1,91 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permission. +""" +from typing import ( + Iterable, + Optional, + Tuple, +) + +from slixmpp import JID +from slixmpp.plugins import BasePlugin +from slixmpp.plugins.xep_0439 import stanza + + +class XEP_0439(BasePlugin): + '''XEP-0439: Quick Response''' + + name = 'xep_0439' + description = 'Quick Response' + dependencies = set() + stanza = stanza + namespace = stanza.NS + + def plugin_init(self) -> None: + stanza.register_plugins() + + def ask_for_responses(self, mto: JID, body: str, + responses: Iterable[Tuple[str, str]], + mtype: str = 'chat', lang: Optional[str] = None, *, + mfrom: Optional[JID] = None): + """ + Send a message with a set of responses. + + :param JID mto: The JID of the entity which will receive the message + :param str body: The message body of the question + :param Iterable[Tuple[str, str]] responses: A set of tuples containing + (value, label) for each response + :param str mtype: The message type + :param str lang: The lang of the message (if not use, the default + for this session will be used. + """ + if lang is None: + lang = self.xmpp.default_lang + msg = self.xmpp.make_message(mto=mto, mfrom=mfrom, mtype=mtype) + msg['body|%s' % lang] = body + values = set() + for value, label in responses: + if value in values: + raise ValueError("Duplicate values") + values.add(value) + elem = stanza.Response() + elem['lang'] = lang + elem['value'] = value + elem['label'] = label + msg.append(elem) + msg.send() + + def ask_for_actions(self, mto: JID, body: str, + actions: Iterable[Tuple[str, str]], + mtype: str = 'chat', lang: Optional[str] = None, *, + mfrom: Optional[JID] = None): + """ + Send a message with a set of actions. + + :param JID mto: The JID of the entity which will receive the message + :param str body: The message body of the question + :param Iterable[Tuple[str, str]] actions: A set of tuples containing + (action, label) for each action + :param str mtype: The message type + :param str lang: The lang of the message (if not use, the default + for this session will be used. + """ + if lang is None: + lang = self.xmpp.default_lang + msg = self.xmpp.make_message(mto=mto, mfrom=mfrom, mtype=mtype) + msg['body|%s' % lang] = body + ids = set() + for id, label in actions: + if id in ids: + raise ValueError("Duplicate ids") + ids.add(id) + elem = stanza.Action() + elem['lang'] = lang + elem['id'] = id + elem['label'] = label + msg.append(elem) + msg.send() diff --git a/slixmpp/plugins/xep_0439/stanza.py b/slixmpp/plugins/xep_0439/stanza.py new file mode 100644 index 00000000..e00e1f27 --- /dev/null +++ b/slixmpp/plugins/xep_0439/stanza.py @@ -0,0 +1,43 @@ +""" + Slixmpp: The Slick XMPP Library + Copyright (C) 2020 Mathieu Pasquet <mathieui@mathieui.net> + This file is part of Slixmpp. + + See the file LICENSE for copying permissio +""" + +from slixmpp.stanza import Message +from slixmpp.xmlstream import ( + ElementBase, + register_stanza_plugin, +) + + +NS = 'urn:xmpp:tmp:quick-response' + + +class Response(ElementBase): + namespace = NS + name = 'response' + plugin_attrib = 'response' + interfaces = {'value', 'label'} + + +class Action(ElementBase): + namespace = NS + name = 'action' + plugin_attrib = 'action' + interfaces = {'id', 'label'} + + +class ActionSelected(ElementBase): + namespace = NS + name = 'action-selected' + plugin_attrib = 'action_selected' + interfaces = {'id'} + + +def register_plugins(): + register_stanza_plugin(Message, Action, iterable=True) + register_stanza_plugin(Message, ActionSelected) + register_stanza_plugin(Message, Response, iterable=True) diff --git a/tests/test_stanza_xep_0422.py b/tests/test_stanza_xep_0422.py new file mode 100644 index 00000000..9d2cc396 --- /dev/null +++ b/tests/test_stanza_xep_0422.py @@ -0,0 +1,33 @@ +import unittest +from slixmpp import Message +from slixmpp.test import SlixTest +from slixmpp.xmlstream import ET +from slixmpp.plugins.xep_0422 import stanza + + +class TestFastening(SlixTest): + + def setUp(self): + stanza.register_plugins() + + def testFastenExternal(self): + message = Message() + message['apply_to']['id'] = 'some-id' + message['apply_to'].xml.append( + ET.fromstring('<test xmlns="urn:tmp:test">Test</test>') + ) + message['apply_to']['external']['name'] = 'body' + message['body'] = 'Toto' + + self.check(message, """ +<message> + <apply-to xmlns="urn:xmpp:fasten:0" id="some-id"> + <test xmlns="urn:tmp:test">Test</test> + <external name='body'/> + </apply-to> + <body>Toto</body> +</message> + """, use_values=False) + + +suite = unittest.TestLoader().loadTestsFromTestCase(TestFastening) diff --git a/tests/test_stanza_xep_0424.py b/tests/test_stanza_xep_0424.py new file mode 100644 index 00000000..c94ed79b --- /dev/null +++ b/tests/test_stanza_xep_0424.py @@ -0,0 +1,39 @@ +import unittest +from slixmpp import Message +from slixmpp.test import SlixTest +from slixmpp.plugins.xep_0424 import stanza + + +class TestRetraction(SlixTest): + + def setUp(self): + stanza.register_plugins() + + def testRetract(self): + message = Message() + message['apply_to']['id'] = 'some-id' + message['apply_to']['retract'] + + self.check(message, """ +<message> + <apply-to xmlns="urn:xmpp:fasten:0" id="some-id"> + <retract xmlns="urn:xmpp:message-retract:0"/> + </apply-to> +</message> + """, use_values=False) + + def testRetracted(self): + message = Message() + message['retracted']['stamp'] = '2019-09-20T23:09:32Z' + message['retracted']['origin_id']['id'] = 'originid' + + self.check(message, """ +<message> + <retracted stamp="2019-09-20T23:09:32Z" xmlns="urn:xmpp:message-retract:0"> + <origin-id xmlns="urn:xmpp:sid:0" id="originid"/> + </retracted> +</message> + """) + + +suite = unittest.TestLoader().loadTestsFromTestCase(TestRetraction) diff --git a/tests/test_stanza_xep_0425.py b/tests/test_stanza_xep_0425.py new file mode 100644 index 00000000..96d979e8 --- /dev/null +++ b/tests/test_stanza_xep_0425.py @@ -0,0 +1,47 @@ +import unittest +from slixmpp import Message, Iq, JID +from slixmpp.test import SlixTest +from slixmpp.plugins.xep_0425 import stanza + + +class TestModeration(SlixTest): + + def setUp(self): + stanza.register_plugins() + + def testModerate(self): + iq = Iq() + iq['type'] = 'set' + iq['id'] = 'a' + iq['apply_to']['id'] = 'some-id' + iq['apply_to']['moderate'].enable('retract') + iq['apply_to']['moderate']['reason'] = 'R' + + self.check(iq, """ +<iq type='set' id='a'> + <apply-to id="some-id" xmlns="urn:xmpp:fasten:0"> + <moderate xmlns='urn:xmpp:message-moderate:0'> + <retract xmlns='urn:xmpp:message-retract:0'/> + <reason>R</reason> + </moderate> + </apply-to> +</iq> + """, use_values=False) + + def testModerated(self): + message = Message() + message['moderated']['by'] = JID('toto@titi') + message['moderated']['retracted']['stamp'] = '2019-09-20T23:09:32Z' + message['moderated']['reason'] = 'R' + + self.check(message, """ +<message> + <moderated xmlns="urn:xmpp:message-moderate:0" by="toto@titi"> + <retracted stamp="2019-09-20T23:09:32Z" xmlns="urn:xmpp:message-retract:0" /> + <reason>R</reason> + </moderated> +</message> + """) + + +suite = unittest.TestLoader().loadTestsFromTestCase(TestModeration) diff --git a/tests/test_stanza_xep_0439.py b/tests/test_stanza_xep_0439.py new file mode 100644 index 00000000..fbd3aa47 --- /dev/null +++ b/tests/test_stanza_xep_0439.py @@ -0,0 +1,57 @@ +import unittest +from slixmpp import Message +from slixmpp.test import SlixTest +from slixmpp.plugins.xep_0439 import stanza + + +class TestQuickResponse(SlixTest): + + def setUp(self): + stanza.register_plugins() + + def testResponse(self): + message = Message() + message['body'] = 'Reply 1 or 2?' + for (value, label) in [('1', 'Rep 1'), ('2', 'Rep 2')]: + rep = stanza.Response() + rep['value'] = value + rep['label'] = label + message.append(rep) + + self.check(message, """ +<message> + <body>Reply 1 or 2?</body> + <response xmlns="urn:xmpp:tmp:quick-response" value="1" label="Rep 1" /> + <response xmlns="urn:xmpp:tmp:quick-response" value="2" label="Rep 2" /> +</message> + """, use_values=False) + + def testAction(self): + message = Message() + message['body'] = 'action 1 or 2?' + for (id_, label) in [('1', 'action 1'), ('2', 'action 2')]: + act = stanza.Action() + act['id'] = id_ + act['label'] = label + message.append(act) + + self.check(message, """ +<message> + <body>action 1 or 2?</body> + <action xmlns="urn:xmpp:tmp:quick-response" id="1" label="action 1" /> + <action xmlns="urn:xmpp:tmp:quick-response" id="2" label="action 2" /> +</message> + """, use_values=False) + + def testActionSelected(self): + message = Message() + message['action_selected']['id'] = 'act1' + + self.check(message, """ +<message> + <action-selected xmlns="urn:xmpp:tmp:quick-response" id="act1" /> +</message> + """, use_values=False) + + +suite = unittest.TestLoader().loadTestsFromTestCase(TestQuickResponse) |