| ... |
... |
@@ -392,22 +392,31 @@ def prepare(self, account, result): |
|
392
|
392
|
icon_name = 'gajim-agent-irc'
|
|
393
|
393
|
self._ui.gateway_image.set_from_icon_name(
|
|
394
|
394
|
icon_name, Gtk.IconSize.DIALOG)
|
|
395
|
|
- self._ui.gateway_label.set_text(_('%(name)s (%(type)s)') % {
|
|
396
|
|
- 'name': result.gateway_name,
|
|
397
|
|
- 'type': result.gateway_type.upper()})
|
|
|
395
|
+ gateway_name = result.gateway_name or self._result.jid
|
|
|
396
|
+ if not result.gateway_type:
|
|
|
397
|
+ self._ui.gateway_label.set_text(gateway_name)
|
|
|
398
|
+ else:
|
|
|
399
|
+ self._ui.gateway_label.set_text(
|
|
|
400
|
+ f'{gateway_name} ({result.gateway_type.upper()})')
|
|
398
|
401
|
else:
|
|
|
402
|
+ identity_name = ''
|
|
|
403
|
+ identity_type = ''
|
|
399
|
404
|
for identity in result.identities:
|
|
400
|
|
- identity_name = identity.name
|
|
401
|
|
- identity_type = identity.type
|
|
402
|
405
|
if identity.type == 'sms':
|
|
403
|
406
|
icon_name = 'gajim-agent-sms'
|
|
|
407
|
+ identity_name = identity.name or self._result.jid
|
|
|
408
|
+ identity_type = identity.type
|
|
404
|
409
|
if identity.type == 'irc':
|
|
405
|
410
|
icon_name = 'gajim-agent-irc'
|
|
|
411
|
+ identity_name = identity.name or self._result.jid
|
|
|
412
|
+ identity_type = identity.type
|
|
406
|
413
|
self._ui.gateway_image.set_from_icon_name(
|
|
407
|
414
|
icon_name, Gtk.IconSize.DIALOG)
|
|
408
|
|
- self._ui.gateway_label.set_text(_('%(name)s (%(type)s)') % {
|
|
409
|
|
- 'name': identity_name,
|
|
410
|
|
- 'type': identity_type.upper()})
|
|
|
415
|
+ if not identity_type:
|
|
|
416
|
+ self._ui.gateway_label.set_text(identity_name)
|
|
|
417
|
+ else:
|
|
|
418
|
+ self._ui.gateway_label.set_text(
|
|
|
419
|
+ f'{identity_name} ({identity_type.upper()})')
|
|
411
|
420
|
|
|
412
|
421
|
if result.supports(Namespace.REGISTER):
|
|
413
|
422
|
self._ui.register_button.set_sensitive(True)
|