diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-08-30 13:34:02 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-08-30 13:34:02 +0000 |
| commit | 0ef7c1d7471ce20fe54729c27858db864aedee91 (patch) | |
| tree | 3a71b713febdbea19fc7358af68d9f6cfa3c3158 /pica-client/msguirouter.cpp | |
| parent | bfd5528f28264772a245dc29f41d4bb5d29fb1eb (diff) | |
| download | pica-pica-0ef7c1d7471ce20fe54729c27858db864aedee91.tar.gz pica-pica-0ef7c1d7471ce20fe54729c27858db864aedee91.zip | |
updated pica-client to make it handle new id format. quint32 type for id is replaced with QByteArray in most places. Implemented verification callbacks in client and node that allow self-signed certificates
git-svn-id: svn://localhost/project_picapica/trunk@266 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/msguirouter.cpp')
| -rw-r--r-- | pica-client/msguirouter.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/pica-client/msguirouter.cpp b/pica-client/msguirouter.cpp index 9750d4d..d4a62c4 100644 --- a/pica-client/msguirouter.cpp +++ b/pica-client/msguirouter.cpp @@ -17,15 +17,15 @@ MsgUIRouter::MsgUIRouter(QObject *parent) : QObject(parent) { - connect(skynet, SIGNAL(MessageReceived(quint32,QString)), this, SLOT(msg_from_peer(quint32,QString))); - connect(skynet, SIGNAL(UnableToDeliver(quint32,QString)), this, SLOT(delivery_failed(quint32,QString))); - connect(skynet, SIGNAL(Delivered(quint32)), this, SLOT(delivered(quint32))); - connect(skynet, SIGNAL(CertificateForged(quint32,QString,QString)), this, SLOT(scary_cert_message(quint32,QString,QString))); + connect(skynet, SIGNAL(MessageReceived(QByteArray,QString)), this, SLOT(msg_from_peer(QByteArray,QString))); + connect(skynet, SIGNAL(UnableToDeliver(QByteArray,QString)), this, SLOT(delivery_failed(QByteArray,QString))); + connect(skynet, SIGNAL(Delivered(QByteArray)), this, SLOT(delivered(QByteArray))); + connect(skynet, SIGNAL(CertificateForged(QByteArray,QString,QString)), this, SLOT(scary_cert_message(QByteArray,QString,QString))); connect(skynet, SIGNAL(ErrMsgFromNode(QString)), this, SLOT(notification(QString))); } -void MsgUIRouter::create_chatwindow(quint32 peer_id) +void MsgUIRouter::create_chatwindow(QByteArray peer_id) { ChatWindow *cw; @@ -39,7 +39,7 @@ void MsgUIRouter::create_chatwindow(quint32 peer_id) cw->show(); } -void MsgUIRouter::msg_from_peer(quint32 from, QString msg) +void MsgUIRouter::msg_from_peer(QByteArray from, QString msg) { if ( ! chatwindows.contains(from)) @@ -56,7 +56,7 @@ void MsgUIRouter::msg_to_peer(QString msg, ChatWindow *sender_window) skynet->SendMessage(sender_window->getPeerId(), msg); } -void MsgUIRouter::start_chat(quint32 peer_id) +void MsgUIRouter::start_chat(QByteArray peer_id) { if ( ! chatwindows.contains(peer_id)) { @@ -73,7 +73,7 @@ void MsgUIRouter::chatwindow_closed(ChatWindow *sender_window) chatwindows.remove(sender_window->getPeerId()); } -void MsgUIRouter::delivery_failed(quint32 to, QString msg) +void MsgUIRouter::delivery_failed(QByteArray to, QString msg) { // if (chatwindows.contains(to)) // { @@ -81,7 +81,7 @@ void MsgUIRouter::delivery_failed(quint32 to, QString msg) // } } -void MsgUIRouter::delivered(quint32 to) +void MsgUIRouter::delivered(QByteArray to) { if (chatwindows.contains(to)) { @@ -89,13 +89,13 @@ void MsgUIRouter::delivered(quint32 to) } else { - History h(config_dbname, account_id); + History h(config_dbname, QByteArray((const char*)account_id, PICA_ID_SIZE)); h.SetDelivered(to); } } -void MsgUIRouter::scary_cert_message(quint32 peer_id, QString received_cert, QString stored_cert) +void MsgUIRouter::scary_cert_message(QByteArray peer_id, QString received_cert, QString stored_cert) { ForgedCertDialog fcd(peer_id, received_cert, stored_cert); fcd.exec(); |
