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.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a3e63057 by Philipp Hörist at 2019-08-25T08:23:33Z
Avatar: Check storage before vcard request
- - - - -
1 changed file:
- gajim/common/modules/vcard_avatars.py
Changes:
=====================================
gajim/common/modules/vcard_avatars.py
=====================================
@@ -14,7 +14,6 @@
# XEP-0153: vCard-Based Avatars
-import os
from pathlib import Path
import nbxmpp
@@ -113,6 +112,7 @@ class VCardAvatars(BaseModule):
def _update_received(self, properties, room=False):
jid = properties.jid.getBare()
+ acc_jid = self._con.get_own_jid().getStripped()
if properties.avatar_state == AvatarState.EMPTY:
# Empty <photo/> tag, means no avatar is advertised
self._log.info('%s has no avatar published', properties.jid)
@@ -120,8 +120,10 @@ class VCardAvatars(BaseModule):
# Remove avatar
self._log.debug('Remove: %s', jid)
app.contacts.set_avatar(self._account, jid, None)
- acc_jid = self._con.get_own_jid().getStripped()
- if not room:
+
+ if room:
+ app.logger.set_muc_avatar_sha(jid, None)
+ else:
app.logger.set_avatar_sha(acc_jid, jid, None)
app.interface.update_avatar(
self._account, jid, room_avatar=room)
@@ -135,16 +137,21 @@ class VCardAvatars(BaseModule):
jid, properties.avatar_sha)
return
- if room:
- # We dont save the room avatar hash in our DB, so check
- # if we previously downloaded it
- if app.interface.avatar_exists(properties.avatar_sha):
- app.contacts.set_avatar(self._account,
- jid,
- properties.avatar_sha)
- app.interface.update_avatar(
- self._account, jid, room_avatar=room)
- return
+ if app.interface.avatar_exists(properties.avatar_sha):
+ # Check if the avatar is already in storage
+ self._log.info('Found avatar in storage')
+ if room:
+ app.logger.set_muc_avatar_sha(jid, properties.avatar_sha)
+ else:
+ app.logger.set_avatar_sha(acc_jid,
+ jid,
+ properties.avatar_sha)
+ app.contacts.set_avatar(self._account,
+ jid,
+ properties.avatar_sha)
+ app.interface.update_avatar(
+ self._account, jid, room_avatar=room)
+ return
if properties.avatar_sha not in self._requested_shas:
self._requested_shas.append(properties.avatar_sha)
@@ -173,9 +180,7 @@ class VCardAvatars(BaseModule):
app.interface.update_avatar(contact=gc_contact)
else:
self._log.info('Update: %s %s', nick, properties.avatar_sha)
- path = os.path.join(configpaths.get('AVATAR'),
- properties.avatar_sha)
- if not os.path.isfile(path):
+ if not app.interface.avatar_exists(properties.avatar_sha):
if properties.avatar_sha not in self._requested_shas:
app.log('avatar').info('Request: %s', nick)
self._requested_shas.append(properties.avatar_sha)
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a3e63057ece9a6e12f3e072adda0b9f010…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/a3e63057ece9a6e12f3e072adda0b9f010…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
8416724b by Daniel Brötzmann at 2019-08-24T21:53:33Z
HistorySync: Fix some strings
- - - - -
1 changed file:
- gajim/gtk/history_sync.py
Changes:
=====================================
gajim/gtk/history_sync.py
=====================================
@@ -206,7 +206,7 @@ class SelectTimePage(Gtk.Box):
self.set_spacing(18)
self.assistant = assistant
label = Gtk.Label(
- label=_('How far back do you want to synchronize chat history?'))
+ label=_('How far back should the chat history be synchronised?'))
listbox = Gtk.ListBox()
listbox.set_hexpand(False)
@@ -258,7 +258,7 @@ class DownloadHistoryPage(Gtk.Box):
'received': self.received, 'max': self.count}))
else:
self.progress.pulse()
- self.progress.set_text(_('Downloaded %s Messages' % self.received))
+ self.progress.set_text(_('Downloaded %s messages' % self.received))
def finished(self):
self.progress.set_fraction(1)
@@ -278,25 +278,15 @@ class SummaryPage(Gtk.Box):
def finished(self):
received = self.assistant.download_history.received
- finished = _('''
- Finished synchronising your History.
- {received} Messages downloaded.
- '''.format(received=received))
- self.label.set_text(finished)
+ self.label.set_text(_('Finished synchronising chat history:\n'
+ '%s messages downloaded' % received))
def nothing_to_do(self):
- nothing_to_do = _('''
- Gajim is fully synchronised
- with the Archive.
- ''')
- self.label.set_text(nothing_to_do)
+ self.label.set_text(_('Gajim is fully synchronised with the archive.'))
def query_already_running(self):
- already_running = _('''
- There is already a synchronisation in
- progress. Please try later.
- ''')
- self.label.set_text(already_running)
+ self.label.set_text(_('There is already a synchronisation in '
+ 'progress. Please try again later.'))
class TimeOption(Gtk.Label):
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/8416724b3a58792d3daa044084d31039b8…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/8416724b3a58792d3daa044084d31039b8…
You're receiving this email because of your account on dev.gajim.org.