Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
35e6548f by Daniel Brötzmann at 2020-10-09T18:42:03+02:00
Don’t use f-strings for translatable strings
- - - - -
3 changed files:
- gajim/common/jingle_rtp.py
- gajim/groupchat_control.py
- gajim/gui_interface.py
Changes:
=====================================
gajim/common/jingle_rtp.py
=====================================
@@ -130,7 +130,7 @@ class JingleRTPContent(JingleContent):
None,
conn=self.session.connection,
level='error',
- pri_txt=_(f'{text} configuration error'),
+ pri_txt=_('%s configuration error' % text),
sec_txt=_('Couldn’t set up %(text)s. Check your '
'configuration.\nPipeline:\n%(pipeline)s\n'
'Error:\n%(error)s') % {
=====================================
gajim/groupchat_control.py
=====================================
@@ -495,7 +495,7 @@ class GroupchatControl(ChatControlBase):
con = app.connections[self.account]
message_id = con.get_module('MUC').invite(self.room_jid, contact_jid)
self.add_info_message(
- _(f'{contact_jid} has been invited to this group chat'),
+ _('%s has been invited to this group chat' % contact_jid),
message_id=message_id)
def _on_destroy_room(self, _action, _param):
@@ -591,7 +591,7 @@ class GroupchatControl(ChatControlBase):
try:
task.finish()
except Exception as error:
- self.add_info_message(_(f'Avatar upload failed: {error}'))
+ self.add_info_message(_('Avatar upload failed: %s' % error))
else:
self.add_info_message(_('Avatar upload successful'))
=====================================
gajim/gui_interface.py
=====================================
@@ -389,7 +389,8 @@ class Interface:
if helpers.allow_showing_notification(event.account):
contact_name = event.get_inviter_name()
event_type = _('Group Chat Invitation')
- text = _(f'{contact_name} invited you to {event.info.muc_name}')
+ text = _('%(contact)s invited you to %(chat)s') % {
+ 'contact': contact_name, 'chat': event.info.muc_name}
app.notification.popup(event_type,
str(event.from_),
event.account,
@@ -925,7 +926,7 @@ class Interface:
if helpers.allow_showing_notification(account):
heading = _('Incoming Call')
contact = app.get_name_from_jid(account, event.jid)
- text = _(f'{contact} is calling')
+ text = _('%s is calling' % contact)
app.notification.popup(
heading,
event.fjid,
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/35e6548f50f8ecd1658c25beaa712896…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/35e6548f50f8ecd1658c25beaa712896…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
f7019433 by lovetox at 2020-10-08T20:51:01+02:00
Remove unused import
- - - - -
1 changed file:
- gajim/gtk/discovery.py
Changes:
=====================================
gajim/gtk/discovery.py
=====================================
@@ -46,7 +46,6 @@ import weakref
import uuid
import nbxmpp
-from nbxmpp.util import is_error_result
from nbxmpp.structs import DiscoIdentity
from nbxmpp.namespaces import Namespace
from nbxmpp.errors import StanzaError
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f7019433d549edcaff47317c79696c66…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/f7019433d549edcaff47317c79696c66…
You're receiving this email because of your account on dev.gajim.org.
Philipp Hörist pushed to branch master at gajim / gajim
Commits:
07dd8d0c by lovetox at 2020-10-08T20:26:44+02:00
Discovery: Fix disco#items callback
- - - - -
1 changed file:
- gajim/gtk/discovery.py
Changes:
=====================================
gajim/gtk/discovery.py
=====================================
@@ -453,13 +453,16 @@ class ServicesCache:
if cbkey in self._cbs:
del self._cbs[cbkey]
- def _disco_items_received(self, result):
+ def _disco_items_received(self, task):
"""
Callback for when we receive an agent's items
array is (agent, node, items)
"""
- if is_error_result(result):
- self._disco_items_error(result)
+
+ try:
+ result = task.finish()
+ except StanzaError as error:
+ self._disco_items_error(error)
return
addr = get_agent_address(result.jid, result.node)
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/07dd8d0c8608a5e5550ad6f84af8db67…
--
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/07dd8d0c8608a5e5550ad6f84af8db67…
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:
f8f99f33 by lovetox at 2020-10-05T17:38:40+02:00
Bookmarks: Catch some invalid room jids
Fixes #111
- - - - -
1 changed file:
- nbxmpp/modules/bookmarks.py
Changes:
=====================================
nbxmpp/modules/bookmarks.py
=====================================
@@ -140,6 +140,12 @@ class Bookmarks(BaseModule):
error)
continue
+ if jid.localpart is None or jid.resource is not None:
+ self._log.warning('Invalid JID: "%s", %s',
+ conf.getAttr('jid'),
+ error)
+ continue
+
autojoin = self._parse_autojoin(conf.getAttr('autojoin'))
nick = self._parse_nickname(conf.getTagData('nick'))
name = conf.getAttr('name') or None
@@ -170,6 +176,12 @@ class Bookmarks(BaseModule):
error)
return None
+ if jid.localpart is None or jid.resource is not None:
+ self._log.warning('Invalid JID: "%s", %s',
+ item.getAttr('id'),
+ error)
+ return None
+
autojoin = self._parse_autojoin(conference.getAttr('autojoin'))
nick = self._parse_nickname(conference.getTagData('nick'))
name = conference.getAttr('name') or None
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/f8f99f339d31c1795bb6eef2…
--
View it on GitLab: https://dev.gajim.org/gajim/python-nbxmpp/-/commit/f8f99f339d31c1795bb6eef2…
You're receiving this email because of your account on dev.gajim.org.