Philipp Hörist pushed to branch master at gajim / gajim
Commits:
a954839e by Philipp Hörist at 2022-10-28T23:23:11+02:00
refactor: Remove create_groupchat()
- - - - -
2 changed files:
- gajim/gtk/groupchat_creation.py
- gajim/gui_interface.py
Changes:
=====================================
gajim/gtk/groupchat_creation.py
=====================================
@@ -23,6 +23,7 @@
from nbxmpp.errors import StanzaError
from nbxmpp.task import Task
+from nbxmpp.protocol import JID
from gajim.common import app
from gajim.common import ged
@@ -294,10 +295,15 @@ def _create_muc(self, room_jid: str) -> None:
# Create new group chat by joining
assert self._account is not None
- app.interface.create_groupchat(
- self._account,
- str(room_jid),
- config)
+
+ if app.window.chat_exists(self._account, JID.from_string(room_jid)):
+ log.error('Trying to create groupchat '
+ 'which is already added as chat')
+ self.destroy()
+ return
+
+ client = app.get_client(self._account)
+ client.get_module('MUC').create(room_jid, config)
self.destroy()
=====================================
gajim/gui_interface.py
=====================================
@@ -34,9 +34,7 @@
from __future__ import annotations
from typing import Any
-from typing import Dict
from typing import Optional
-from typing import Union
import sys
import time
@@ -334,19 +332,6 @@ def start_file_transfer(self,
contact)
SendFileDialog(contact, send_callback, app.window, [path])
- @staticmethod
- def create_groupchat(account: str,
- room_jid: str,
- config: Dict[str, Union[str, bool]]
- ) -> None:
- if app.window.chat_exists(account, JID.from_string(room_jid)):
- log.error('Trying to create groupchat '
- 'which is already added as chat')
- return
-
- client = app.get_client(account)
- client.get_module('MUC').create(room_jid, config)
-
@staticmethod
def show_add_join_groupchat(account: str,
jid: str,
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/a954839ebe4361696b79f8e5afd138a7632fbf7e
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/a954839ebe4361696b79f8e5afd138a7632fbf7e
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