summaryrefslogtreecommitdiffstats
path: root/pica-client
diff options
context:
space:
mode:
authorAnton <anton@picapica>2019-03-06 19:26:22 +0400
committerAnton <anton@picapica>2019-03-06 19:26:22 +0400
commitfc8c3b76068530a288c3fcd95f9c651996352402 (patch)
tree003c852c616a38b97d0d795df522dc0703da7d62 /pica-client
parent73c06c18c5c6401ee08748ebed08c8896f63e344 (diff)
downloadpica-pica-fc8c3b76068530a288c3fcd95f9c651996352402.tar.gz
pica-pica-fc8c3b76068530a288c3fcd95f9c651996352402.zip
add new callback direct_c2c_established_cb()
Diffstat (limited to 'pica-client')
-rw-r--r--pica-client/skynet.cpp10
-rw-r--r--pica-client/skynet.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/pica-client/skynet.cpp b/pica-client/skynet.cpp
index da39a3b..35b7e60 100644
--- a/pica-client/skynet.cpp
+++ b/pica-client/skynet.cpp
@@ -56,7 +56,8 @@ SkyNet::SkyNet()
c2n_failed_cb,
c2n_closed_cb,
listener_error_cb,
- multilogin_cb
+ multilogin_cb,
+ direct_c2c_established_cb
};
PICA_client_init(&cbs);
@@ -910,7 +911,7 @@ void SkyNet::msgok_cb(const unsigned char *peer_id)
void SkyNet::c2c_established_cb(const unsigned char *peer_id, const char *ciphersuitename)
{
- skynet->emit_ConnectionStatusUpdated(QByteArray((const char*)peer_id, PICA_ID_SIZE), QString("🔐: %1").arg(ciphersuitename));
+ skynet->emit_ConnectionStatusUpdated(QByteArray((const char*)peer_id, PICA_ID_SIZE), QString("🔐: %1 c2c").arg(ciphersuitename));
skynet->flush_queues(QByteArray((const char*)peer_id, PICA_ID_SIZE));
}
@@ -1089,3 +1090,8 @@ void SkyNet::multilogin_cb(uint64_t timestamp, void *addr_bin, const char *addr_
{
skynet->emit_MultiloginMessageReceived(timestamp, QString(addr_str), port);
}
+
+void SkyNet::direct_c2c_established_cb(const unsigned char *peer_id, const char *ciphersuitename)
+{
+ skynet->emit_ConnectionStatusUpdated(QByteArray((const char*)peer_id, PICA_ID_SIZE), QString("🔐: %1 direct c2c").arg(ciphersuitename));
+}
diff --git a/pica-client/skynet.h b/pica-client/skynet.h
index cefcb91..875277e 100644
--- a/pica-client/skynet.h
+++ b/pica-client/skynet.h
@@ -173,6 +173,8 @@ private:
static void multilogin_cb(uint64_t timestamp, void *addr_bin, const char *addr_str, uint16_t port);
+ static void direct_c2c_established_cb(const unsigned char *peer_id, const char *ciphersuitename);
+
private slots:
void nodelink_activated(PICA_c2n *c2n);
void nodelink_closed(PICA_c2n *c2n, int error);