diff --git a/src/sakia/gui/navigation/informations/controller.py b/src/sakia/gui/navigation/informations/controller.py index ceec658d40c0b2cb4f39e094551cf7f1d17f9455..ffbc1b0e0318f0937af8f2855c9007a9cf9691be 100644 --- a/src/sakia/gui/navigation/informations/controller.py +++ b/src/sakia/gui/navigation/informations/controller.py @@ -106,13 +106,12 @@ class InformationsController(QObject): @asyncify async def send_join_demand(self, checked=False): - connection = await self.view.ask_for_connection(self.model.connections_with_uids()) - if not connection: + if not self.model.connection: return - secret_key, password = await PasswordInputController.open_dialog(self, connection) + secret_key, password = await PasswordInputController.open_dialog(self, self.model.connection) if not password or not secret_key: return - result = await self.model.send_join(connection, secret_key, password) + result = await self.model.send_join(secret_key, password) if result[0]: if self.model.notifications(): toast.display(self.tr("Membership"), self.tr("Success sending Membership demand")) diff --git a/src/sakia/gui/navigation/informations/model.py b/src/sakia/gui/navigation/informations/model.py index c99e904b81065aa3fc28cdf14c02917f88ddc232..8eca0642e5e22080d359eef78f604ddf1b0c96ed 100644 --- a/src/sakia/gui/navigation/informations/model.py +++ b/src/sakia/gui/navigation/informations/model.py @@ -170,4 +170,10 @@ class InformationsModel(QObject): Get community currency :return: the community in short currency format """ - return shortened(self.connection.currency) \ No newline at end of file + return shortened(self.connection.currency) + + def notifications(self): + return self.app.parameters.notifications + + async def send_join(self, secret_key, password): + return await self.app.documents_service.send_membership(self.connection, secret_key, password, "IN")