Philipp Hörist pushed to branch master at gajim / gajim


Commits:
b5a024f1 by Philipp Hörist at 2019-07-08T21:05:05Z
GroupchatCreation: Use MUC_DISCO_ERRORS

- - - - -
c34545bd by Philipp Hörist at 2019-07-08T21:07:34Z
StartChat: Fix incorrect type

- - - - -


2 changed files:

- gajim/gtk/groupchat_creation.py
- gajim/gtk/start_chat.py


Changes:

=====================================
gajim/gtk/groupchat_creation.py
=====================================
@@ -24,6 +24,7 @@ from nbxmpp.util import is_error_result
 
 from gajim.common import app
 from gajim.common.const import MUC_CREATION_EXAMPLES
+from gajim.common.const import MUC_DISCO_ERRORS
 from gajim.common.i18n import _
 
 from gajim.gtk.dialogs import ErrorDialog
@@ -48,16 +49,6 @@ class CreateGroupchatWindow(Gtk.ApplicationWindow):
 
         self._destroyed = False
 
-        not_muc_error = _('Address does not belong to a group chat server')
-        self._error_messages = {
-            'remote-server-not-found': _('Remote server not found'),
-            'remote-server-timeout': _('Remote server timeout'),
-            'service-unavailable': not_muc_error,
-            'subscription-required': not_muc_error,
-            'not-muc-service': not_muc_error,
-            'already-exists': _('Group chat already exists')
-        }
-
         self._account = self._fill_account_combo(account)
 
         self._create_entry_completion()
@@ -168,11 +159,11 @@ class CreateGroupchatWindow(Gtk.ApplicationWindow):
         self._ui.create_button.set_sensitive(False)
 
     def _set_warning_from_error(self, error):
-        text = self._error_messages.get(error.type, str(error))
+        text = MUC_DISCO_ERRORS.get(error.type, str(error))
         self._set_warning(text)
 
     def _set_warning_from_error_code(self, error_code):
-        self._set_warning(self._error_messages[error_code])
+        self._set_warning(MUC_DISCO_ERRORS[error_code])
 
     def _on_address_entry_changed(self, entry):
         text = entry.get_text()


=====================================
gajim/gtk/start_chat.py
=====================================
@@ -108,7 +108,7 @@ class StartChatDialog(Gtk.ApplicationWindow):
             bookmarks = con.get_module('Bookmarks').bookmarks
             groupchats = {}
             for bookmark in bookmarks:
-                groupchats[bookmark.jid] = bookmark.name
+                groupchats[str(bookmark.jid)] = bookmark.name
 
             for jid in app.contacts.get_gc_list(account):
                 if jid in groupchats:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/84f3c0235613472dd9bae4aea6319d54db5e7948...c34545bdf2833684c1e5f10c5a7a387075151398

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/compare/84f3c0235613472dd9bae4aea6319d54db5e7948...c34545bdf2833684c1e5f10c5a7a387075151398
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to