Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
c72b4fbd by Philipp Hörist at 2019-08-28T21:05:21Z
CommonError: Add support for condition data
This is used for example to advertise a new MUC after destruction
<gone>xmpp:new@chat.example.org?join</gone>
- - - - -
1 changed file:
- nbxmpp/structs.py
Changes:
=====================================
nbxmpp/structs.py
=====================================
@@ -361,6 +361,7 @@ class CommonError:
def __init__(self, stanza):
self._error_node = stanza.getTag('error')
self.condition = stanza.getError()
+ self.condition_data = self._error_node.getTagData(self.condition)
self.app_condition = stanza.getAppError()
self.type = stanza.getErrorType()
self.jid = stanza.getFrom()
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/c72b4fbdbda1a8f954ad9c2865…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/commit/c72b4fbdbda1a8f954ad9c2865…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
3745f883 by Philipp Hörist at 2019-08-28T20:52:10Z
GroupchatCreation: Handle <gone> error better
- - - - -
1 changed file:
- gajim/gtk/groupchat_creation.py
Changes:
=====================================
gajim/gtk/groupchat_creation.py
=====================================
@@ -159,7 +159,10 @@ class CreateGroupchatWindow(Gtk.ApplicationWindow):
self._ui.create_button.set_sensitive(False)
def _set_warning_from_error(self, error):
- text = MUC_DISCO_ERRORS.get(error.condition, to_user_string(error))
+ condition = error.condition
+ if condition == 'gone':
+ condition = 'already-exists'
+ text = MUC_DISCO_ERRORS.get(condition, to_user_string(error))
self._set_warning(text)
def _set_warning_from_error_code(self, error_code):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3745f88313a17a8613d618a3e71571707a…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/3745f88313a17a8613d618a3e71571707a…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
34e50ce9 by Philipp Hörist at 2019-08-27T20:10:30Z
Fix typo
- - - - -
1 changed file:
- gajim/common/modules/muc.py
Changes:
=====================================
gajim/common/modules/muc.py
=====================================
@@ -787,7 +787,7 @@ class MUC(BaseModule):
type_ = InviteType.DIRECT
password = app.gc_passwords.get(room, None)
- self._log.info('Inivte %s to %s', to, room)
+ self._log.info('Invite %s to %s', to, room)
self._nbxmpp('MUC').invite(room, to, reason, password, continue_, type_)
def cleanup(self):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/34e50ce9d481b71e1ffbac6d4b20deccfe…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/34e50ce9d481b71e1ffbac6d4b20deccfe…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
1b7f3f51 by Philipp Hörist at 2019-08-26T20:11:17Z
Groupchat: Remove include/exclude list when closing the tab
The available options regarding closing tabs should be enough
- - - - -
0de8c8ac by Philipp Hörist at 2019-08-26T21:08:51Z
AdHoc: Remove obsolete LeaveGroupchatsCommand
This can be easier done by just removing the autojoin flag
- - - - -
3 changed files:
- gajim/common/config.py
- gajim/common/modules/adhoc_commands.py
- gajim/groupchat_control.py
Changes:
=====================================
gajim/common/config.py
=====================================
@@ -184,8 +184,6 @@ class Config:
'print_ichat_every_foo_minutes': [opt_int, 5, _('When not printing time for every message (\'print_time\'==sometimes), print it every x minutes.')],
'confirm_paste_image': [opt_bool, True, _('Ask before pasting an image.')],
'confirm_close_muc': [opt_bool, True, _('Ask before closing a group chat tab/window.')],
- 'confirm_close_muc_rooms': [opt_str, '', _('Always ask for confirmation before closing group chats with any of the XMPP Addresses on this list (space separated).')],
- 'noconfirm_close_muc_rooms': [opt_str, '', _('Never ask for confirmation before closing group chats with any of the XMPP Addresses on this list (space separated).')],
'confirm_close_multiple_tabs': [opt_bool, True, _('Ask before closing tabbed chat window if there are chats that can lose data (chat, private chat, group chat that will not be minimized).')],
'notify_on_file_complete': [opt_bool, True],
'file_transfers_port': [opt_int, 28011],
=====================================
gajim/common/modules/adhoc_commands.py
=====================================
@@ -197,104 +197,6 @@ def find_current_groupchats(account):
return rooms
-class LeaveGroupchatsCommand(AdHocCommand):
- commandnode = 'leave-groupchats'
- commandname = _('Leave Group Chats')
-
- def __init__(self, conn, jid, sessionid):
- AdHocCommand.__init__(self, conn, jid, sessionid)
- self._callback = self.first_step
-
- @staticmethod
- def is_visible_for(samejid):
- """
- Leave groupchats is visible only if the entity has the same bare jid
- """
- return samejid
-
- def execute(self, request):
- return self._callback(request)
-
- def first_step(self, request):
- # first query...
- response, cmd = self.build_response(request,
- defaultaction='execute',
- actions=['execute'])
- options = []
- account = self.connection.name
- for gc in find_current_groupchats(account):
- options.append(
- ('%s' % gc[0],
- _('%(nickname)s on %(room_jid)s') % {'nickname': gc[1],
- 'room_jid': gc[0]}))
- if not options:
- response, cmd = self.build_response(request, status='completed')
- cmd.addChild('note', {}, _('You have not joined a group chat.'))
-
- self.connection.connection.send(response)
- return False
-
- cmd.addChild(
- node=dataforms.SimpleDataForm(
- title=_('Leave Group Chats'),
- instructions=_('Choose the group chats you want to leave'),
- fields=[
- dataforms.create_field(
- 'list-multi',
- var='groupchats',
- label=_('Group chats'),
- options=options,
- required=True)
- ]
- )
- )
-
- self.connection.connection.send(response)
-
- # for next invocation
- self._callback = self.second_step
-
- return True # keep the session
-
- def second_step(self, request):
- # check if the data is correct
- try:
- form = dataforms.SimpleDataForm(
- extend=request.getTag('command').getTag('x'))
- except Exception:
- self.bad_request(request)
- return False
-
- try:
- gc = form['groupchats'].values
- except Exception: # KeyError if there's no groupchats in form
- self.bad_request(request)
- return False
- account = self.connection.name
- try:
- for room_jid in gc:
- gc_control = app.interface.msg_win_mgr.get_gc_control(
- room_jid, account)
- if not gc_control:
- minimized_controls = app.interface.minimized_controls
- gc_control = minimized_controls[account][room_jid]
- gc_control.shutdown()
- app.interface.roster.remove_groupchat(room_jid, account)
- continue
- gc_control.parent_win.remove_tab(gc_control, None, force=True)
- except Exception: # KeyError if there's no such room opened
- self.bad_request(request)
- return False
- response, cmd = self.build_response(request, status='completed')
- note = _('You left the following group chats:')
- for room_jid in gc:
- note += '\n\t' + room_jid
- cmd.addChild('note', {}, note)
-
- self.connection.connection.send(response)
- return False
-
-
class AdHocCommands(BaseModule):
_nbxmpp_extends = 'AdHoc'
@@ -316,7 +218,7 @@ class AdHocCommands(BaseModule):
# a list of all commands exposed: node -> command class
self._commands = {}
if app.config.get('remote_commands'):
- for cmdobj in (ChangeStatusCommand, LeaveGroupchatsCommand):
+ for cmdobj in (ChangeStatusCommand,):
self._commands[cmdobj.commandnode] = cmdobj
# a list of sessions; keys are tuples (jid, sessionid, node)
=====================================
gajim/groupchat_control.py
=====================================
@@ -2215,11 +2215,8 @@ class GroupchatControl(ChatControlBase):
def safe_shutdown(self):
if self.minimizable():
return True
- includes = app.config.get('confirm_close_muc_rooms').split(' ')
- excludes = app.config.get('noconfirm_close_muc_rooms').split(' ')
# whether to ask for confirmation before closing muc
- if (app.config.get('confirm_close_muc') or self.room_jid in includes)\
- and self.is_connected and self.room_jid not in excludes:
+ if app.config.get('confirm_close_muc') and self.is_connected:
return False
return True
@@ -2233,13 +2230,9 @@ class GroupchatControl(ChatControlBase):
self.list_treeview.get_selection().unselect_all()
on_no(self)
return
- includes = app.config.get('confirm_close_muc_rooms').split(' ')
- excludes = app.config.get('noconfirm_close_muc_rooms').split(' ')
- # whether to ask for confirmation before closing muc
- if (app.config.get('confirm_close_muc') or self.room_jid in includes)\
- and self.is_connected and self.room_jid \
- not in excludes:
+ # whether to ask for confirmation before closing muc
+ if app.config.get('confirm_close_muc') and self.is_connected:
def on_ok(is_checked):
if is_checked:
# User does not want to be asked again
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/80c1c1f5acabf85b577230d35d532db51…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/compare/80c1c1f5acabf85b577230d35d532db51…
You're receiving this email because of your account on dev.gajim.org.