Skip to content
Snippets Groups Projects
Commit 63f4e204 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

message channel: route messages through onTextMessage

Change-Id: I4f39abfb8cba90b428554b1972cf6ed72b7682e5
parent b7be61ef
Branches
No related tags found
No related merge requests found
...@@ -145,6 +145,7 @@ MessageChannelHandler::onReady(const std::shared_ptr<dht::crypto::Certificate>& ...@@ -145,6 +145,7 @@ MessageChannelHandler::onReady(const std::shared_ptr<dht::crypto::Certificate>&
socket->setOnRecv([acc = pimpl_->account_.lock(), socket->setOnRecv([acc = pimpl_->account_.lock(),
peerId, peerId,
deviceId = device.toString(),
ctx = std::make_shared<DecodingContext>()](const uint8_t* buf, size_t len) { ctx = std::make_shared<DecodingContext>()](const uint8_t* buf, size_t len) {
if (!buf || !acc) if (!buf || !acc)
return len; return len;
...@@ -158,12 +159,11 @@ MessageChannelHandler::onReady(const std::shared_ptr<dht::crypto::Certificate>& ...@@ -158,12 +159,11 @@ MessageChannelHandler::onReady(const std::shared_ptr<dht::crypto::Certificate>&
while (ctx->pac.next(oh)) { while (ctx->pac.next(oh)) {
Message msg; Message msg;
oh.get().convert(msg); oh.get().convert(msg);
acc->handleMessage(peerId, {msg.t, msg.c}); acc->onTextMessage("", peerId, deviceId, {{msg.t, msg.c}});
} }
} catch (const std::exception& e) { } catch (const std::exception& e) {
JAMI_WARNING("[convInfo] error on sync: {:s}", e.what()); JAMI_WARNING("[convInfo] Error parsing message: {:s}", e.what());
} }
return len; return len;
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment