ChatRecord::ChatRecord(ChatMessage message, QObject *parent) : QObject(parent), time(message.getCreateTime()), uuid(message.getUuid()), userUuid(message.getSenderUuid()), content(message.getContent()), isRead(NotRead) { initSendOrReceive(); }
void ChatForm::receiveSuccess(QHostAddress senderIp, quint16 senderPort, ChatMessage message){ qDebug() << message.getSenderUuid() << receiver->getUuid(); if(message.getSenderUuid() == receiver->getUuid()) { if(message.getContent() == ":/shake") { startShake(); } ChatRecord *record = new ChatRecord(message); mChatRecords.append(record); updateChatRecordView(); } }