diff --git a/interface/src/commerce/Ledger.cpp b/interface/src/commerce/Ledger.cpp
index 76861283bd..fde8c49933 100644
--- a/interface/src/commerce/Ledger.cpp
+++ b/interface/src/commerce/Ledger.cpp
@@ -173,7 +173,8 @@ QString userLink(const QString& username, const QString& placename) {
QString transactionString(const QJsonObject& valueObject) {
int sentCerts = valueObject["sent_certs"].toInt();
int receivedCerts = valueObject["received_certs"].toInt();
- int sent = valueObject["sent_money"].toInt();
+ int sentMoney = valueObject["sent_money"].toInt();
+ int receivedMoney = valueObject["received_money"].toInt();
int dateInteger = valueObject["created_at"].toInt();
QString message = valueObject["message"].toString();
QDateTime createdAt(QDateTime::fromSecsSinceEpoch(dateInteger, Qt::UTC));
@@ -181,7 +182,7 @@ QString transactionString(const QJsonObject& valueObject) {
if (sentCerts <= 0 && receivedCerts <= 0 && !KNOWN_USERS.contains(valueObject["sender_name"].toString())) {
// this is an hfc transfer.
- if (sent > 0) {
+ if (sentMoney > 0) {
QString recipient = userLink(valueObject["recipient_name"].toString(), valueObject["place_name"].toString());
result += QString("Money sent to %1").arg(recipient);
} else {
@@ -191,6 +192,18 @@ QString transactionString(const QJsonObject& valueObject) {
if (!message.isEmpty()) {
result += QString("
with memo: \"%1\"").arg(message);
}
+ } else if (sentMoney <= 0 && receivedMoney <= 0 && (sentCerts > 0 || receivedCerts > 0) && !KNOWN_USERS.contains(valueObject["sender_name"].toString())) {
+ // this is a non-HFC asset transfer.
+ if (sentCerts > 0) {
+ QString recipient = userLink(valueObject["recipient_name"].toString(), valueObject["place_name"].toString());
+ result += QString("Gift sent to %1").arg(recipient);
+ } else {
+ QString sender = userLink(valueObject["sender_name"].toString(), valueObject["place_name"].toString());
+ result += QString("Gift from %1").arg(sender);
+ }
+ if (!message.isEmpty()) {
+ result += QString("
with memo: \"%1\"").arg(message);
+ }
} else {
result += valueObject["message"].toString();
}