Philipp Hörist pushed to branch master at gajim / gajim
Commits:
107bd123 by lovetox at 2021-07-27T20:51:28+02:00
AccountWizard: Don’t try to validate websocket uris
- - - - -
1 changed file:
- gajim/gtk/account_wizard.py
Changes:
=====================================
gajim/gtk/account_wizard.py
=====================================
@@ -748,6 +748,11 @@ def _show_port_icon(self, show):
def _validate_host(self):
host = self._ui.custom_host_entry.get_text()
+ if host.startswith('ws://') or host.startswith('wss://'):
+ # We have no method for validating websocket URIs
+ self._show_host_icon(False)
+ return True
+
try:
validate_domainpart(host)
except Exception:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/107bd123c076fc8fea3faf8d76147fa0…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/107bd123c076fc8fea3faf8d76147fa0…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch nbxmpp_2.0 at gajim / python-nbxmpp
Commits:
3b9e6ea3 by lovetox at 2021-07-24T21:45:22+02:00
AdHoc: Improve XEP-0050 Compliance
- - - - -
a808009a by lovetox at 2021-07-24T21:45:22+02:00
AdHoc: Cancel action is always possible
- - - - -
d3735912 by lovetox at 2021-07-24T21:45:22+02:00
GSSAPI: Catch OSError
Error is thrown when Kerberos for Windows is not installed
- - - - -
4efc81e4 by lovetox at 2021-07-24T21:45:22+02:00
Update README.md
- - - - -
61bff9bd by lovetox at 2021-07-24T21:45:22+02:00
AdHoc: Don’t expect session id for one stage commands
- - - - -
afaf927d by lovetox at 2021-07-24T21:45:22+02:00
Correctly handle RSM count request
Fixes #120
- - - - -
4 changed files:
- README.md
- nbxmpp/auth.py
- nbxmpp/modules/adhoc.py
- nbxmpp/modules/mam.py
Changes:
=====================================
README.md
=====================================
@@ -13,7 +13,7 @@
## Optional Runtime Requirements
-- python-gssapi (for GSSAPI authentication)
+- python-gssapi (for GSSAPI authentication https://pypi.org/project/gssapi/)
## Features
=====================================
nbxmpp/auth.py
=====================================
@@ -37,7 +37,8 @@ log = logging.getLogger('nbxmpp.auth')
try:
gssapi = __import__('gssapi')
GSSAPI_AVAILABLE = True
-except ImportError:
+except (ImportError, OSError) as error:
+ log.warning('GSSAPI not available: %s', error)
GSSAPI_AVAILABLE = False
=====================================
nbxmpp/modules/adhoc.py
=====================================
@@ -66,18 +66,18 @@ class AdHoc(BaseModule):
yield command_list
@iq_request_task
- def execute_command(self, command, action=None, dataform=None):
+ def execute_command(self, cmd, action=None, dataform=None):
_task = yield
if action is None:
action = AdHocAction.EXECUTE
- attrs = {'node': command.node,
+ attrs = {'node': cmd.node,
'xmlns': Namespace.COMMANDS,
'action': action.value}
- if command.sessionid is not None:
- attrs['sessionid'] = command.sessionid
+ if cmd.sessionid is not None:
+ attrs['sessionid'] = cmd.sessionid
- response = yield _make_command(command, attrs, dataform)
+ response = yield _make_command(cmd, attrs, dataform)
if response.isError():
raise StanzaError(response)
@@ -85,41 +85,44 @@ class AdHoc(BaseModule):
if command is None:
raise MalformedStanzaError('command node missing', response)
- attrs = command.getAttrs()
- notes = []
- actions = []
+ node = command.getAttr('node')
+ if node is None:
+ raise MalformedStanzaError('node attribute missing', response)
+
+ status = command.getAttr('status')
+ if status is None:
+ raise MalformedStanzaError('status attribute missing', response)
+
+ if status not in ('executing', 'completed', 'canceled'):
+ raise MalformedStanzaError('invalid status attribute %s' % status,
+ response)
+
+ status = AdHocStatus(status)
+
+ sessionid = command.getAttr('sessionid')
+ if sessionid is None and _expect_sessionid(status, cmd.sessionid):
+ raise MalformedStanzaError('sessionid attribute missing', response)
+
+ try:
+ notes = _parse_notes(command)
+ except ValueError as error:
+ raise MalformedStanzaError(error, response)
+
try:
- for note in command.getTags('note'):
- type_ = note.getAttr('type')
- if type_ is not None:
- type_ = AdHocNoteType(note.getAttr('type'))
- notes.append(AdHocCommandNote(text=note.getData(),
- type=type_))
-
- default = None
- actions_ = command.getTag('actions')
- if actions_ is not None:
- for action_ in actions_.getChildren():
- actions.append(AdHocAction(action_.getName()))
-
- default = actions_.getAttr('execute')
- if default is not None:
- default = AdHocAction(default)
- if default not in actions:
- default = None
-
- yield AdHocCommand(
- jid=str(response.getFrom()),
- name=None,
- node=attrs['node'],
- sessionid=attrs.get('sessionid'),
- status=AdHocStatus(attrs['status']),
- data=command.getTag('x', namespace=Namespace.DATA),
- actions=actions,
- default=default,
- notes=notes)
- except Exception as error:
- raise MalformedStanzaError(str(error), response)
+ actions, default = _parse_actions(command)
+ except ValueError as error:
+ raise MalformedStanzaError(error, response)
+
+ yield AdHocCommand(
+ jid=response.getFrom(),
+ name=None,
+ node=node,
+ sessionid=sessionid,
+ status=status,
+ data=command.getTag('x', namespace=Namespace.DATA),
+ actions=actions,
+ default=default,
+ notes=notes)
def _make_command(command, attrs, dataform):
@@ -129,3 +132,69 @@ def _make_command(command, attrs, dataform):
iq = Iq('set', to=command.jid)
iq.addChild(node=command_node)
return iq
+
+
+def _parse_notes(command):
+ notes = []
+ for note in command.getTags('note'):
+ type_ = note.getAttr('type')
+ if type_ is None:
+ type_ = 'info'
+
+ if type_ not in ('info', 'warn', 'error'):
+ raise ValueError('invalid note type %s' % type_)
+
+ notes.append(AdHocCommandNote(text=note.getData(),
+ type=AdHocNoteType(type_)))
+ return notes
+
+
+def _parse_actions(command):
+ if command.getAttr('status') != 'executing':
+ return [], None
+
+ actions_node = command.getTag('actions')
+ if actions_node is None:
+ # If there is no <actions/> element,
+ # the user-agent can use a single-stage dialog or view.
+ # The action "execute" is equivalent to the action "complete".
+ return [AdHocAction.CANCEL, AdHocAction.COMPLETE], AdHocAction.COMPLETE
+
+ actions = []
+ for action in actions_node.getChildren():
+ name = action.getName()
+ if name not in ('prev', 'next', 'complete'):
+ raise ValueError('invalid action name: %s' % name)
+ actions.append(AdHocAction(name))
+
+ if not actions:
+ raise ValueError('actions element without actions')
+
+ # The action "cancel" is always allowed.
+ actions.append(AdHocAction.CANCEL)
+
+ default = actions_node.getAttr('execute')
+ if default is None:
+ # If the "execute" attribute is absent, it defaults to "next".
+ default = 'next'
+
+ if default not in ('prev', 'next', 'complete'):
+ raise ValueError('invalid execute attribute %s' % default)
+
+ default = AdHocAction(default)
+
+ # A form which has an <actions/> element and an "execute" attribute
+ # which evaluates (taking the default into account if absent) to an
+ # action which is not allowed is therefore invalid.
+ if default not in actions:
+ # Some implementations don’t respect this rule.
+ # Take the first action so we don’t fail here.
+ default = actions[0]
+
+ return actions, default
+
+
+def _expect_sessionid(status, sent_sessionid):
+ # Session id should only be expected for multiple stage commands
+ # or when we initialize the session (set the session attribute)
+ return status != status.COMPLETED or sent_sessionid is not None
=====================================
nbxmpp/modules/mam.py
=====================================
@@ -66,7 +66,10 @@ class MAM(BaseModule):
raise MalformedStanzaError('rsm set missing', response)
complete = fin.getAttr('complete') == 'true'
- if not complete:
+ if max_ != 0 and not complete:
+ # max_ == 0 is a request for count of the items in a result set
+ # in this case first and last will be absent
+ # See: https://xmpp.org/extensions/xep-0059.html#count
if rsm.first is None or rsm.last is None:
raise MalformedStanzaError('first or last element missing',
response)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/99530609dcf9022fccf2a0a…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/compare/99530609dcf9022fccf2a0a…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch gajim_1.3 at gajim / gajim
Commits:
418e476a by lovetox at 2021-07-24T21:57:04+02:00
Windows: Add gssapi dependency
Fixes #10540
- - - - -
1685fd29 by lovetox at 2021-07-24T21:57:04+02:00
Accounts: Use SpinSetting for custom port
Fixes #10541
- - - - -
8766a747 by lovetox at 2021-07-24T21:57:04+02:00
Assistant: Add convenience mehtods to Page
- Page has now a update_page_complete() method
- Page has now a get_visible_buttons() method
- Page has now a get_get_default_button() method
- - - - -
42c3b9dd by lovetox at 2021-07-24T21:57:04+02:00
AdHoc: Port to new Assistant
Fixes #10314
- - - - -
164842ec by lovetox at 2021-07-24T21:57:04+02:00
AdHoc: Add custom progress pages
- - - - -
c4503a66 by lovetox at 2021-07-24T21:57:04+02:00
AdHoc: Don’t execute callbacks after dialog is destroyed
- - - - -
6d68facf by lovetox at 2021-07-24T21:57:04+02:00
ChangePassword: Refactor Dialog
- Adapt to new Assistant methods
- - - - -
d41e784e by lovetox at 2021-07-24T21:57:04+02:00
RemoveAccount: Refactor Dialog
- Adapt to new Assistant methods
- - - - -
901f5c47 by lovetox at 2021-07-24T21:57:04+02:00
AccountWizard: Refactor Dialog
- Adapt to new Assistant methods
- Don’t force custom host on Advanced page
- - - - -
93022629 by lovetox at 2021-07-24T21:57:04+02:00
AdHoc: There is always a default action
- - - - -
6bc96caf by lovetox at 2021-07-24T21:57:04+02:00
AdHoc: Don’t add cancel action
nbxmpp provides it already
- - - - -
b62ffa87 by Daniel Brötzmann at 2021-07-24T21:57:04+02:00
Preferences: Fix STUN Server label
- - - - -
ae517927 by lovetox at 2021-07-24T21:57:04+02:00
Profile: Fix privacy switch inital state
- - - - -
1f534560 by lovetox at 2021-07-24T21:57:04+02:00
Update runtime requirements
- - - - -
3df4a219 by lovetox at 2021-07-24T21:57:04+02:00
Fix CI
- - - - -
206119a9 by Marcin Mielniczuk at 2021-07-24T21:57:04+02:00
Annotate the type for Page.__gsignals__ to fix the mypy failure
- - - - -
a051dc82 by lovetox at 2021-07-24T21:57:04+02:00
ServerInfo: Don’t fail while adding error class
Fixes #10559
- - - - -
f2ba30da by wurstsalat at 2021-07-24T21:57:04+02:00
PortableInstaller: Add directory cleanup
- - - - -
6cfd76d7 by wurstsalat at 2021-07-24T21:57:04+02:00
Uninstaller: Kill gdbus.exe if running
- - - - -
b583adf0 by wurstsalat at 2021-07-24T21:57:04+02:00
Installer: Add Gajim branding text
- - - - -
b7baa032 by wurstsalat at 2021-07-24T21:57:04+02:00
Jingle: Fix UnboundLocalError for transports variable
transport=None is handled in JingleTransportSocks5()
Fixes #10545
- - - - -
e37b2488 by wurstsalat at 2021-07-24T21:57:43+02:00
Profile: Add Note entry
- - - - -
1b37bcff by wurstsalat at 2021-07-24T21:57:43+02:00
Profile: Use textview for multi line Note element
- - - - -
7c330631 by wurstsalat at 2021-07-24T21:57:43+02:00
Features: Check for gstreamer gtk plugin for AV support
Fixes #10551
- - - - -
b4251ecd by wurstsalat at 2021-07-24T21:57:43+02:00
Dependency check: Fix unused-variable
- - - - -
4c9a54b5 by wurstsalat at 2021-07-24T21:57:43+02:00
Themes: Apply change of dark/light theme instantly
Fixes #10441
- - - - -
7cd4e0f9 by wurstsalat at 2021-07-24T21:57:43+02:00
Themes: Apply user themes instantly
- - - - -
c6a50126 by André Apitzsch at 2021-07-24T21:57:43+02:00
Fix spell checking
Fixes #10558.
- - - - -
c421f6e1 by André Apitzsch at 2021-07-24T21:57:43+02:00
Fix spell checking
Disable spell checking only if there is no text,
so it doesn't crash on correction.
- - - - -
a43905c8 by wurstsalat at 2021-07-24T21:57:43+02:00
Servers: Remove blabber.im
Service is gone
- - - - -
c2cf2994 by wurstsalat at 2021-07-24T21:57:43+02:00
HTTPUpload: Raise FileError if path is not accessible
Fixes #10560
- - - - -
4c71cb9c by lovetox at 2021-07-24T21:57:43+02:00
Profile: Don’t fail when adding a note property
Fixes #10598
- - - - -
bec749f7 by Jonas Schäfer at 2021-07-24T21:57:43+02:00
Update API JID for search.jabber.network integration
The JID has been changed recently and this needs to be reflected.
The old JID was available for a certain transition period, but
that period ended a few weeks back because of a necessary
architectural change which decoupled the two domains.
Signed-off-by: lovetox <philipp(a)hoerist.com>
- - - - -
df53d7ea by Matthew White at 2021-07-24T21:57:43+02:00
HistoryManager: Allow it to start in standalone mode
Fixes the following error when starting gajim-history-manager:
ModuleNotFoundError: No module named 'gajim.gui.emoji_data'
- - - - -
292b7ac4 by Matthew White at 2021-07-24T21:57:43+02:00
Test: Fix test_gui_interface failure
Partially fixes #10478 about the following error:
ERROR: test_gui_interface (unittest.loader._FailedTest)
...
ModuleNotFoundError: No module named 'gajim.gui.emoji_data'
- - - - -
03ead1ef by André Apitzsch at 2021-07-24T21:57:43+02:00
Replace discouraged pkg_resources for Python 3.9+
See https://setuptools.readthedocs.io/en/latest/pkg_resources.html
- - - - -
30 changed files:
- README.md
- gajim/common/app.py
- gajim/common/config.py
- gajim/common/configpaths.py
- gajim/common/modules/httpupload.py
- gajim/common/modules/jingle.py
- gajim/common/setting_values.py
- gajim/data/gui/profile.ui
- gajim/data/gui/themes_window.ui
- gajim/data/other/servers.json
- gajim/data/style/gajim.css
- gajim/gtk/account_wizard.py
- gajim/gtk/accounts.py
- gajim/gtk/adhoc.py
- gajim/gtk/assistant.py
- gajim/gtk/change_password.py
- gajim/gtk/css_config.py
- gajim/gtk/features.py
- gajim/gtk/message_input.py
- gajim/gtk/preferences.py
- gajim/gtk/profile.py
- gajim/gtk/remove_account.py
- gajim/gtk/server_info.py
- gajim/gtk/settings.py
- gajim/gtk/themes.py
- gajim/gtk/vcard_grid.py
- gajim/history_manager.py
- setup.cfg
- test/gtk/assistant.py
- test/unit/test_gui_interface.py
The diff was not included because it is too large.
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/19e371c835a1c8b976d0149f28f0d20…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/19e371c835a1c8b976d0149f28f0d20…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
f532ff35 by lovetox at 2021-07-24T21:09:34+02:00
Correctly handle RSM count request
Fixes #120
- - - - -
1 changed file:
- nbxmpp/modules/mam.py
Changes:
=====================================
nbxmpp/modules/mam.py
=====================================
@@ -66,7 +66,10 @@ class MAM(BaseModule):
raise MalformedStanzaError('rsm set missing', response)
complete = fin.getAttr('complete') == 'true'
- if not complete:
+ if max_ != 0 and not complete:
+ # max_ == 0 is a request for count of the items in a result set
+ # in this case first and last will be absent
+ # See: https://xmpp.org/extensions/xep-0059.html#count
if rsm.first is None or rsm.last is None:
raise MalformedStanzaError('first or last element missing',
response)
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/f532ff354c461e6606162489…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/f532ff354c461e6606162489…
You're receiving this email because of your account on dev.gajim.org.