Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
528aae47 by wurstsalat at 2021-12-22T00:25:45+01:00
Add chats to default workspace unless explicitly opened

- - - - -


3 changed files:

- gajim/gtk/controls/groupchat.py
- gajim/gtk/main.py
- gajim/gtk/start_chat.py


Changes:

=====================================
gajim/gtk/controls/groupchat.py
=====================================
@@ -683,7 +683,8 @@ def _on_roster_row_activated(self, _roster, nick):
             app.window.add_chat(self.account,
                                 participant.real_jid.bare,
                                 'contact',
-                                select=True)
+                                select=True,
+                                workspace='current')
         else:
             contact = self.contact.get_resource(nick)
             app.window.add_private_chat(self.account, contact.jid, select=True)


=====================================
gajim/gtk/main.py
=====================================
@@ -450,10 +450,15 @@ def _add_chat(self,
         account, jid, type_, select = param.unpack()
         self.add_chat(account, JID.from_string(jid), type_, select)
 
-    def add_chat(self, account: str, jid: JID, type_: str,
-                 select: bool = False) -> None:
-        workspace_id = self.get_active_workspace()
-        if workspace_id is None:
+    def add_chat(self,
+                 account: str,
+                 jid: JID,
+                 type_: str,
+                 select: bool = False,
+                 workspace: str = 'default') -> None:
+        if workspace == 'current':
+            workspace_id = self.get_active_workspace()
+        else:
             workspace_id = self._workspace_side_bar.get_first_workspace()
         self._chat_page.add_chat_for_workspace(workspace_id,
                                                account,


=====================================
gajim/gtk/start_chat.py
=====================================
@@ -338,7 +338,12 @@ def _start_new_chat(self, row):
             self._disco_muc(row.account, jid, request_vcard=row.new)
 
         else:
-            app.window.add_chat(row.account, jid, 'contact', select=True)
+            app.window.add_chat(
+                row.account,
+                jid,
+                'contact',
+                select=True,
+                workspace='current')
             self.ready_to_destroy = True
             self.destroy()
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/528aae4763759fc81fb305cbfa62a02681ec99a1

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/528aae4763759fc81fb305cbfa62a02681ec99a1
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