Strider
4 years ago
5 changed files with 165 additions and 95 deletions
@ -0,0 +1,67 @@ |
|||
// Copyright 2019-2020 The Hush developers
|
|||
// GPLv3
|
|||
|
|||
#include "ContactRequest.h" |
|||
|
|||
ContactRequest::ContactRequest() {} |
|||
|
|||
ContactRequest::ContactRequest(QString sender, QString receiver, QString memo, QString cid) |
|||
{ |
|||
_senderAddress = sender; |
|||
_receiverAddress = receiver; |
|||
_memo = memo; |
|||
_cid = cid; |
|||
} |
|||
|
|||
QString ContactRequest::getSenderAddress() |
|||
{ |
|||
return _senderAddress; |
|||
} |
|||
|
|||
QString ContactRequest::getReceiverAddress() |
|||
{ |
|||
return _receiverAddress; |
|||
} |
|||
|
|||
QString ContactRequest::getMemo() |
|||
{ |
|||
return _memo; |
|||
} |
|||
|
|||
QString ContactRequest::getCid() |
|||
{ |
|||
return _cid; |
|||
} |
|||
|
|||
void ContactRequest::setSenderAddress(QString address) |
|||
{ |
|||
_senderAddress = address; |
|||
} |
|||
|
|||
void ContactRequest::setReceiverAddress(QString address) |
|||
{ |
|||
_receiverAddress = address; |
|||
} |
|||
|
|||
void ContactRequest::setMemo(QString memo) |
|||
{ |
|||
_memo = memo; |
|||
} |
|||
|
|||
void ContactRequest::setCid(QString cid) |
|||
{ |
|||
_cid = cid; |
|||
} |
|||
|
|||
QString ContactRequest::toString() |
|||
{ |
|||
return "sender: " + _senderAddress + " receiver: " + _receiverAddress + " memo: " + _memo + " cid: " + _cid; |
|||
} |
|||
|
|||
ContactRequest::~ContactRequest() |
|||
{ |
|||
_senderAddress = ""; |
|||
_receiverAddress = ""; |
|||
_memo = ""; |
|||
_cid = ""; |
|||
} |
@ -0,0 +1,33 @@ |
|||
// Copyright 2019-2020 The Hush developers
|
|||
// GPLv3
|
|||
|
|||
#ifndef CONTACTREQUEST_H |
|||
#define CONTACTREQUEST_H |
|||
|
|||
#include <QString> |
|||
using json = nlohmann::json; |
|||
|
|||
class ContactRequest |
|||
{ |
|||
private: |
|||
QString _senderAddress; |
|||
QString _receiverAddress; |
|||
QString _memo; |
|||
QString _cid; |
|||
|
|||
public: |
|||
ContactRequest(); |
|||
ContactRequest(QString sender, QString receiver, QString memo, QString cid); |
|||
QString getSenderAddress(); |
|||
QString getReceiverAddress(); |
|||
QString getMemo(); |
|||
QString getCid(); |
|||
void setSenderAddress(QString address); |
|||
void setReceiverAddress(QString contact); |
|||
void setMemo(QString memo); |
|||
void setCid(QString cid); |
|||
QString toString(); |
|||
~ContactRequest(); |
|||
}; |
|||
|
|||
#endif |
Loading…
Reference in new issue