Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-nbxmpp for openSUSE:Factory checked in at 2023-02-07 18:49:27 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-nbxmpp (Old) and /work/SRC/openSUSE:Factory/.python-nbxmpp.new.4462 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-nbxmpp" Tue Feb 7 18:49:27 2023 rev:40 rq:1063533 version:4.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-nbxmpp/python-nbxmpp.changes 2023-01-24 20:32:19.540372981 +0100 +++ /work/SRC/openSUSE:Factory/.python-nbxmpp.new.4462/python-nbxmpp.changes 2023-02-07 18:49:35.807296687 +0100 @@ -1,0 +2,8 @@ +Sun Feb 5 21:37:26 UTC 2023 - Alexei Sorokin <sor.ale...@meowr.ru> + +- Update to version 4.2.0: + * Add support for XEP-0461: Message Replies. + * Add SASLprep profile. + * Require PyGObject 3.42.0. + +------------------------------------------------------------------- Old: ---- python-nbxmpp-4.1.0.tar.bz2 New: ---- python-nbxmpp-4.2.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-nbxmpp.spec ++++++ --- /var/tmp/diff_new_pack.JLipCP/_old 2023-02-07 18:49:36.535300599 +0100 +++ /var/tmp/diff_new_pack.JLipCP/_new 2023-02-07 18:49:36.539300621 +0100 @@ -24,7 +24,7 @@ %endif %define _name nbxmpp Name: python-nbxmpp -Version: 4.1.0 +Version: 4.2.0 Release: 0 Summary: XMPP library by Gajim team License: GPL-3.0-or-later @@ -33,8 +33,8 @@ Source: %{url}/-/archive/%{version}/python-nbxmpp-%{version}.tar.bz2 BuildRequires: %{python_module setuptools >= 65.0} BuildRequires: fdupes -BuildRequires: python-rpm-generators >= 20200714 -BuildRequires: python-rpm-macros >= 20200714 +BuildRequires: python-rpm-generators >= 20220912 +BuildRequires: python-rpm-macros >= 20220912 # For testing BuildRequires: %{python_module gobject-Gdk >= 3.42} BuildRequires: %{python_module idna} ++++++ python-nbxmpp-4.1.0.tar.bz2 -> python-nbxmpp-4.2.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/.gitlab-ci.yml new/python-nbxmpp-4.2.0/.gitlab-ci.yml --- old/python-nbxmpp-4.1.0/.gitlab-ci.yml 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/.gitlab-ci.yml 2023-02-05 17:23:56.000000000 +0100 @@ -54,7 +54,11 @@ - build-unix rules: - if: '$NIGHTLY_BUILD' + allow_failure: + exit_codes: + - 100 script: + - release-helper nightly-check - > release-helper deploy-to-ftp \ --host=$FTP_HOST \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/ChangeLog new/python-nbxmpp-4.2.0/ChangeLog --- old/python-nbxmpp-4.1.0/ChangeLog 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/ChangeLog 2023-02-05 17:23:56.000000000 +0100 @@ -1,3 +1,17 @@ +nbxmpp 4.2.0 (05 Feb 2023) + + New + + * Add support for XEP-0461: Message Replies + + Improvements + + * Add SASLprep profile + + Change + + * Require PyGObject 3.42.0 + nbxmpp 4.1.0 (24 Jan 2023) Change diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/README.md new/python-nbxmpp-4.2.0/README.md --- old/python-nbxmpp-4.1.0/README.md 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/README.md 2023-02-05 17:23:56.000000000 +0100 @@ -8,7 +8,7 @@ - [PyGObject](https://pypi.org/project/PyGObject/) (>=3.42.0) - [GLib](https://gitlab.com/gnome/glib) (>=2.60.0) - [libsoup3](https://libsoup.org/) -- [precis-i18n](https://pypi.org/project/precis-i18n/) +- [precis-i18n](https://pypi.org/project/precis-i18n/) (>=1.0.0) - [packaging](https://pypi.org/project/packaging/) - [idna](https://pypi.org/project/idna/) @@ -18,16 +18,11 @@ ## Build Requirements -- [setuptools](https://pypi.org/project/setuptools/) +- [setuptools](https://pypi.org/project/setuptools/) (>=65.0.0) ## Features -* List of [supported XEPs](https://dev.gajim.org/gajim/python-nbxmpp/-/wikis/Supported-XEPs-in-python-nbxmpp/) - -## Starting Points - -* [Downloads](https://dev.gajim.org/gajim/python-nbxmpp/tags) -* You can also clone the [git repository](https://dev.gajim.org/gajim/python-nbxmpp.git) +* List of [supported XEPs](https://xmpp.org/software/libraries/python-nbxmpp/) ### Setup @@ -45,4 +40,4 @@ To use python-nbxmpp, `import nbxmpp` in your application. -or use the example client `python3 -m nbxmpp.examples.client` +To see an example check out [nbxmpp-client](https://pypi.org/project/nbxmpp-client/) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/debian/control new/python-nbxmpp-4.2.0/debian/control --- old/python-nbxmpp-4.1.0/debian/control 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/debian/control 2023-02-05 17:23:56.000000000 +0100 @@ -7,10 +7,10 @@ dh-python, gir1.2-soup-3.0, python3-all, - python3-gi, + python3-gi (>=3.42.0), python3-idna, python3-packaging, - python3-precis-i18n, + python3-precis-i18n (>=1.0.0), python3-setuptools (>= 65.0.0), Standards-Version: 4.1.4 Rules-Requires-Root: no @@ -23,7 +23,7 @@ Depends: ${misc:Depends}, ${python3:Depends}, gir1.2-soup-3.0, - python3-gi, + python3-gi (>=3.42.0), Recommends: python3-gssapi, Breaks: gajim (<< 1.6~) Conflicts: python3-nbxmpp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/nbxmpp/__init__.py new/python-nbxmpp-4.2.0/nbxmpp/__init__.py --- old/python-nbxmpp-4.1.0/nbxmpp/__init__.py 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/nbxmpp/__init__.py 2023-02-05 17:23:56.000000000 +0100 @@ -3,4 +3,4 @@ from .protocol import * # pylint: disable=wrong-import-position -__version__: str = '4.1.0' +__version__: str = '4.2.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/nbxmpp/dispatcher.py new/python-nbxmpp-4.2.0/nbxmpp/dispatcher.py --- old/python-nbxmpp-4.1.0/nbxmpp/dispatcher.py 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/nbxmpp/dispatcher.py 2023-02-05 17:23:56.000000000 +0100 @@ -72,6 +72,7 @@ from nbxmpp.modules.receipts import Receipts from nbxmpp.modules.oob import OOB from nbxmpp.modules.correction import Correction +from nbxmpp.modules.replies import Replies from nbxmpp.modules.attention import Attention from nbxmpp.modules.security_labels import SecurityLabels from nbxmpp.modules.chatstates import Chatstates @@ -185,6 +186,7 @@ self._modules['Discovery'] = Discovery(self._client) self._modules['ChatMarkers'] = ChatMarkers(self._client) self._modules['Receipts'] = Receipts(self._client) + self._modules['Replies'] = Replies(self._client) self._modules['OOB'] = OOB(self._client) self._modules['Correction'] = Correction(self._client) self._modules['Attention'] = Attention(self._client) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/nbxmpp/modules/replies.py new/python-nbxmpp-4.2.0/nbxmpp/modules/replies.py --- old/python-nbxmpp-4.1.0/nbxmpp/modules/replies.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-nbxmpp-4.2.0/nbxmpp/modules/replies.py 2023-02-05 17:23:56.000000000 +0100 @@ -0,0 +1,98 @@ +# This file is part of nbxmpp. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 3 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; If not, see <http://www.gnu.org/licenses/>. + +# XEP-0461: Message Replies + +from __future__ import annotations + +from typing import Optional +from typing import TYPE_CHECKING + +from nbxmpp.modules.base import BaseModule +from nbxmpp.namespaces import Namespace +from nbxmpp.protocol import Message +from nbxmpp.structs import MessageProperties +from nbxmpp.structs import ReplyData +from nbxmpp.structs import StanzaHandler + +if TYPE_CHECKING: + from nbxmpp.client import Client + + +class Replies(BaseModule): + def __init__(self, client: Client) -> None: + BaseModule.__init__(self, client) + + self._client = client + self.handlers = [ + StanzaHandler(name='message', + callback=self._process_message, + ns=Namespace.REPLY, + priority=15) + ] + + def _process_message(self, + _client: Client, + stanza: Message, + properties: MessageProperties + ) -> None: + + reply = stanza.getTag('reply', namespace=Namespace.REPLY) + if reply is None: + return + + reply_to = reply.getAttr('to') + if reply_to is None: + self._log.warning('Received reply without "to" attribute') + return + + reply_to_id = reply.getAttr('id') + if reply_to_id is None: + self._log.warning('Received reply without "id"') + return + + fallback_start, fallback_end = None, None + fallback_data = self._get_fallback_data(stanza) + if fallback_data is not None: + fallback_start, fallback_end = fallback_data + + properties.reply_data = ReplyData( + to=reply_to, + id=reply_to_id, + fallback_start=fallback_start, + fallback_end=fallback_end) + + def _get_fallback_data(self, stanza: Message) -> Optional[tuple[int, int]]: + fallback = stanza.getTag('fallback', namespace=Namespace.FALLBACK) + if fallback is None or fallback.getAttr('for') != Namespace.REPLY: + return None + + fallback_data = fallback.getTag('body') + if fallback_data is None: + return None + + start = fallback_data.getAttr('start') + end = fallback_data.getAttr('end') + if start is None or end is None: + return None + + try: + start = int(start) + end = int(end) + except ValueError: + self._log.warning('Could not get fallback start/end') + return None + + return start, end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/nbxmpp/namespaces.py new/python-nbxmpp-4.2.0/nbxmpp/namespaces.py --- old/python-nbxmpp-4.1.0/nbxmpp/namespaces.py 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/nbxmpp/namespaces.py 2023-02-05 17:23:56.000000000 +0100 @@ -62,6 +62,7 @@ DOMAIN_BASED_NAME: str = 'urn:xmpp:domain-based-name:1' EME: str = 'urn:xmpp:eme:0' ENCRYPTED: str = 'jabber:x:encrypted' + FALLBACK: str = 'urn:xmpp:fallback:0' FASTEN: str = 'urn:xmpp:fasten:0' FILE_METADATA: str = 'urn:xmpp:file:metadata:0' FORWARD: str = 'urn:xmpp:forward:0' @@ -138,6 +139,7 @@ RECEIPTS: str = 'urn:xmpp:receipts' REGISTER: str = 'jabber:iq:register' REGISTER_FEATURE: str = 'http://jabber.org/features/iq-register' + REPLY: str = 'urn:xmpp:reply:0' REPORTING: str = 'urn:xmpp:reporting:0' ROSTER: str = 'jabber:iq:roster' ROSTERNOTES: str = 'storage:rosternotes' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/nbxmpp/protocol.py new/python-nbxmpp-4.2.0/nbxmpp/protocol.py --- old/python-nbxmpp-4.1.0/nbxmpp/protocol.py 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/nbxmpp/protocol.py 2023-02-05 17:23:56.000000000 +0100 @@ -1258,6 +1258,30 @@ def setReceiptReceived(self, id_): self.setTag('received', namespace=Namespace.RECEIPTS, attrs={'id': id_}) + def setReply(self, + recipient_jid: str, + reply_to_id: str, + fallback_start: int, + fallback_end: int + ) -> None: + + self.setTag( + 'reply', + namespace=Namespace.REPLY, + attrs={ + 'id': reply_to_id, + 'to': recipient_jid}) + + fallback_tag = self.setTag( + 'fallback', + namespace=Namespace.FALLBACK, + attrs={'for': Namespace.REPLY}) + fallback_tag.addChild( + 'body', + attrs={ + 'start': str(fallback_start), + 'end': str(fallback_end)}) + def setOOB(self, url, desc=None): oob = self.setTag('x', namespace=Namespace.X_OOB) oob.setTagData('url', url) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/nbxmpp/stringprep.py new/python-nbxmpp-4.2.0/nbxmpp/stringprep.py --- old/python-nbxmpp-4.1.0/nbxmpp/stringprep.py 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/nbxmpp/stringprep.py 2023-02-05 17:23:56.000000000 +0100 @@ -241,3 +241,51 @@ ) return ''.join(chars) + + +def _saslprep_do_mapping(chars: list[str]) -> None: + i = 0 + while i < len(chars): + c = chars[i] + if stringprep.in_table_b1(c): + del chars[i] + + elif stringprep.in_table_c12(c): + chars[i] = ' ' + + i += 1 + + +def saslprep(string: str, allow_unassigned: bool = False) -> str: + ''' + Process the given `string` using the SASLprep (`RFC 4013`_) profile. + ''' + + chars = list(string) + _saslprep_do_mapping(chars) + do_normalization(chars) + check_against_tables( + chars, + ( + stringprep.in_table_c12, + stringprep.in_table_c21, + stringprep.in_table_c22, + stringprep.in_table_c3, + stringprep.in_table_c4, + stringprep.in_table_c5, + stringprep.in_table_c6, + stringprep.in_table_c7, + stringprep.in_table_c8, + stringprep.in_table_c9, + )) + check_bidi(chars) + + if not allow_unassigned: + check_against_tables( + chars, + ( + stringprep.in_table_a1, + ) + ) + + return ''.join(chars) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/nbxmpp/structs.py new/python-nbxmpp-4.2.0/nbxmpp/structs.py --- old/python-nbxmpp-4.1.0/nbxmpp/structs.py 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/nbxmpp/structs.py 2023-02-05 17:23:56.000000000 +0100 @@ -290,6 +290,13 @@ id: str +class ReplyData(NamedTuple): + to: str + id: str + fallback_start: Optional[int] + fallback_end: Optional[int] + + class ModerationData(NamedTuple): stanza_id: str moderator_jid: str @@ -993,6 +1000,7 @@ receipt: Optional[ReceiptData] = None oob: Optional[OOBData] = None correction: Optional[CorrectionData] = None + reply_data: Optional[ReplyData] = None moderation: Optional[ModerationData] = None attention: bool = False forms = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/pyproject.toml new/python-nbxmpp-4.2.0/pyproject.toml --- old/python-nbxmpp-4.1.0/pyproject.toml 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/pyproject.toml 2023-02-05 17:23:56.000000000 +0100 @@ -20,7 +20,7 @@ "precis-i18n>=1.0.0", "packaging", "idna", - "PyGObject", + "PyGObject>=3.42.0", ] dynamic = ["version"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/python-nbxmpp.doap new/python-nbxmpp-4.2.0/python-nbxmpp.doap --- old/python-nbxmpp-4.1.0/python-nbxmpp.doap 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/python-nbxmpp.doap 2023-02-05 17:23:56.000000000 +0100 @@ -422,5 +422,12 @@ <xmpp:version>0.1.0</xmpp:version> </xmpp:SupportedXep> </implements> + <implements> + <xmpp:SupportedXep> + <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0461.html"/> + <xmpp:status>complete</xmpp:status> + <xmpp:version>0.1.0</xmpp:version> + </xmpp:SupportedXep> + </implements> </Project> </rdf:RDF> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-nbxmpp-4.1.0/test/unit/test_stringprep.py new/python-nbxmpp-4.2.0/test/unit/test_stringprep.py --- old/python-nbxmpp-4.1.0/test/unit/test_stringprep.py 2023-01-24 00:06:26.000000000 +0100 +++ new/python-nbxmpp-4.2.0/test/unit/test_stringprep.py 2023-02-05 17:23:56.000000000 +0100 @@ -1,6 +1,7 @@ import unittest from nbxmpp.stringprep import nodeprep +from nbxmpp.stringprep import saslprep from nbxmpp.stringprep import resourceprep from nbxmpp.stringprep import nameprep from nbxmpp.stringprep import check_bidi @@ -201,3 +202,56 @@ self.assertEqual( '\u0221', resourceprep('\u0221', allow_unassigned=True)) + + +class TestSASLprep(unittest.TestCase): + def test_map_to_nothing(self): + self.assertEqual( + 'IX', + saslprep('I\u00ADX'), + 'SASLprep requirement: map SOFT HYPHEN to nothing') + + def test_nfkc(self): + self.assertEqual( + 'a', + saslprep('\u00AA'), + 'SASLprep requirement: NFKC') + self.assertEqual( + 'IX', + saslprep('\u2168'), + 'SASLprep requirement: NFKC') + + def test_case_fold(self): + self.assertNotEqual( + 'user', + saslprep('USER'), + 'SASLprep requirement: No CaseFold') + + def test_prohibited_character(self): + with self.assertRaisesRegex( + ValueError, + r'U\+0007', + msg='SASLprep requirement: ' + 'prohibited character (C.2.1)'): + saslprep('\u0007') + + def test_bidi_check(self): + with self.assertRaises( + ValueError, + msg='SASLprep requirement: bidi check'): + saslprep('\u0627\u0031') + + def test_unassigned(self): + with self.assertRaises( + ValueError, + msg='SASLprep requirement: unassigned'): + saslprep('\u0221', allow_unassigned=False) + + with self.assertRaises( + ValueError, + msg='enforce no unassigned by default'): + saslprep('\u0221') + + self.assertEqual( + '\u0221', + saslprep('\u0221', allow_unassigned=True))