diff --git a/src/cutecoin/core/account.py b/src/cutecoin/core/account.py index b26ad98b4cd151f0b292ce906ace3f7d4d863e21..3491a551b163d789f0117d084bb77af855202e41 100644 --- a/src/cutecoin/core/account.py +++ b/src/cutecoin/core/account.py @@ -298,7 +298,7 @@ class Account(QObject): key = SigningKey(self.salt, password) selfcert.sign([key]) logging.debug("Key publish : {0}".format(selfcert.signed_raw())) - replies = community.broadcast(qtbma.wot.Add, {}, {'pubkey': self.pubkey, + replies = community.bma_access.broadcast(qtbma.wot.Add, {}, {'pubkey': self.pubkey, 'self_': selfcert.signed_raw(), 'other': []}) for r in replies: diff --git a/src/cutecoin/core/net/api/bma/__init__.py b/src/cutecoin/core/net/api/bma/__init__.py index 00af271a8ce89d969998265520ea61ba72879fae..699a8cb7c32fd59d2f0f932711c55e2ac081a626 100644 --- a/src/cutecoin/core/net/api/bma/__init__.py +++ b/src/cutecoin/core/net/api/bma/__init__.py @@ -126,7 +126,14 @@ class API(object): logging.debug("POST : {0}".format(kwargs)) post_data = QUrlQuery() for k, v in kwargs.items(): - post_data.addQueryItem(k.replace("+", "%2b"), v.replace("+", "%2b")) + if type(k) is str: + k = k.replace("+", "%2b") + if type(v) is str: + v = v.replace("+", "%2b") + else: + v = json.dumps(v) + v = v.replace("+", "%2b") + post_data.addQueryItem(k, v) url = QUrl(self.reverse_url(path)) url.setQuery(post_data) diff --git a/src/cutecoin/gui/process_cfg_community.py b/src/cutecoin/gui/process_cfg_community.py index 6ec9c4913ac3d50a9255637e32342a6a42499174..ad439b71893d5a0104dba830cdb57471b3b3e022 100644 --- a/src/cutecoin/gui/process_cfg_community.py +++ b/src/cutecoin/gui/process_cfg_community.py @@ -210,13 +210,23 @@ class ProcessConfigureCommunity(QDialog, Ui_CommunityConfigurationDialog): QApplication.restoreOverrideCursor() self.add_community_and_close() + @pyqtSlot(int, str) + def handle_broadcast(self, error_code, text): + if self.app.preferences['notifications']: + toast.display(self.tr("UID broadcast"), self.tr("Identity broadcasted to the network")) + else: + QMessageBox.information(self, self.tr("UID broadcast"), self.tr("Identity broadcasted to the network")) + self.account.certification_broadcasted.disconnect() + self.account.broadcast_error.disconnect(self.handle_error) + QApplication.restoreOverrideCursor() + @pyqtSlot(int, str) def handle_error(self, error_code, text): if self.app.preferences['notifications']: toast.display(self.tr("Error"), self.tr("{0} : {1}".format(error_code, text))) else: QMessageBox.critical(self, self.tr("Error"), self.tr("{0} : {1}".format(error_code, text))) - self.account.certification_broadcasted.disconnect() + self.account.selfcert_broadcasted.disconnect() self.account.broadcast_error.disconnect(self.handle_error) QApplication.restoreOverrideCursor()