render only new requests

This commit is contained in:
DenioD
2020-05-27 21:42:39 +02:00
parent f57dc2c5ad
commit cfbcc43b14
18 changed files with 157 additions and 55 deletions

View File

@@ -5,7 +5,7 @@
ChatItem::ChatItem() {}
ChatItem::ChatItem(long timestamp, QString address, QString contact, QString memo, QString requestZaddr, QString type, QString cid, QString txid, int confirmations, bool notarize)
ChatItem::ChatItem(long timestamp, QString address, QString contact, QString memo, QString requestZaddr, QString type, QString cid, QString txid, int confirmations, bool notarize, bool iscontact)
{
_timestamp = timestamp;
_address = address;
@@ -18,9 +18,10 @@ ChatItem::ChatItem(long timestamp, QString address, QString contact, QString mem
_confirmations = confirmations;
_outgoing = false;
_notarize = notarize;
_iscontact = iscontact;
}
ChatItem::ChatItem(long timestamp, QString address, QString contact, QString memo, QString requestZaddr, QString type, QString cid, QString txid, int confirmations, bool outgoing, bool notarize)
ChatItem::ChatItem(long timestamp, QString address, QString contact, QString memo, QString requestZaddr, QString type, QString cid, QString txid, int confirmations, bool outgoing, bool notarize, bool iscontact)
{
_timestamp = timestamp;
_address = address;
@@ -33,6 +34,8 @@ ChatItem::ChatItem(long timestamp, QString address, QString contact, QString mem
_confirmations = confirmations;
_outgoing = outgoing;
_notarize = notarize;
_iscontact = iscontact;
}
long ChatItem::getTimestamp()
@@ -88,6 +91,11 @@ bool ChatItem::isNotarized()
return _notarize;
}
bool ChatItem::isContact()
{
return _iscontact;
}
void ChatItem::setTimestamp(long timestamp)
{
_timestamp = timestamp;
@@ -140,6 +148,11 @@ void ChatItem::notarized()
_notarize = false;
}
void ChatItem::contact(bool iscontact)
{
_iscontact = iscontact;
}
QString ChatItem::toChatLine()
{

View File

@@ -21,11 +21,12 @@ class ChatItem
int _confirmations;
bool _outgoing = false;
bool _notarize = false;
bool _iscontact = false;
public:
ChatItem();
ChatItem(long timestamp, QString address, QString contact, QString memo,QString requestZaddr, QString type, QString cid, QString txid, int confirmations, bool notarize);
ChatItem(long timestamp, QString address, QString contact, QString memo, QString requestZaddr, QString type, QString cid, QString txid, int confirmations, bool outgoing, bool notarize);
ChatItem(long timestamp, QString address, QString contact, QString memo,QString requestZaddr, QString type, QString cid, QString txid, int confirmations, bool notarize, bool iscontact);
ChatItem(long timestamp, QString address, QString contact, QString memo, QString requestZaddr, QString type, QString cid, QString txid, int confirmations, bool outgoing, bool notarize, bool iscontact);
long getTimestamp();
QString getAddress();
QString getContact();
@@ -38,6 +39,7 @@ class ChatItem
bool isOutgoing();
bool isdouble();
bool isNotarized();
bool isContact();
void setTimestamp(long timestamp);
void setAddress(QString address);
void setContact(QString contact);
@@ -49,6 +51,7 @@ class ChatItem
void setConfirmations(int confirmations);
void toggleOutgo();
void notarized();
void contact(bool iscontact);
QString toChatLine();
json toJson();
~ChatItem();

View File

@@ -1,4 +1,9 @@
// Copyright 2019-2020 The Hush developers
// GPLv3
#include "ContactItem.h"
#include "chatmodel.h"
#include "Model/ChatItem.h"
#include "controller.h"
ContactItem::ContactItem() {}
@@ -8,7 +13,7 @@ ContactItem::ContactItem(QString name, QString partnerAddress, QString myAddress
_myAddress = myAddress;
_partnerAddress = partnerAddress;
_cid = cid;
_avatar = avatar;
_avatar = avatar;
}
QString ContactItem::getName() const

View File

@@ -1,8 +1,11 @@
// Copyright 2019-2020 The Hush developers
// GPLv3
#ifndef CONTACTITEM_H
#define CONTACTITEM_H
#include <vector>
#include <QString>
#include "mainwindow.h"
using json = nlohmann::json;
class ContactItem
@@ -13,7 +16,7 @@ private:
QString _name;
QString _cid;
QString _avatar;
public:
ContactItem();
ContactItem(QString name, QString partnerAddress, QString myAddress, QString cid, QString avatar);