Philipp Hörist pushed to branch nbxmpp_2.0 at gajim / python-nbxmpp
Commits:
e02be310 by lovetox at 2021-10-09T18:22:12+02:00
AdHoc: Make parsing actions more robust
- Ignore unknown actions instead of failing
- Don’t fail on duplicated actions
- - - - -
1 changed file:
- nbxmpp/modules/adhoc.py
Changes:
=====================================
nbxmpp/modules/adhoc.py
=====================================
@@ -151,27 +151,14 @@ def _parse_notes(command):
def _parse_actions(command):
if command.getAttr('status') != 'executing':
- return [], None
+ return set(), 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)
+ return {AdHocAction.CANCEL, AdHocAction.COMPLETE}, AdHocAction.COMPLETE
default = actions_node.getAttr('execute')
if default is None:
@@ -183,13 +170,31 @@ def _parse_actions(command):
default = AdHocAction(default)
+ # We use a set because it cannot contain duplicates
+ actions = set()
+ for action in actions_node.getChildren():
+ name = action.getName()
+ if name == 'execute':
+ actions.add(default)
+
+ if name in ('prev', 'next', 'complete'):
+ actions.add(AdHocAction(name))
+
+ if not actions:
+ raise ValueError('actions element without actions')
+
+ # The action "cancel" is always allowed.
+ actions.add(AdHocAction.CANCEL)
+
# 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]
+ for act in actions:
+ default = act
+ break
return actions, default
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/e02be310b791da0b71374d07…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/e02be310b791da0b71374d07…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
66bda2ad by lovetox at 2021-10-09T13:31:09+02:00
Appveyor: Build with python 3.9
- - - - -
1 changed file:
- win/_base.sh
Changes:
=====================================
win/_base.sh
=====================================
@@ -12,7 +12,7 @@ cd "${DIR}"
# CONFIG START
MAJOR_PY_VERSION="3"
-MINOR_PY_VERSION="8"
+MINOR_PY_VERSION="9"
PYTHON_VERSION="${MAJOR_PY_VERSION}.${MINOR_PY_VERSION}"
BUILD_VERSION="0"
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/66bda2ad6367924b4587ce2faee624ad…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/66bda2ad6367924b4587ce2faee624ad…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
0c4ff1c3 by lovetox at 2021-10-09T13:00:54+02:00
Remove unused variable
- - - - -
1 changed file:
- win/misc/create-launcher.py
Changes:
=====================================
win/misc/create-launcher.py
=====================================
@@ -72,7 +72,6 @@ def get_launcher_code(debug):
int result;
LPWSTR *szArglist;
int nArgs;
- int i;
szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
if( NULL == szArglist )
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/0c4ff1c35344a8ec7215e5d34d02dc6d…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/0c4ff1c35344a8ec7215e5d34d02dc6d…
You're receiving this email because of your account on dev.gajim.org.
Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits:
b4f78b3e by wurstsalat at 2021-10-03T18:17:58+02:00
Settings: Remove avatar_position_in_roster
- - - - -
6f15260a by wurstsalat at 2021-10-03T18:20:00+02:00
Settings: Remove roster_on_the_right
- - - - -
1 changed file:
- gajim/common/setting_values.py
Changes:
=====================================
gajim/common/setting_values.py
=====================================
@@ -55,7 +55,6 @@ class _ACCOUNT_DEFAULT:
'quit_on_main_window_x_button': False,
'hide_on_main_window_x_button': False,
'main_window_skip_taskbar': False,
- 'roster_on_the_right': False,
'latest_disco_addresses': '',
'time_stamp': '%x | %X ',
'change_roster_title': True,
@@ -85,7 +84,6 @@ class _ACCOUNT_DEFAULT:
'muc_highlight_words': '',
'muc_prefer_direct_msg': True,
'show_status_msgs_in_roster': True,
- 'avatar_position_in_roster': 'right',
'print_status_in_chats': False,
'log_contact_status_changes': False,
'use_urgency_hint': True,
@@ -352,7 +350,6 @@ class _ACCOUNT_DEFAULT:
'show_ascii_formatting_chars': _('If enabled, do not remove */_ . So *abc* will be bold but with * * not removed.'),
'gc_refer_to_nick_char': _('Character to add after nickname when using nickname completion (tab) in group chat.'),
'save_main_window_position': _('If enabled, Gajim will save the main window position when hiding it, and restore it when showing the window again.'),
- 'roster_on_the_right': _('Place the contact list on the right in single window mode'),
'time_stamp': _('This option lets you customize the timestamp that is printed in conversation. For example \'[%H:%M] \' will show \'[hour:minute] \'. See python doc on strftime for full documentation (https://docs.python.org/3/library/time.html#time.strftime).'),
'chat_timestamp_format': 'https://docs.python.org/3/library/time.html#time.strftime',
'change_roster_title': _('If enabled, Gajim will add * and [n] in contact list window title.'),
@@ -376,7 +373,6 @@ class _ACCOUNT_DEFAULT:
'muc_highlight_words': _('A list of words (semicolon separated) that will be highlighted in group chats.'),
'hide_on_main_window_x_button': _('If enabled, Gajim hides the main window when pressing the X button instead of minimizing into the notification area.'),
'main_window_skip_taskbar': _('Don’t show main window in the system taskbar.'),
- 'avatar_position_in_roster': _('Define the position of avatars in the contact list. Can be \'left\' or \'right\'.'),
'use_urgency_hint': _('If enabled, Gajim makes the window flash (the default behaviour in most Window Managers) when holding pending events.'),
'notification_timeout': '',
'escape_key_closes': _('If enabled, pressing Esc closes a tab/window.'),
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/181c53ea42cf4fb01b2b7c8ef40da58…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/181c53ea42cf4fb01b2b7c8ef40da58…
You're receiving this email because of your account on dev.gajim.org.