aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/guiutil.cpp5
-rw-r--r--src/qt/test/uritests.cpp3
-rw-r--r--src/qt/walletmodel.h5
3 files changed, 10 insertions, 3 deletions
diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp
index b65348548b..e7334e67cb 100644
--- a/src/qt/guiutil.cpp
+++ b/src/qt/guiutil.cpp
@@ -112,6 +112,11 @@ bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
rv.label = i->second;
fShouldReturnFalse = false;
}
+ if (i->first == "message")
+ {
+ rv.message = i->second;
+ fShouldReturnFalse = false;
+ }
else if (i->first == "amount")
{
if(!i->second.isEmpty())
diff --git a/src/qt/test/uritests.cpp b/src/qt/test/uritests.cpp
index 802d74719e..df4df3154b 100644
--- a/src/qt/test/uritests.cpp
+++ b/src/qt/test/uritests.cpp
@@ -50,9 +50,8 @@ void URITests::uriTests()
QVERIFY(rv.address == QString("175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W"));
QVERIFY(rv.label == QString());
- // We currently don't implement the message parameter (ok, yea, we break spec...)
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?req-message=Wikipedia Example Address"));
- QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
+ QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
uri.setUrl(QString("bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=1,000&label=Wikipedia Example"));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index 6abcdaf8cb..2e99eaddcb 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -21,11 +21,14 @@ QT_END_NAMESPACE
class SendCoinsRecipient
{
public:
- SendCoinsRecipient() : amount(0) { }
+ explicit SendCoinsRecipient() : amount(0) { }
+ explicit SendCoinsRecipient(const QString &addr, const QString &label, quint64 amount, const QString &message):
+ address(addr), label(label), amount(amount), message(message) {}
QString address;
QString label;
qint64 amount;
+ QString message;
// If from a payment request, paymentRequest.IsInitialized() will be true
PaymentRequestPlus paymentRequest;