Skip to content

Commit ca031dc

Browse files
committed
More namecoin fixes
- namecoin lookup now also includes name of the record in the recipient field - namecoin lookups now support multiple semicolon-separated recipients like the other recipient-related functions. If there are multiple recipients, namecoin lookup will look up the last entry on the line, for example if you have "a; b; c" in the recipient line, it will lookup "c"
1 parent 29abf0f commit ca031dc

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/bitmessageqt/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2135,12 +2135,14 @@ def click_pushButtonLoadFromAddressBook(self):
21352135

21362136
def click_pushButtonFetchNamecoinID(self):
21372137
nc = namecoinConnection()
2138-
err, addr = nc.query(str(self.ui.lineEditTo.text()))
2138+
identities = str(self.ui.lineEditTo.text().toUtf8()).split(";")
2139+
err, addr = nc.query(identities[-1].strip())
21392140
if err is not None:
21402141
self.statusBar().showMessage(_translate(
21412142
"MainWindow", "Error: " + err))
21422143
else:
2143-
self.ui.lineEditTo.setText(addr)
2144+
identities[-1] = addr
2145+
self.ui.lineEditTo.setText("; ".join(identities))
21442146
self.statusBar().showMessage(_translate(
21452147
"MainWindow", "Fetched address from namecoin identity."))
21462148

@@ -4137,10 +4139,10 @@ def click_pushButtonNamecoinTest(self):
41374139
"MainWindow", "Testing..."))
41384140
options = {}
41394141
options["type"] = self.getNamecoinType()
4140-
options["host"] = self.ui.lineEditNamecoinHost.text()
4141-
options["port"] = self.ui.lineEditNamecoinPort.text()
4142-
options["user"] = self.ui.lineEditNamecoinUser.text()
4143-
options["password"] = self.ui.lineEditNamecoinPassword.text()
4142+
options["host"] = str(self.ui.lineEditNamecoinHost.text().toUtf8())
4143+
options["port"] = str(self.ui.lineEditNamecoinPort.text().toUtf8())
4144+
options["user"] = str(self.ui.lineEditNamecoinUser.text().toUtf8())
4145+
options["password"] = str(self.ui.lineEditNamecoinPassword.text().toUtf8())
41444146
nc = namecoinConnection(options)
41454147
response = nc.test()
41464148
responseStatus = response[0]

src/namecoin.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ def query (self, string):
118118
return (tr._translate("MainWindow",'The name %1 has no valid JSON data.').arg(unicode(string)), None)
119119

120120
if "bitmessage" in val:
121-
return (None, val["bitmessage"])
121+
if "name" in val:
122+
ret = "%s <%s>" % (val["name"], val["bitmessage"])
123+
else:
124+
ret = val["bitmessage"]
125+
return (None, ret)
122126
return (tr._translate("MainWindow",'The name %1 has no associated Bitmessage address.').arg(unicode(string)), None)
123127

124128
# Test the connection settings. This routine tries to query a "getinfo"
@@ -206,7 +210,7 @@ def queryHTTP (self, data):
206210
except:
207211
logger.error("HTTP receive error")
208212
except:
209-
logger.error("HTTP connection error")
213+
logger.error("HTTP connection error", exc_info=True)
210214

211215
return result
212216

0 commit comments

Comments
 (0)